1 include ../../../rpp-lib/Makefile.config
3 COMMANDS=$(wildcard ../cmd*.c)
4 COMMANDS+=$(wildcard ../_$(TARGET)/cmd*.c)
5 OBJS=$(COMMANDS:../%.c=%.o) docgen.o
7 CFLAGS=-Wall -std=c99 -I../.. -I../../cmdproc/include -I../../rpp-lib/rpp/include -DDOCGEN -DNULL=0 -D'CMD_HANDLER(x)=0'
18 $(CC) $(CFLAGS) -c -o $@ $<
20 _$(TARGET)/%.o: ../_$(TARGET)/%.c
22 $(CC) $(CFLAGS) -c -o $@ $<
28 markdown = $(shell if pandoc -h|grep -q markdown_strict; then echo markdown_strict; else echo markdown; fi)
31 (echo '<div class="toclimit-2" style="float: right; margin-left: 1em;">__TOC__</div>'; ./docgen wiki) | pandoc -f $(markdown) -t mediawiki > $@
33 doc.mdwn: docgen Makefile
34 # ./docgen wiki | pandoc -f markdown_strict -t markdown_strict > $@
37 doc.html: docgen Makefile
38 ./docgen wiki | pandoc -f $(markdown) -t html --base-header-level=2 > $@
41 doc.tex: docgen Makefile
42 ./docgen pdfdoc > $@.1
43 pandoc -f $(markdown) -t latex --base-header-level=1 $@.1 -o $@.2
44 sed -e 's/\\subsection/\\newpage\\subsection/' $@.2 > $@
47 upload: upload-mw upload-web
50 cat $< | ./wiki-edit.pl TestCommands -
53 WEBDST=$(WEB)test-sw-commands/rpp-test-sw.mdwn
55 ifneq ($(wildcard $(WEBDST)),)
58 git -C $(WEB) add $(WEBDST:$(WEB)%=%)
59 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