-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
52 lines (51 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Binary name
BINARY=chatroom
VERSION = 0.1
# Builds the project
build:
go build -o ${BINARY}
go test -v
# Installs our project: copies binaries
install:
go install
release:
cd bin
# Clean
go clean
rm -rf *.gz
# Build for mac
cd ../client
go build
mv client ../bin
cd ../server
go build
mv server ../bin
cd ../bin
tar czvf ../release/chatroom-mac64-1.0.tar.gz *
# Build for linux
go clean
rm -rf *.gz
cd ../client
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
mv client ../bin
cd ../server
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
mv server ../bin
cd ../bin
tar czvf ../release/chatroom-linux64-1.0.tar.gz *
# Build for win
go clean
rm -rf *.gz
cd ../client
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build
mv client ../bin
cd ../server
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build
mv server ../bin
cd ../bin
tar czvf ../release/chatroom-win64-1.0.tar.gz *
go clean
# Cleans our projects: deletes binaries
clean:
go clean
.PHONY: clean build