Check the value returned by fopen() during display initialization
[tig] / Makefile
... / ...
CommitLineData
1prefix = $(HOME)
2bindir= $(prefix)/bin
3mandir = $(prefix)/man
4docdir = $(prefix)/share/doc
5# DESTDIR=
6
7LDLIBS = -lcurses
8CFLAGS = -Wall -O2
9DFLAGS = -g -DDEBUG -Werror
10PROGS = tig
11DOCS = tig.1.html tig.1 tigrc.5.html tigrc.5 \
12 manual.toc manual.html manual.html-chunked manual.pdf \
13 README.html
14
15ifneq (,$(wildcard .git))
16VERSION = $(shell git-describe)
17WTDIRTY = $(shell git-diff-index --name-only HEAD 2>/dev/null)
18CFLAGS += '-DVERSION="$(VERSION)$(if $(WTDIRTY),-dirty)"'
19endif
20
21all: $(PROGS)
22all-debug: $(PROGS)
23all-debug: CFLAGS += $(DFLAGS)
24doc: $(DOCS)
25
26install: all
27 for prog in $(PROGS); do \
28 install $$prog $(DESTDIR)$(bindir); \
29 done
30
31install-doc: doc
32 mkdir -p $(DESTDIR)$(mandir)/man1 \
33 $(DESTDIR)$(mandir)/man5 \
34 $(DESTDIR)$(docdir)/tig
35 for doc in $(DOCS); do \
36 case "$$doc" in \
37 *.1) install $$doc $(DESTDIR)$(mandir)/man1 ;; \
38 *.5) install $$doc $(DESTDIR)$(mandir)/man5 ;; \
39 *.html) install $$doc $(DESTDIR)$(docdir)/tig ;; \
40 esac \
41 done
42
43clean:
44 rm -rf manual.html-chunked
45 rm -f $(PROGS) $(DOCS) core *.xml
46
47spell-check:
48 aspell --lang=en --check tig.1.txt tigrc.5.txt manual.txt
49
50strip: all
51 strip $(PROGS)
52
53.PHONY: all all-debug doc install install-doc clean spell-check
54
55manual.toc: manual.txt
56 sed -n '/^\[\[/,/\(---\|~~~\)/p' < $< | while read line; do \
57 case "$$line" in \
58 "-----"*) echo ". <<$$ref>>"; ref= ;; \
59 "~~~~~"*) echo "- <<$$ref>>"; ref= ;; \
60 "[["*"]]") ref="$$line" ;; \
61 *) ref="$$ref, $$line" ;; \
62 esac; done | sed 's/\[\[\(.*\)\]\]/\1/' > $@
63
64tig: tig.c
65
66README.html: README
67 asciidoc -b xhtml11 -d article -a readme $<
68
69%.pdf : %.xml
70 docbook2pdf $<
71
72%.1.html : %.1.txt
73 asciidoc -b xhtml11 -d manpage $<
74
75%.1.xml : %.1.txt
76 asciidoc -b docbook -d manpage $<
77
78%.1 : %.1.xml
79 xmlto man $<
80
81%.5.html : %.5.txt
82 asciidoc -b xhtml11 -d manpage $<
83
84%.5.xml : %.5.txt
85 asciidoc -b docbook -d manpage $<
86
87%.5 : %.5.xml
88 xmlto man $<
89
90%.html : %.txt
91 asciidoc -b xhtml11 -d article -n $<
92
93%.xml : %.txt
94 asciidoc -b docbook -d article $<
95
96%.html-chunked : %.xml
97 xmlto html -o $@ $<
98
99# Maintainer stuff
100sync-docs:
101 cg switch release
102 -cg merge -n master
103 cg commit -m "Merge with master"
104 make doc
105 cg commit -m "Sync docs"
106 cg switch master