commit 12c16735ffa28a0c873ae55df969995f475049a5
parent 10f6add1458ce69ad6d87ae2c21e06a97b53fde6
Author: hhvn <dev@hhvn.uk>
Date: Mon, 17 Jan 2022 18:31:01 +0000
Makefile: replace COMMIT in manpage
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -21,7 +21,9 @@ BIN = zygo
MAN = zygo.1
SRC += zygo.c
OBJ = $(SRC:.c=.o)
+COMMIT = $(shell git log HEAD...HEAD~1 --pretty=format:%h)
LDFLAGS = -lncurses
+CFLAGS = -DCOMMIT=\"$(COMMIT)\"
include config.mk
@@ -36,7 +38,7 @@ zygo.o: config.h
install:
cp -f $(BIN) $(BINDIR)/$(BIN)
- cp $(MAN) $(MANDIR)/man1/$(MAN)
+ sed "s/COMMIT/$(COMMIT)/" < $(MAN) > $(MANDIR)/man1/$(MAN)
uninstall:
-rm -rf $(BINDIR)/$(BIN) $(MANDIR)/man1/$(MAN)