-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (65 loc) · 1.5 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
BINARY = acfg
ACSRV_BINARY = acServer
STRACKER_BINARY = stracker
GOARCH = amd64
BUILD_DIR = build/
.PHONY: all
all:
$(MAKE) clean
$(MAKE) deps
$(MAKE) client
$(MAKE) static
$(MAKE) darwin
$(MAKE) linux
$(MAKE) dummysrv
#$(MAKE) docker
.PHONY: dummysrv
dummysrv:
$(MAKE) darwin-dummysrv
$(MAKE) linux-dummysrv
.PHONY: darwin-dummysrv
darwin-dummysrv:
cd dummysrv/acserver && \
GOOS=darwin GOARCH=${GOARCH} go build -o ${ACSRV_BINARY}-darwin-${GOARCH} . && \
cd ../stracker && \
GOOS=darwin GOARCH=${GOARCH} go build -o ${STRACKER_BINARY}-darwin-${GOARCH} .
.PHONY: linux-dummysrv
linux-dummysrv:
cd dummysrv/acserver/ && \
GOOS=linux GOARCH=${GOARCH} go build -o ${ACSRV_BINARY}-linux-${GOARCH} . && \
cd ../stracker/ && \
GOOS=linux GOARCH=${GOARCH} go build -o ${STRACKER_BINARY}-linux-${GOARCH} .
.PHONY: clean
clean:
-rm -r build/; \
mkdir build/
.PHONY: deps
deps:
cd client && yarn && \
cd ../server && go mod tidy
.PHONY: client
client:
cd client/ && \
yarn prebuild && \
yarn build-dist
.PHONY: static
static:
cp -R client/dist/* server/static/
.PHONY: darwin
darwin:
cd server/main/ && \
GOOS=darwin GOARCH=${GOARCH} go build -o ../../build/${BINARY}-darwin-${GOARCH} .
.PHONY: linux
linux:
cd server/main/ && \
GOOS=linux GOARCH=${GOARCH} go build -o ../../build/${BINARY}-linux-${GOARCH} .
.PHONY: docker
docker:
docker build --no-cache -t acfg . && \
docker save acfg -o build/acfg-docker-image
.PHONY: test
test:
cd server/ && \
go test ./... && \
cd ../client/ && \
yarn test