1 include ../../../rpp-lib/Makefile.config
2 include ../../../rpp-lib/common.mk # for UPPERCASE
3 include ../../Makefile.var
5 COMMANDS=$(notdir $(filter commands/cmd%,$(SOURCES)))
6 OBJS=$(COMMANDS:%.c=%.o) docgen.o
8 CFLAGS = -Wall -std=c99 -I../.. -I../../cmdproc/include -I../../rpp-lib/rpp/include -DDOCGEN -DNULL=0 -D'CMD_HANDLER(x)=0'
9 CFLAGS += -DTARGET_$(call UPPERCASE,$(TARGET))
20 $(CC) $(CFLAGS) -c -o $@ $<
25 markdown = $(shell if pandoc -h|grep -q markdown_strict; then echo markdown_strict; else echo markdown; fi)
28 (echo '<div class="toclimit-2" style="float: right; margin-left: 1em;">__TOC__</div>'; ./docgen wiki) | pandoc -f $(markdown) -t mediawiki > $@
30 doc.mdwn: docgen Makefile
31 # ./docgen wiki | pandoc -f markdown_strict -t markdown_strict > $@
34 doc.html: docgen Makefile
35 ./docgen wiki | pandoc -f $(markdown) -t html --base-header-level=2 > $@
38 doc.tex: docgen Makefile
39 ./docgen pdfdoc > $@.1
40 pandoc -f $(markdown) -t latex --base-header-level=1 $@.1 -o $@.2
41 sed -e 's/\\subsection/\\newpage\\subsection/' $@.2 > $@
44 upload: upload-mw upload-web
47 cat $< | ./wiki-edit.pl TestCommands -
50 WEBDST=$(WEB)test-sw-commands/rpp-test-sw.mdwn
52 ifneq ($(wildcard $(WEBDST)),)
55 git -C $(WEB) add $(WEBDST:$(WEB)%=%)
56 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