summaryrefslogtreecommitdiff
path: root/Makefile
blob: bc89700a23982e351204034011a3869885370340 (plain)
    1 CC           = cc
    2 CCOPTS       = -Wall -std=gnu99 $(DBG)
    3 PREFIX       = /usr/bin
    4 MANPREFIX    = /usr/share/man
    5 
    6 VERSION      = 1
    7 PATCHLEVEL   = 2
    8 EXTRAVERSION =
    9 RELDATE      = 2019 August 30
   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) -c src/i18n_set.c -o obj/i18n_set.o
   17 	$(CC) $(CCOPTS) -DVERSTR=$(VERSTR) src/main.c obj/*.o -o upwgen
   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 debug:
   25 	make DBG=-g
   26 
   27 install:
   28 	# Install the binary
   29 	install -D -m 755 upwgen "$(DESTDIR)/$(PREFIX)/upwgen"
   30 	# Install the man page
   31 	install -D -m 644 upwgen.1.gz "$(DESTDIR)/$(MANPREFIX)/man1/upwgen.1.gz"
   32 
   33 clean:
   34 	@if [ -d obj ]; then rm -rf obj; fi
   35 	@if [ -f upwgen ]; then rm -f upwgen; fi
   36 	@if [ -f upwgen.1.gz ]; then rm -f upwgen.1.gz; fi

Generated by cgit