-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·45 lines (38 loc) · 1.29 KB
/
Makefile
File metadata and controls
executable file
·45 lines (38 loc) · 1.29 KB
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
BUILD_ROOT=$(PWD)
BUILD_TARGET=ctrlapp
.PHONY: ${BUILD_TARGET} ${BUILD_TARGET}_arm64 ${BUILD_TARGET}_arm ${BUILD_TARGET}_win.exe
all: ${BUILD_TARGET}
${BUILD_TARGET}:
@gofmt -l -w ${BUILD_ROOT}/
@export GO111MODULE=on && \
export GOPROXY=https://goproxy.io && \
go build -ldflags "-w" -o $@ ctrlapp.go
@chmod 777 $@
${BUILD_TARGET}_arm64:
@gofmt -l -w ${BUILD_ROOT}/
@export GO111MODULE=on && \
export GOPROXY=https://goproxy.io && \
GOARCH=arm64 GOOS="linux" CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc go build -ldflags "-w" -o $@ ctrlapp.go
@chmod 777 $@
${BUILD_TARGET}_arm:
@gofmt -l -w ${BUILD_ROOT}/
@export GO111MODULE=on && \
export GOPROXY=https://goproxy.io && \
GOARCH=arm GOOS="linux" GOARM=7 CGO_ENABLED=1 CC=arm-linux-gnueabi-gcc go build -ldflags "-w -extldflags -static" -o $@ ctrlapp.go
@chmod 777 $@
${BUILD_TARGET}_win.exe:
@gofmt -l -w ${BUILD_ROOT}/
@export GO111MODULE=on && \
export GOPROXY=https://goproxy.io && \
GOARCH=amd64 GOOS="windows" CGO_ENABLED=1 go build -o $@ ctrlapp.go
@chmod 777 $@
install:
@mkdir -p out
@chmod 777 ${BUILD_TARGET}
@cp -a conf ${BUILD_TARGET} out/
sync;sync
@echo "[Done]"
.PHONY: clean install
clean:
@rm -rf ${BUILD_TARGET} ${BUILD_TARGET}_arm64 ${BUILD_TARGET}_arm ${BUILD_TARGET}_win.exe *.db *.tar.gz
@echo "[clean Done]"