-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.37 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
# Cesty k Android NDK
#ANDROID_NDK_HOME ?= /path/to/your/android/ndk
# Podmíněná proměnná
IS_RASPBERRY_PI := $(shell grep -q "Raspberry Pi" /proc/cpuinfo && echo true)
# Název výstupního souboru
OUTPUT = PerliNet
# Výchozí cíle
.PHONY: clean all zip
all:
cd beep; make
cd ..
go mod tidy
go test
go build
cross: raspberrypi linux windows64 windows32 macos
linux:
GOOS=linux GOARCH=amd64 go build -o $(OUTPUT)-linux main.go
windows64:
GOOS=windows GOARCH=amd64 go build -o $(OUTPUT).exe main.go
zip $(OUTPUT)-windows64.zip $(OUTPUT).exe
rm $(OUTPUT).exe
windows32:
GOOS=windows GOARCH=386 go build -o $(OUTPUT).exe main.go
zip $(OUTPUT)-windows32.zip $(OUTPUT).exe
rm $(OUTPUT).exe
macos:
GOOS=darwin GOARCH=amd64 go build -o $(OUTPUT)-macos main.go
raspberrypi:
GOOS=linux GOARCH=arm GOARM=6 go build -o $(OUTPUT)-armv6l main.go
#android-armv7:
# GOOS=android GOARCH=arm GOARM=7 CGO_ENABLED=1 CC=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang go build -o $(OUTPUT)-armv7 main.go
#android-arm64:
# GOOS=android GOARCH=arm64 CGO_ENABLED=1 CC=$(ANDROID_NDK_HOME)/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang go build -o $(OUTPUT)-arm64 main.go
clean:
rm -f $(OUTPUT)-linux $(OUTPUT)-windows64.zip $(OUTPUT)-windows32.zip $(OUTPUT)-armv6l $(OUTPUT)-macos #$(OUTPUT)-armv7 $(OUTPUT)-arm64