forked from usetania/tania-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (48 loc) · 1.51 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
.PHONY: all cover clean clean-osx clean-linux-arm clean-linux-amd64 clean-win64 \
osx linux-amd64 linux-arm windows fetch-dep run osxcross.bin
all: osx linux-amd64 linux-arm windows
clean:
@[ -f tania.osx.amd64 ] && rm -f tania.osx.amd64 || true
@[ -f tania.linux.arm ] && rm -f tania.linux.arm || true
@[ -f tania.linux.amd64 ] && rm -f tania.linux.amd64 || true
@[ -f tania.win.amd64.exe ] && rm -f tania.win.amd64.exe || true
clean-osx: tania.osx.amd64
rm -rf $^
clean-linux-arm: tania.linux.arm
rm -rf $^
clean-linux-amd64: tania.linux.amd64
rm -rf $^
clean-win64: tania.win.amd64.exe
rm -rf $^
tania.osx.amd64: main.go
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -ldflags '-s -w' -o $@
file $@
osx: tania.osx.amd64
osxcross: main.go
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 \
CC=o64-clang \
CXX=o64-clang++ \
go build -ldflags '-s -w' -o tania.osx.amd64
file tania.osx.amd64
tania.linux.arm: main.go
CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 \
CC=arm-linux-gnueabihf-gcc \
CXX=arm-linux-gnueabihf-g++ \
go build -ldflags '-s -w' -o $@
file $@
linux-arm: tania.linux.arm
tania.linux.amd64: main.go
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags '-s -w' -o $@
file $@
linux-amd64: tania.linux.amd64
tania.windows.amd64.exe: main.go
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 \
CC=x86_64-w64-mingw32-gcc \
CXX=x86_64-w64-mingw32-g++ \
go build -ldflags '-s -w' -o $@
file $@
windows: tania.windows.amd64.exe
fetch-dep: Gopkg.toml Gopke.lock
dep ensure
run: main.go
go run $^