blob: e8eb59b670e419bcf1492a09b2c90f28d5dd8bf4 (
plain)
1 CC = cc
2 CCOPTS = -Wall -std=gnu99
3 PREFIX = /usr/bin
4 MANPREFIX = /usr/share/man
5
6 VERSION = 1
7 PATCHLEVEL = 1
8 EXTRAVERSION = -rc1
9 RELDATE = 2019 March 09
10
11 VERSTR = "$(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL))$(EXTRAVERSION)"
12
13 all:
14 @if [ ! -d obj ]; then mkdir obj; fi
15 $(CC) $(CCOPTS) -c src/i18n_cat.c -o obj/i18n_cat.o
16 $(CC) $(CCOPTS) -DVERSTR=$(VERSTR) src/main.c obj/*.o -o upwgen
17 # Interpolate the man page and compress
18 sed \
19 -e "s/{{ VERSTR }}/$(VERSTR)/" \
20 -e "s/{{ RELDATE }}/$(RELDATE)/" \
21 doc/upwgen.1 | gzip -c > upwgen.1.gz
22
23 install:
24 # Install the binary
25 install -D -m 755 upwgen "$(DESTDIR)/$(PREFIX)/upwgen"
26 # Install the man page
27 install -D -m 644 upwgen.1.gz "$(DESTDIR)/$(MANPREFIX)/man1/upwgen.1.gz"
|