-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (43 loc) · 1.22 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
DESTDIR ?= /usr/share/flydown/
REL_DIR = ./release
LINKER_FLAGS = -ldflags="-s -w"
.PHONY: get_deps
get_deps:
go get .
compile :
go build $(LINKER_FLAGS) flydown.go
# you need to install upx to your host and then goupx with:
# go get github.com/pwaller/goupx
compress:
goupx flydown
compile_arm5:
GOARCH=arm GOARM=5 go build $(LINKER_FLAGS) flydown.go
compile_arm7:
GOARCH=arm GOARM=7 go build $(LINKER_FLAGS) flydown.go
compile_arm8:
GOARCH=arm64 go build $(LINKER_FLAGS) flydown.go
release:
ifndef VERSION
@echo "specify the version"
exit 1
endif
ifndef ARCH
@echo "specify the arch"
exit 1
endif
install -d $(REL_DIR)/flydown_$(VERSION)_$(ARCH)
cp -f flydown $(REL_DIR)/flydown_$(VERSION)_$(ARCH)
cp -f install.sh $(REL_DIR)/flydown_$(VERSION)_$(ARCH)
cp -af doc $(REL_DIR)/flydown_$(VERSION)_$(ARCH)
cp -af static $(REL_DIR)/flydown_$(VERSION)_$(ARCH)
cp -af templates $(REL_DIR)/flydown_$(VERSION)_$(ARCH)
cd $(REL_DIR);tar cf - flydown_$(VERSION)_$(ARCH)/ | xz -z - > flydown_$(VERSION)_$(ARCH).tar.xz
rm -rf $(REL_DIR)/flydown_$(VERSION)_$(ARCH)
clear_release:
rm -rf $(REL_DIR)
install:
install -d $(DESTDIR)
cp -f flydown /usr/bin
cp -r doc $(DESTDIR)
cp -r static $(DESTDIR)
cp -r templates $(DESTDIR)