-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (50 loc) · 1.32 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
GOC=go build
GOFLAGS=-a -ldflags '-s'
CGOR=CGO_ENABLED=0
OS_PERMS=sudo
GIT_HASH=$(shell git rev-parse HEAD | head -c 10)
all: bitlink
dependencies:
go get github.com/gorilla/mux
go get github.com/unixvoid/glogger
go get gopkg.in/gcfg.v1
go get gopkg.in/redis.v5
go get golang.org/x/crypto/sha3
daemon:
bin/bitlink &
bitlink:
$(GOC) bitlink.go
run:
go run \
bitlink/bitlink.go \
bitlink/link_compressor.go \
bitlink/token_generator.go
prep_aci: stat
mkdir -p stage.tmp/bitlink-layout/rootfs/
cp bin/bitlink* stage.tmp/bitlink-layout/rootfs/bitlink
cp config.gcfg stage.tmp/bitlink-layout/rootfs/
cp deps/manifest.json stage.tmp/bitlink-layout/manifest
build_aci: prep_aci
# build image
cd stage.tmp/ && \
actool build bitlink-layout bitlink-api.aci && \
mv bitlink-api.aci ../
@echo "bitlink-api.aci built"
build_travis_aci: prep_aci
wget https://github.com/appc/spec/releases/download/v0.8.7/appc-v0.8.7.tar.gz
tar -zxf appc-v0.8.7.tar.gz
# build image
cd stage.tmp/ && \
../appc-v0.8.7/actool build bitlink-layout bitlink-api.aci && \
mv bitlink-api.aci ../
rm -rf appc-v0.8.7*
@echo "bitlink-api.aci built"
stat:
mkdir -p bin/
$(CGOR) $(GOC) $(GOFLAGS) -o bin/bitlink-$(GIT_HASH)-linux-amd64 bitlink/*.go
install: stat
cp bitlink /usr/bin
clean:
rm -rf bin/
rm -rf stage.tmp/
rm -f bitlink-api.aci