c/src/Makefile: Create and use `INSTALL_TARGETS`
[sunny256-utils.git] / Lib / std / c / Makefile
blobeb04a838f268f06d81da82a52b0fee8f3009ea6a
1 # File ID: STDuuidDTS
2 # Author: Øyvind A. Holm <sunny@sunbase.org>
4 IGNFILES =
5 IGNFILES += -e ^COPYING
7 .PHONY: all
8 all:
9 cd src && $(MAKE) $@
11 %.html: FORCE
12 test -e "$*.md"
13 echo '<html>' >$@.tmp
14 echo '<head>' >>$@.tmp
15 echo '<meta charset="UTF-8" />' >>$@.tmp
16 echo '<title>$* - STDexecDTS</title>' >>$@.tmp
17 echo '</head>' >>$@.tmp
18 echo '<body>' >>$@.tmp
19 cmark $*.md >>$@.tmp
20 if test -n "$$(git log -1 --format=%h $*.md 2>/dev/null)"; then \
21 (echo 'Generated from `$*.md`'; \
22 git log -1 --format='revision `%h` (%ci)' \
23 $*.md) | cmark >>$@.tmp; \
25 echo '</body>' >>$@.tmp
26 echo '</html>' >>$@.tmp
27 mv $@.tmp $@
29 %.pdf: FORCE
30 $(MAKE) $*.html
31 wkhtmltopdf $*.html $@.tmp
32 mv $@.tmp $@
34 tags: src/*.[ch]
35 ctags src/*.[ch]
37 .PHONY: clean
38 clean:
39 rm -f README.html README.html.tmp
40 rm -f README.pdf README.pdf.tmp
41 cd src && $(MAKE) $@
43 .PHONY: edit
44 edit: tags
45 $(EDITOR) $$(git ls-files | grep -v $(IGNFILES))
46 rm tags
48 .PHONY: FORCE
49 FORCE:
51 .PHONY: html
52 html:
53 $(MAKE) README.html
55 .PHONY: install
56 install:
57 cd src && $(MAKE) $@
59 .PHONY: pdf
60 pdf:
61 $(MAKE) README.pdf
63 .PHONY: test
64 test:
65 cd src && $(MAKE) $@
67 .PHONY: testall
68 testall:
69 cd src && $(MAKE) $@
71 .PHONY: tlok
72 tlok:
73 @cd src && $(MAKE) -s $@
75 .PHONY: uninstall
76 uninstall:
77 cd src && $(MAKE) $@
79 .PHONY: valgrind
80 valgrind:
81 cd src && $(MAKE) $@
83 .PHONY: valgrindall
84 valgrindall:
85 cd src && $(MAKE) $@