std/c/src/: Fix hardcoded year in std.1.man + fix alignment in main()
[sunny256-utils.git] / Lib / std / c / Makefile
blobe107e46160885bf4ce817b456d5659e1470f4bb9
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
54 cd src && $(MAKE) $@
56 .PHONY: install
57 install:
58 cd src && $(MAKE) $@
60 .PHONY: pdf
61 pdf:
62 $(MAKE) README.pdf
63 cd src && $(MAKE) $@
65 .PHONY: test
66 test:
67 cd src && $(MAKE) $@
69 .PHONY: testall
70 testall:
71 cd src && $(MAKE) $@
73 .PHONY: tlok
74 tlok:
75 @cd src && $(MAKE) -s $@
77 .PHONY: uninstall
78 uninstall:
79 cd src && $(MAKE) $@
81 .PHONY: valgrind
82 valgrind:
83 cd src && $(MAKE) $@
85 .PHONY: valgrindall
86 valgrindall:
87 cd src && $(MAKE) $@