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'
15 $(CC) $(CFLAGS) -c -o $@ $<
21 markdown = $(shell if pandoc -h|grep -q markdown_strict; then echo markdown_strict; else echo markdown; fi)
24 (echo '<div class="toclimit-2" style="float: right; margin-left: 1em;">__TOC__</div>'; ./docgen wiki) | pandoc -f $(markdown) -t mediawiki > $@
26 doc.mdwn: docgen Makefile
27 # ./docgen wiki | pandoc -f markdown_strict -t markdown_strict > $@
30 doc.html: docgen Makefile
31 ./docgen wiki | pandoc -f $(markdown) -t html --base-header-level=2 > $@
34 doc.tex: docgen Makefile
35 ./docgen pdfdoc > $@.1
36 pandoc -f $(markdown) -t latex --base-header-level=1 $@.1 -o $@.2
37 sed -e 's/\\subsection/\\newpage\\subsection/' $@.2 > $@
40 upload: upload-mw upload-web
43 cat $< | ./wiki-edit.pl TestCommands -
46 WEBDST=$(WEB)test-sw-commands/rpp-test-sw.mdwn
48 ifneq ($(wildcard $(WEBDST)),)
51 git -C $(WEB) add $(WEBDST:$(WEB)%=%)
52 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