-
Notifications
You must be signed in to change notification settings - Fork 8
/
tools.mak
43 lines (30 loc) · 1.05 KB
/
tools.mak
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
# Create an auto-incrementing build number.
BUILD_NUMBER_LDFLAGS = -Xlinker --defsym -Xlinker __BUILD_DATE=$$(date +'%Y%m%d')
BUILD_NUMBER_LDFLAGS += -Xlinker --defsym -Xlinker __BUILD_NUMBER=$$(cat $(BUILD_NUMBER_FILE))
# Build number file. Increment if any object file changes.
$(BUILD_NUMBER_FILE): $(OBJECTS)
@if ! test -f $(BUILD_NUMBER_FILE); then echo 999 > $(BUILD_NUMBER_FILE); fi
@echo $$(($$(cat $(BUILD_NUMBER_FILE)) + 1)) > $(BUILD_NUMBER_FILE)
# Common build commands
.PHONY: build squash manifest push quick debug tag
build:
for p in $(platforms); do \
$(MAKE) $$p/build; \
done
squash:
for p in $(platforms); do \
$(MAKE) $$p/squash; \
done
manifest: push
for p in $(platforms); do \
$(MAKE) $$p/manifest; \
done
push: squash tag
for p in $(platforms); do \
$(MAKE) $$p/push; \
done
git push origin $(version).$$(cat $(BUILD_NUMBER_FILE))
tag:
git tag -a $(version).$$(cat $(BUILD_NUMBER_FILE)) -m "release $(version) build $$(cat $(BUILD_NUMBER_FILE))"
quick: linux/amd64/build linux/amd64/run
debug: linux/amd64/debug