3 BUILD_DATE:=$(shell date '+%Y-%m-%d')
4 BUILD_COMMIT:=$(shell if git rev-parse >/dev/null 2>/dev/null ; then git describe --always --tags ; else echo '<unknown>' ; fi)
8 MANDIR=$(PREFIX)/share/man
10 CXXFLAGS=-O2 -Wall -Wextra -Wno-parentheses -std=gnu++11 -g
12 all: paperjam paperjam.1 paperjam.1.html
14 MODULES=paperjam pdf-tools parse cmds pdf
15 OBJS=$(addsuffix .o, $(MODULES))
18 $(LD) -o $@ $^ $(LDLIBS)
19 paperjam: LDLIBS += -lqpdf -lpaper
22 $(OBJS): jam.h pdf-tools.h
24 paperjam.o: CXXFLAGS += -DVERSION='"$(VERSION)"' -DYEAR='"$(YEAR)"' -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_COMMIT='"$(BUILD_COMMIT)"'
26 paperjam.1: paperjam.1.txt
29 # The dependency on paperjam.1 is there to serialize both calls of asciidoc,
30 # which does not name temporary files safely.
31 paperjam.1.html: paperjam.1.txt paperjam.1
37 rm -f paperjam.1 paperjam.1.html docbook-xsl.css
41 install -d $(BINDIR) $(MANDIR)/man1
42 install -s paperjam $(BINDIR)/
43 install -m 644 paperjam.1 $(MANDIR)/man1/
48 git archive --format=tar --prefix=paperjam-$(VERSION)/ HEAD | gzip >paperjam-$(VERSION).tar.gz
49 rsync paperjam-$(VERSION).tar.gz atrey:ftp/linux/
50 rsync paperjam.1.html jw:web/static/sw/paperjam/
51 ssh jw 'cd web && bin/release-prog paperjam $(VERSION)'
53 .PHONY: all clean release