-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
82 lines (70 loc) · 2.14 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
VERSION="Tetra-0.5-`git rev-parse --short HEAD`-`uname`-`uname -m`"
.PHONY: build clean run package docker-build docker-run test pull debug
pull:
git pull
godep go get -v .
build:
godep go clean ./...
godep go build
debug:
godep go clean ./...
godep go build -tags debug
clean:
rm Tetra
run:
@make build
./Tetra
all:
@make run
package:
@echo "Building ${VERSION}..."
@make build
@echo "Setting up build prefix"
@mkdir build
@echo "Packing ${VERSION}..."
@upx Tetra --ultra-brute --preserve-build-id
@cp Tetra build
@echo "Making debug binary"
@make debug
@upx Tetra --ultra-brute --preserve-build-id
@cp Tetra build/Tetra-debug
@echo "Packing modules..."
@cp -rf modules build
@rm build/modules/doc.go
@mkdir -p build/doc/go/bot/script
@mkdir -p build/lib
@cp -rf lib build
@cp Dockerfile build
@echo "Bundling documentation..."
@godoc . > build/doc/go/main
@godoc ./modules > build/doc/go/modules
@godoc ./atheme > build/doc/go/atheme
@godoc ./1459 > build/doc/go/1459
@godoc ./bot > build/doc/go/tetra
@godoc ./bot/modes > build/doc/go/bot/modes
@godoc ./bot/web > build/doc/go/bot/web
@godoc ./bot/script/crypto > build/doc/go/bot/script/crypto
@godoc ./bot/script/charybdis > build/doc/go/bot/script/charybdis
@godoc ./bot/script/strings > build/doc/go/bot/script/strings
@cp -rf doc/* build/doc/
@mkdir build/etc
@cp etc/config.yaml.example build/etc
@cp -rf etc/sendfile build/etc
@cp README.md build
@cp LICENSE build
@echo "including help files"
@cp -rf ./help build/
@mkdir build/var
@mv build ${VERSION}
@tar czvf ${VERSION}.tgz ${VERSION}
@rm -rf ${VERSION}
@echo "Package at ${VERSION}.tgz"
docker-build:
docker build -t xena/tetra .
docker-run:
make -C ./test/testnet/ircd kill || true
make -C ./test/testnet/ircd run
docker run -dit --name tetra-etcd xena/etcd-minimal /etcd || true
docker run --rm --link tetra-ircd:ircd --link tetra-etcd:etcd -it --name tetra xena/tetra .
test:
make -C test test-build test-docker