CC = cc CCOPTS = -Wall -std=gnu99 $(DBG) PREFIX = /usr/bin MANPREFIX = /usr/share/man VERSION = 1 PATCHLEVEL = 2 EXTRAVERSION = RELDATE = 2019 August 30 VERSTR = "$(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL))$(EXTRAVERSION)" all: @if [ ! -d obj ]; then mkdir obj; fi $(CC) $(CCOPTS) -c src/i18n_cat.c -o obj/i18n_cat.o $(CC) $(CCOPTS) -c src/i18n_set.c -o obj/i18n_set.o $(CC) $(CCOPTS) -DVERSTR=$(VERSTR) src/main.c obj/*.o -o upwgen # Interpolate the man page and compress sed \ -e "s/{{ VERSTR }}/$(VERSTR)/" \ -e "s/{{ RELDATE }}/$(RELDATE)/" \ doc/upwgen.1 | gzip -c > upwgen.1.gz debug: make DBG=-g install: # Install the binary install -D -m 755 upwgen "$(DESTDIR)/$(PREFIX)/upwgen" # Install the man page install -D -m 644 upwgen.1.gz "$(DESTDIR)/$(MANPREFIX)/man1/upwgen.1.gz" clean: @if [ -d obj ]; then rm -rf obj; fi @if [ -f upwgen ]; then rm -f upwgen; fi @if [ -f upwgen.1.gz ]; then rm -f upwgen.1.gz; fi