-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
67 lines (51 loc) · 2.73 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
VERSION_FILE="assets/version.no"
BUILD_NUMBER:=$(shell cat ${VERSION_FILE})
INCREMENT_NUMBER=1
NEW_BUILD_NUMBER=$(shell echo $$(( $(BUILD_NUMBER) + $(INCREMENT_NUMBER) )) )
PACKAGES=`go list ./... | grep -v /vendor/`
default: all
clean:
for p in $(PACKAGES); do \
go clean $$p; \
done
# cleanup temporary files created after test
find . -name "*.log" -type f -delete
find . -name "*.rep" -type f -delete
find . -name "*.tar" -type f -delete
find . -name "*.txt" -type f -delete
find . -name "*.run" -type f -delete
deps:
glide install
format:
find . -type f -name "*.go" -exec gofmt -w {} \;
install:
for p in $(PACKAGES); do \
go install $$p; \
done
release:
for p in $(PACKAGES); do \
go install $$p; \
done
mv ../../../../bin/main ./bin/anon-eth-net
test:
for p in $(PACKAGES); do \
go test -v $$p; \
done
vet:
for p in $(PACKAGES); do \
go vet $$p; \
done
linux-zip:
zip -r "./bin/anon-eth-net-v0.2.0-ubuntu-x64.zip" assets/ bin/ -x ./assets/internal_ip_address_darwin.json ./assets/internal_ip_address_windows.json ./assets/config.json ./assets/emaillogin.conf ./assets/loader_test*.json ./assets/logger_test.sample ./assets/rest_test_loader_binary* ./assets/version.no ./assets/main_loader_windows.json ./assets/main_loader_darwin.json ./assets/profiler_loader_windows.json ./assets/profiler_loader_darwin.json ./assets/reboot_loader_windows.json ./assets/reboot_loader_darwin.json
darwin-zip:
zip -r "./bin/anon-eth-net-v0.2.0-macos-x64.zip" assets/ bin/ -x ./assets/internal_ip_address_linux.json ./assets/internal_ip_address_windows.json ./assets/config.json ./assets/emaillogin.conf ./assets/loader_test*.json ./assets/logger_test.sample ./assets/rest_test_loader_binary* ./assets/version.no ./assets/main_loader_linux.json ./assets/main_loader_windows.json ./assets/profiler_loader_linux.json ./assets/profiler_loader_windows.json ./assets/reboot_loader_linux.json ./assets/reboot_loader_windows.json
windows-zip:
zip -r "./bin/anon-eth-net-v0.2.0.windows-x64.zip" assets/ bin/ -x ./assets/internal_ip_address_linux.json ./assets/internal_ip_address_linux.json ./assets/config.json ./assets/emaillogin.conf ./assets/loader_test*.json ./assets/logger_test.sample ./assets/rest_test_loader_binary* ./assets/version.no ./assets/main_loader_darwin.json ./assets/main_loader_linux.json ./assets/profiler_loader_linux.json ./assets/profiler_loader_darwin.json ./assets/reboot_loader_linux.json ./assets/reboot_loader_darwin.json
version-update:
@echo "Current build number: $(BUILD_NUMBER)"
@echo "New build number: $(NEW_BUILD_NUMBER)"
@echo $(NEW_BUILD_NUMBER) > $(VERSION_FILE)
#Aggregate commands
all: clean version-update format vet install test;
prepare-commit: clean version-update format vet install test clean;
test-clean: test clean