summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 17 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 708457b..24870f8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,13 @@
-CC = cc
-CCOPTS = -Wall -std=gnu99
-out = upwgen
-PREFIX = /usr/bin
+CC = cc
+CCOPTS = -Wall -std=gnu99
+out = upwgen
+PREFIX = /usr/bin
+MANPREFIX = /usr/share/man
-VERSION = 1
-PATCHLEVEL = 1
+VERSION = 1
+PATCHLEVEL = 1
EXTRAVERSION = -rc1
+RELDATE = 2019 March 09
VERSTR = "$(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL))$(EXTRAVERSION)"
@@ -13,7 +15,14 @@ all:
@if [ ! -d obj ]; then mkdir obj; fi
$(CC) $(CCOPTS) -c src/i18n_cat.c -o obj/i18n_cat.o
$(CC) $(CCOPTS) -DVERSTR=$(VERSTR) src/main.c obj/*.o -o $(out)
+ # Interpolate the man page and compress
+ sed \
+ -e "s/{{ VERSTR }}/$(VERSTR)/" \
+ -e "s/{{ RELDATE }}/$(RELDATE)/" \
+ doc/upwgen.1 | gzip -c > upwgen.1.gz
install:
- mkdir -p $(DESTDIR)/$(PREFIX)
- cp $(out) $(DESTDIR)/$(PREFIX)/$(out)
+ # Install the binary
+ install -D -m 755 $(out) "$(DESTDIR)/$(PREFIX)/$(out)"
+ # Install the man page
+ install -D -m 644 upwgen.1.gz "$(DESTDIR)/$(MANPREFIX)/man1/upwgen.1.gz"

Generated by cgit