summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2021-10-07 16:20:21 -0400
committerAndrew Cady <d@cryptonomic.net>2021-10-07 16:20:21 -0400
commitba7ed80ea14479f154eb2818c99879be13c9f076 (patch)
tree0ecad2af890b5aca7752f07c1875f9b9b844c343
parentd965141cc88f05127e70e79f7613170224edab5e (diff)
fixup! fix gitversion.h to rebuild only when changed
-rw-r--r--Makefile22
1 files changed, 11 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 9fba668..eda232a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,9 @@
1SOURCES = client.c gitversion.c log.c mach.c main.c util.c 1SOURCES = client.c gitversion.c log.c mach.c main.c util.c
2OBJECTS = $(SOURCES:.c=.o) 2OBJECTS = $(SOURCES:.c=.o)
3EXECUTABLES = tuntox tuntox_nostatic
4DEB_VERSION = 0.0.9-1
5DEB_ARCH = amd64
6DEBS = ../tuntox_$(DEB_VERSION)_$(DEB_ARCH).deb ../tuntox-dbgsym_$(DEB_VERSION)_$(DEB_ARCH).deb
3INCLUDES = client.h gitversion.h log.h mach.h main.h tox_bootstrap.h utarray.h uthash.h util.h utlist.h utstring.h 7INCLUDES = client.h gitversion.h log.h mach.h main.h tox_bootstrap.h utarray.h uthash.h util.h utlist.h utstring.h
4DEPS = toxcore 8DEPS = toxcore
5CC = gcc 9CC = gcc
@@ -18,10 +22,11 @@ bindir ?= $(prefix)/bin
18etcdir ?= /etc 22etcdir ?= /etc
19 23
20# Targets 24# Targets
21all: tuntox tuntox_nostatic 25.PHONY: all clean
26all: $(EXECUTABLES)
22 27
23gitversion != printf %s $$(git rev-parse HEAD) && (git diff --quiet || printf %s -dirty) 28gitversion != printf %s $$(git rev-parse HEAD) && (git diff --quiet || printf %s -dirty)
24gitversion_on_disk != read _ _ v < gitversion.h; echo $$v 29gitversion_on_disk != 2>/dev/null read _ _ v < gitversion.h && echo $$v || true
25ifneq ("$(gitversion)", $(gitversion_on_disk)) 30ifneq ("$(gitversion)", $(gitversion_on_disk))
26.PHONY: gitversion.h 31.PHONY: gitversion.h
27endif 32endif
@@ -29,8 +34,6 @@ endif
29gitversion.h: 34gitversion.h:
30 echo '#define GITVERSION "$(gitversion)"' > $@ 35 echo '#define GITVERSION "$(gitversion)"' > $@
31 36
32FORCE:
33
34tox_bootstrap.h: 37tox_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
51clean: 54clean:
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
54install: tuntox_nostatic 57install: 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
64endif 67endif
65 68
66debs = ../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
68install-debs: $(debs) 70install-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