]> mj.ucw.cz Git - paperjam.git/blob - Makefile
Implemented common
[paperjam.git] / Makefile
1 VERSION=0.1
2 YEAR=2018
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)
5
6 CXXFLAGS=-O2 -Wall -Wextra -Wno-parentheses -std=gnu++11 -g
7
8 all: paperjam
9
10 MODULES=paperjam pdf-tools parse cmds pdf
11 OBJS=$(addsuffix .o, $(MODULES))
12
13 paperjam: $(OBJS)
14         $(LD) -o $@ $^ $(LDLIBS)
15 paperjam: LDLIBS += -lqpdf -lpaper
16 paperjam: LD=$(CXX)
17
18 $(OBJS): jam.h pdf-tools.h
19
20 paperjam.o: CXXFLAGS += -DVERSION='"$(VERSION)"' -DYEAR='"$(YEAR)"' -DBUILD_DATE='"$(BUILD_DATE)"' -DBUILD_COMMIT='"$(BUILD_COMMIT)"'
21
22 clean:
23         rm -f *.o
24         rm -f paperjam
25
26 release:
27         git tag v$(VERSION)
28         git push --tags
29         git archive --format=tar --prefix=paperjam-$(VERSION)/ HEAD | gzip >paperjam-$(VERSION).tar.gz
30         rsync paperjam-$(VERSION).tar.gz atrey:ftp/linux/
31         ssh jw 'cd web && bin/release-prog paperjam $(VERSION)'
32
33 .PHONY: all clean release