-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Makefile
50 lines (41 loc) · 1.16 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
TARGET=./build
ARCHS=amd64 386
LDFLAGS="-s -w"
GCFLAGS="all=-trimpath=$(shell pwd)"
ASMFLAGS="all=-trimpath=$(shell pwd)"
current:
@go build -o ./scilla; \
echo "Done."
fmt:
@gofmt -s ./*; \
echo "Done."
remod:
rm -rf go.*
go mod init github.com/edoardottt/scilla
go get
update:
@go get -u; \
go mod tidy -v; \
echo "Done."
windows:
@for GOARCH in ${ARCHS}; do \
echo "Building for windows $${GOARCH} ..." ; \
mkdir -p ${TARGET}/scilla-windows-$${GOARCH} ; \
GOOS=windows GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/scilla-windows-$${GOARCH}/scilla.exe ; \
done; \
echo "Done."
linux:
@for GOARCH in ${ARCHS}; do \
echo "Building for linux $${GOARCH} ..." ; \
mkdir -p ${TARGET}/scilla-linux-$${GOARCH} ; \
GOOS=linux GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o ${TARGET}/scilla-linux-$${GOARCH}/scilla ; \
done; \
echo "Done."
all: clean fmt update test linux windows
test:
@go test -v -race ./... ; \
echo "Done."
clean:
@rm -rf ${TARGET}/* ; \
go clean ./... ; \
echo "Done."