-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·34 lines (28 loc) · 1.01 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
GOARCH = amd64
SERVER_BINARY = gcpd
CLIENT_BINARY = gcp
BUILD_DIR=$(shell pwd)
BIN_DIR=${BUILD_DIR}/bin
# Build the project
all: linux darwin windows
clean:
@rm -rf ${BIN_DIR}
init: clean
@mkdir -p ${BIN_DIR}/win
@mkdir -p ${BIN_DIR}/linux
@mkdir -p ${BIN_DIR}/darwin
linux: init
cd ${BUILD_DIR}; \
GOOS=linux GOARCH=${GOARCH} go build -o ${BIN_DIR}/linux/${SERVER_BINARY} gcp_server/server.go ; \
GOOS=linux GOARCH=${GOARCH} go build -o ${BIN_DIR}/linux/${CLIENT_BINARY} gcp_client/client.go ; \
cd - >/dev/null
darwin: init
cd ${BUILD_DIR}; \
GOOS=darwin GOARCH=${GOARCH} go build -o ${BIN_DIR}/darwin/${SERVER_BINARY} gcp_server/server.go ; \
GOOS=darwin GOARCH=${GOARCH} go build -o ${BIN_DIR}/darwin/${CLIENT_BINARY} gcp_client/client.go ; \
cd - >/dev/null
windows: init
cd ${BUILD_DIR}; \
GOOS=windows GOARCH=${GOARCH} go build -o ${BIN_DIR}/win/${SERVER_BINARY}.exe gcp_server/server.go ; \
GOOS=windows GOARCH=${GOARCH} go build -o ${BIN_DIR}/win/${CLIENT_BINARY}.exe gcp_client/client.go ; \
cd - >/dev/null