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