]> git.llucax.com Git - software/mutest.git/blobdiff - Makefile
doc: Highlight syntax of code examples
[software/mutest.git] / Makefile
index 8f3913304606ed0b5fd41a046cd5b77e4a5909cb..92726cc93ac93b8b55a488f664bd31eebfb16d66 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 MANUAL_SRC=README
 MANUAL_HTML=manual.html
-MANUAL_LATEX=manual.latex
 MANUAL_PDF=manual.pdf
 SAMPLES = sample/factorial.c sample/factorial_test.c sample/exception_test.cpp
 MANUAL_GARBAGE = manual.aux manual.log manual.out
 # Programs
 RST2HTML = rst2html
-RST2LATEX = rst2latex
-PDFLATEX = pdflatex
+RST2PDF = rst2pdf
 INSTALL = install
+LN = ln
+MKDIR = mkdir
+CHMOD = chmod
+GIT = git
 # Directories
 prefix = /usr/local
 BIN_DIR = bin
@@ -36,16 +38,10 @@ doc-html: $(MANUAL_HTML)
 $(MANUAL_HTML): $(MANUAL_SRC) $(SAMPLES)
        $(RST2HTML) $< > $@
 
-doc-latex: $(MANUAL_LATEX)
-
-$(MANUAL_LATEX): $(MANUAL_SRC) $(SAMPLES)
-       $(RST2LATEX) $< > $@
-
 doc-pdf: $(MANUAL_PDF)
 
-$(MANUAL_PDF): $(MANUAL_LATEX)
-       $(PDFLATEX) $<
-       $(PDFLATEX) $<
+$(MANUAL_PDF): $(MANUAL_SRC)
+       $(RST2PDF) $< -o $@
 
 install-readme:
        $(INSTALL) -m 755 -d $(prefix)/$(DOC_DIR)
@@ -79,11 +75,32 @@ install: install-c install-py install-doc
 test:
        $(MAKE) -k -C sample test test-py
 
+# You shouldn't use this target
+ifeq ($(MAKECMDGOALS),release)
+ifeq ($(VERSION),)
+$(error You have to specify a VERSION when using the 'release' target)
+endif
+endif
+release: doc
+       $(RM) $(MANUAL_GARBAGE)
+       $(GIT) tag -f $(VERSION)
+       $(GIT) push --tags
+       $(MKDIR) -p releases
+       $(CHMOD) 755 releases
+       $(GIT) archive --format=tar --prefix=mutest-$(VERSION)/ $(VERSION) \
+                       | gzip > releases/mutest-$(VERSION).tar.gz
+       $(CHMOD) 644 releases/mutest-$(VERSION).tar.gz
+       $(LN) -sf mutest-$(VERSION).tar.gz releases/mutest.tar.gz
+       $(INSTALL) -m 644 manual.html releases/manual-$(VERSION).html
+       $(LN) -sf manual-$(VERSION).html releases/manual.html
+       $(INSTALL) -m 644 manual.pdf releases/manual-$(VERSION).pdf
+       $(LN) -sf manual-$(VERSION).pdf releases/manual.pdf
+
 clean:
-       $(RM) $(MANUAL_HTML) $(MANUAL_LATEX) $(MANUAL_PDF) $(MANUAL_GARBAGE)
+       $(RM) $(MANUAL_HTML) $(MANUAL_PDF) $(MANUAL_GARBAGE)
 
-.PHONY: all doc doc-html doc-latex doc-pdf \
+.PHONY: all doc doc-html doc-pdf \
                install-readme install-html install-pdf install-doc \
                install-c install-py install \
-               test clean
+               release test clean