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
39 install -d $(BINDIR) $(MANDIR)/man1
40 install -s paperjam $(BINDIR)/
41 install -m 644 paperjam.1 $(MANDIR)/man1/
46 git archive --format=tar --prefix=paperjam-$(VERSION)/ HEAD | gzip >paperjam-$(VERSION).tar.gz
47 rsync paperjam-$(VERSION).tar.gz atrey:ftp/linux/
48 ssh jw 'cd web && bin/release-prog paperjam $(VERSION)'
50 .PHONY: all clean release