aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 19 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 5f57395..9c52c75 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ GZIP = gzip
# End of user-ovverideable stuff. No user-serviceable parts below this line.
PROJ = hcalc
+VERSION = 1.2u1
MANPAGE = $(PROJ).1
DOCS = README CHANGES TODO COPYING
OBJS = \
@@ -38,22 +39,33 @@ OBJS = \
all: $(PROJ) $(MANPAGE)
-hcalc.o: hcalc.c hcalc.h
+hcalc.o: hcalc.c hcalc.h version.h
-input.o: input.c hcalc.h
+input.o: input.c hcalc.h version.h
-setupx.o: setupx.c hcalc.h
+setupx.o: setupx.c hcalc.h version.h
-draw.o: draw.c hcalc.h
+draw.o: draw.c hcalc.h version.h
-config.o: config.c hcalc.h
+config.o: config.c hcalc.h version.h
-images.o: images.c hcalc.h xpm/*.xpm
+images.o: images.c hcalc.h xpm/*.xpm version.h
+
+VERSION:
+ifneq ($(shell cat VERSION 2>/dev/null),$(VERSION))
+ echo "$(VERSION)" > VERSION
+endif
+
+version.rst: VERSION
+ echo ".. |version| replace:: $(VERSION)" > version.rst
+
+version.h: VERSION
+ echo '#define VERSION "$(VERSION)"' > version.h
$(PROJ): $(OBJS)
$(CC) -o $@ $^ $(LDFLAGS) -lXpm -lX11 $(LIBS)
-$(MANPAGE): $(PROJ).rst
+$(MANPAGE): $(PROJ).rst version.rst
rst2man $(PROJ).rst > $(MANPAGE)
clean: