-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
Makefile
53 lines (45 loc) · 1.2 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
TARGET=./build
ARCHS=amd64 386
LDFLAGS="-s -w"
GCFLAGS="all=-trimpath=$(shell pwd)"
ASMFLAGS="all=-trimpath=$(shell pwd)"
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} ; \
mv lists/ ${GOPATH}/bin; \
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} ..." ; \
cp -r lists/ /bin; \
GOOS=linux GOARCH=$${GOARCH} GO111MODULE=on CGO_ENABLED=0 go build -ldflags=${LDFLAGS} -gcflags=${GCFLAGS} -asmflags=${ASMFLAGS} -o /bin/scilla ; \
done; \
echo "Done."
unlinux:
@for GOARCH in ${ARCHS}; do \
echo "Unlinuxing for linux $${GOARCH} ..." ; \
rm -rf /bin/lists; \
rm -rf /bin/scilla ; \
done; \
echo "Done."
test:
@go test -v -race ./... ; \
echo "Done."
clean:
@rm -rf ${TARGET}/* ; \
go clean ./... ; \
echo "Done."