-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
79 lines (66 loc) · 1.7 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
EXE=
ifeq ($(OS), Windows_NT)
EXE=.exe
endif
SOURCES = \
database/database.go\
database/database_test.go\
database/helpers_test.go\
database/json.go\
database/mysql.go\
logger/logger.go\
logic/admin.go\
logic/config.go\
logic/cycles.go\
logic/dataimporter.go\
logic/link.go\
logic/logic.go\
logic/movies.go\
logic/security.go\
logic/user.go\
logic/vote.go\
main.go\
models/authmethod.go\
models/cycle.go\
models/error.go\
models/link.go\
models/movie.go\
models/tag.go\
models/urlkey.go\
models/user.go\
models/util.go\
models/vote.go\
web/handlerStatic.go\
web/handlerVote.go\
web/handlersAuth.go\
web/pageAddMovie.go\
web/pageAdmin.go\
web/pageHistory.go\
web/pageMain.go\
web/pageMovie.go\
web/pageUser.go\
web/server.go\
web/session.go\
web/template_structs.go\
web/templates.go
.PHONY: all data fmt server
CMD_SERVER=bin/server$(EXE)
CMD_DATA=bin/mkdata$(EXE)
RELEASEVERSION ?=$(shell git describe --tags --dirty --broken)
all: fmt $(CMD_SERVER)
data: fmt $(CMD_DATA)
server: main.go fmt $(SOURCES)
GOOS=linux GOARCH=386 go$(GO_VERSION) build -ldflags "-X main.ReleaseVersion=${RELEASEVERSION}" -o bin/MoviePolls $<
clean:
@echo "Cleaning up binaries"
@rm -f $(CMD_SERVER) $(CMD_DATA) bin/MoviePolls
cleanall: clean
@./make/confirm.sh
fmt:
@echo "gofmt -w {SOURCES}" && gofmt -w $(SOURCES)
$(CMD_SERVER): main.go $(SOURCES)
go$(GO_VERSION) build -ldflags "-X main.ReleaseVersion=${RELEASEVERSION}" -o $@ $<
$(CMD_DATA): scripts/mkdata.go $(SOURCES)
go$(GO_VERSION) build -ldflags "-X main.ReleaseVersion=${RELEASEVERSION}" -o $@ $<
run: all
cmd/server