Remove trailing space; make cursed global static
[tig] / Makefile
... / ...
CommitLineData
1PREFIX = $(HOME)
2LDLIBS = -lcurses
3CFLAGS = -Wall
4DFLAGS = -g -DDEBUG -Werror
5PROGS = tig
6DOCS = tig.1.txt tig.1.html tig.1 README.html
7
8ifneq (,$(wildcard .git))
9CFLAGS += '-DVERSION="$(shell git-describe)"'
10endif
11
12all: $(PROGS)
13all-debug: $(PROGS)
14all-debug: CFLAGS += $(DFLAGS)
15docs: $(DOCS)
16
17install: all
18 for prog in $(PROGS); do \
19 install $$prog $(PREFIX)/bin; \
20 done
21
22install-docs: docs
23 for doc in $(DOCS); do \
24 case "$$doc" in \
25 *.1) install $$doc $(PREFIX)/man/man1 ;; \
26 esac \
27 done
28
29clean:
30 rm -f $(PROGS) $(DOCS) core
31
32spell-check:
33 aspell --lang=en --check tig.1.txt
34
35.PHONY: all docs install clean
36
37tig: tig.c
38
39tig.1.txt: tig.c
40 sed -n '/\/\*\*/,/\*\*\//p' < $< | \
41 sed 's/.*\*\*\///' | \
42 sed '/^[^*]*\*\*/d' | \
43 sed 's/\*\///;s/^[^*]*\* *//' > $@
44
45README.html: README
46 asciidoc -b xhtml11 -d article -f web.conf $<
47
48%.1.html : %.1.txt
49 asciidoc -b xhtml11 -d manpage $<
50
51%.1.xml : %.1.txt
52 asciidoc -b docbook -d manpage $<
53
54%.1 : %.1.xml
55 xmlto man $<