diff options
-rw-r--r-- | Makefile | 26 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rw-r--r-- | hcalc.h | 6 | ||||
-rw-r--r-- | hcalc.rst | 2 | ||||
-rw-r--r-- | version.h | 1 | ||||
-rw-r--r-- | version.rst | 1 |
6 files changed, 26 insertions, 11 deletions
@@ -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: @@ -0,0 +1 @@ +1.2u1 @@ -6,15 +6,15 @@ More revisions copyright 2023, B. Watson <urchlay@slackware.uk> */ -#define SELF "HCalc" -#define VERSION "1.2u1" - #include <stdio.h> #include <X11/Xlib.h> #include <X11/Xutil.h> #include <X11/keysym.h> #include <X11/Xatom.h> +#define SELF "HCalc" +#include "version.h" + extern Display *display; extern int screen; extern Visual *visual; @@ -1,7 +1,7 @@ .. RST source for hcalc(1) man page. Convert with: .. rst2man.py hcalc.rst > hcalc.1 -.. |version| replace:: 1.2u1 +.. include:: version.rst .. |date| date:: ===== diff --git a/version.h b/version.h new file mode 100644 index 0000000..1ab0b17 --- /dev/null +++ b/version.h @@ -0,0 +1 @@ +#define VERSION "1.2u1" diff --git a/version.rst b/version.rst new file mode 100644 index 0000000..1fba6c0 --- /dev/null +++ b/version.rst @@ -0,0 +1 @@ +.. |version| replace:: 1.2u1 |