Makefile: add README.pdf target
[model-checker.git] / Makefile
index 0ad9fa66274e16cb68c5d495e8fd034bd54db04a..37bdcd11ce415d4eb5eafdee8791b5458fa21837 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,15 +18,20 @@ endif
 
 TESTS_DIR := test
 
-all: $(LIB_SO) tests
+MARKDOWN := doc/Markdown/Markdown.pl
+
+all: $(LIB_SO) tests README.html
 
 debug: CPPFLAGS += -DCONFIG_DEBUG
 debug: all
 
 PHONY += docs
-docs: *.c *.cc *.h
+docs: *.c *.cc *.h README.html
        doxygen
 
+README.html: README.md
+       $(MARKDOWN) $< > $@
+
 $(LIB_SO): $(OBJECTS)
        $(CXX) $(SHARED) -o $(LIB_SO) $+ $(LDFLAGS)
 
@@ -74,3 +79,7 @@ PHONY += pdfs
 pdfs: $(patsubst %.dot,%.pdf,$(wildcard *.dot))
 
 .PHONY: $(PHONY)
+
+# A 1-inch margin PDF generated by 'pandoc'
+%.pdf: %.md
+       pandoc -o $@ $< -V header-includes='\usepackage[margin=1in]{geometry}'