diff options
author | Andrew Cady <d@cryptonomic.net> | 2021-10-07 16:20:21 -0400 |
---|---|---|
committer | Andrew Cady <d@cryptonomic.net> | 2021-10-07 16:20:21 -0400 |
commit | ba7ed80ea14479f154eb2818c99879be13c9f076 (patch) | |
tree | 0ecad2af890b5aca7752f07c1875f9b9b844c343 | |
parent | d965141cc88f05127e70e79f7613170224edab5e (diff) |
fixup! fix gitversion.h to rebuild only when changed
-rw-r--r-- | Makefile | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,5 +1,9 @@ | |||
1 | SOURCES = client.c gitversion.c log.c mach.c main.c util.c | 1 | SOURCES = client.c gitversion.c log.c mach.c main.c util.c |
2 | OBJECTS = $(SOURCES:.c=.o) | 2 | OBJECTS = $(SOURCES:.c=.o) |
3 | EXECUTABLES = tuntox tuntox_nostatic | ||
4 | DEB_VERSION = 0.0.9-1 | ||
5 | DEB_ARCH = amd64 | ||
6 | DEBS = ../tuntox_$(DEB_VERSION)_$(DEB_ARCH).deb ../tuntox-dbgsym_$(DEB_VERSION)_$(DEB_ARCH).deb | ||
3 | INCLUDES = client.h gitversion.h log.h mach.h main.h tox_bootstrap.h utarray.h uthash.h util.h utlist.h utstring.h | 7 | INCLUDES = client.h gitversion.h log.h mach.h main.h tox_bootstrap.h utarray.h uthash.h util.h utlist.h utstring.h |
4 | DEPS = toxcore | 8 | DEPS = toxcore |
5 | CC = gcc | 9 | CC = gcc |
@@ -18,10 +22,11 @@ bindir ?= $(prefix)/bin | |||
18 | etcdir ?= /etc | 22 | etcdir ?= /etc |
19 | 23 | ||
20 | # Targets | 24 | # Targets |
21 | all: tuntox tuntox_nostatic | 25 | .PHONY: all clean |
26 | all: $(EXECUTABLES) | ||
22 | 27 | ||
23 | gitversion != printf %s $$(git rev-parse HEAD) && (git diff --quiet || printf %s -dirty) | 28 | gitversion != printf %s $$(git rev-parse HEAD) && (git diff --quiet || printf %s -dirty) |
24 | gitversion_on_disk != read _ _ v < gitversion.h; echo $$v | 29 | gitversion_on_disk != 2>/dev/null read _ _ v < gitversion.h && echo $$v || true |
25 | ifneq ("$(gitversion)", $(gitversion_on_disk)) | 30 | ifneq ("$(gitversion)", $(gitversion_on_disk)) |
26 | .PHONY: gitversion.h | 31 | .PHONY: gitversion.h |
27 | endif | 32 | endif |
@@ -29,8 +34,6 @@ endif | |||
29 | gitversion.h: | 34 | gitversion.h: |
30 | echo '#define GITVERSION "$(gitversion)"' > $@ | 35 | echo '#define GITVERSION "$(gitversion)"' > $@ |
31 | 36 | ||
32 | FORCE: | ||
33 | |||
34 | tox_bootstrap.h: | 37 | tox_bootstrap.h: |
35 | $(PYTHON) generate_tox_bootstrap.py | 38 | $(PYTHON) generate_tox_bootstrap.py |
36 | 39 | ||
@@ -49,7 +52,7 @@ cscope.out: | |||
49 | @cscope -bv ./*.[ch] &> /dev/null | 52 | @cscope -bv ./*.[ch] &> /dev/null |
50 | 53 | ||
51 | clean: | 54 | clean: |
52 | rm -f *.o tuntox cscope.out gitversion.h tox_bootstrap.h | 55 | rm -f $(OBJECTS) $(EXECUTABLES) cscope.out gitversion.h tox_bootstrap.h |
53 | 56 | ||
54 | install: tuntox_nostatic | 57 | install: tuntox_nostatic |
55 | install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir) | 58 | install -d -m755 $(DESTDIR)$(bindir) $(DESTDIR)$(etcdir) |
@@ -63,11 +66,8 @@ ifeq ($(SKIP_SYSTEMCTL),) | |||
63 | systemctl status tuntox | 66 | systemctl status tuntox |
64 | endif | 67 | endif |
65 | 68 | ||
66 | debs = ../tuntox_0.0.9-1_amd64.deb ../tuntox-dbgsym_0.0.9-1_amd64.deb | ||
67 | .PHONY: install-debs debs | 69 | .PHONY: install-debs debs |
68 | install-debs: $(debs) | 70 | install-debs: $(DEBS) |
69 | $(shell [ "$$(id -u)" = 0 ] || echo sudo) dpkg -i $(debs) | 71 | $(shell [ "$$(id -u)" = 0 ] || echo sudo) dpkg -i $(DEBS) |
70 | $(debs) debs: | 72 | $(DEBS) debs: |
71 | fakeroot -- sh -c 'SKIP_SYSTEMCTL=y ./debian/rules binary' | 73 | fakeroot -- sh -c 'SKIP_SYSTEMCTL=y ./debian/rules binary' |
72 | |||
73 | .PHONY: all clean tuntox | ||