1 COMMANDS=$(wildcard ../cmd*.c)
2 OBJS=$(COMMANDS:../%.c=%.o) docgen.o
4 CFLAGS=-Wall -std=c99 -I../.. -I../../cmdproc/include -I../../rpp-lib/rpp/include -DDOCGEN -DNULL=0 -D'CMD_HANDLER(x)=0'
14 $(CC) $(CFLAGS) -c -o $@ $<
19 markdown = $(shell if pandoc -h|grep -q markdown_strict; then echo markdown_strict; else echo markdown; fi)
22 (echo '<div class="toclimit-2" style="float: right; margin-left: 1em;">__TOC__</div>'; ./docgen wiki) | pandoc -f $(markdown) -t mediawiki > $@
24 doc.mdwn: docgen Makefile
25 # ./docgen wiki | pandoc -f markdown_strict -t markdown_strict > $@
28 doc.html: docgen Makefile
29 ./docgen wiki | pandoc -f $(markdown) -t html --base-header-level=2 > $@
32 doc.tex: docgen Makefile
33 ./docgen pdfdoc > $@.1
34 pandoc -f $(markdown) -t latex --base-header-level=1 $@.1 -o $@.2
35 sed -e 's/\\subsection/\\newpage\\subsection/' $@.2 > $@
38 upload: upload-mw upload-web
41 cat $< | ./wiki-edit.pl TestCommands -
44 WEBDST=$(WEB)test-sw-commands/rpp-test-sw.mdwn
46 ifneq ($(wildcard $(WEBDST)),)
49 git -C $(WEB) add $(WEBDST:$(WEB)%=%)
50 if ! git -C $(WEB) diff --cached --quiet; then git -C $(WEB) commit -m 'Automatic update of command reference' $(WEBDST:$(WEB)%=%) && git -C $(WEB) push; fi