]> git.sur5r.net Git - cc65/commitdiff
Some polishing.
authorOliver Schmidt <ol.sc@web.de>
Wed, 5 Feb 2014 19:55:17 +0000 (20:55 +0100)
committerOliver Schmidt <ol.sc@web.de>
Wed, 5 Feb 2014 19:55:17 +0000 (20:55 +0100)
doc/Makefile

index 7fb0155f640aa62dc28d56cdd03b398626f4c6f5..a601d4426b9bc93c2a20f3477dc98e05065a8785 100644 (file)
@@ -1,35 +1,46 @@
-.PHONY: all html gh-pages
+.PHONY: all doc html gh-pages mostlyclean clean install
 
 .SUFFIXES:
 
-all: html
+ifeq ($(shell echo),)
 
-html: $(addprefix ../html/,$(subst .sgml,.html,$(wildcard *.sgml)))
+SGMLS := $(wildcard *.sgml)
+
+GH_PAGES = ../../gh-pages
+
+all:
+
+doc: html
+
+mostlyclean:
+
+clean:
+       $(RM) -r ../html
+
+html: $(addprefix ../html/,$(SGMLS:.sgml=.html))
 
 ../html:
        mkdir $@
 
 ../html/%.html: %.sgml | ../html
        linuxdoc -B html --split=0 --toc=2 $<
-       mv *.html $(@D)
-
-../html/coding.html: coding.sgml | ../html
-       linuxdoc -B html --split=0 $<
-       mv *.html $(@D)
-
-../html/index.html: index.sgml | ../html
-       linuxdoc -B html --split=0 $<
-       mv *.html $(@D)
-
-GH_PAGES = ../../gh-pages
+       mv $(@F) ../html
 
 gh-pages: html
+ifdef GH_TOKEN
        git clone --branch=gh-pages https://$(GH_TOKEN)@github.com/oliverschmidt/cc65.git $(GH_PAGES)
        git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git config user.name "Oliver Schmidt"
        git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git config user.email "ol.sc@web.de"
-       rm -rf $(GH_PAGES)/test
+       $(RM) -r $(GH_PAGES)/test
        mkdir $(GH_PAGES)/test
        cp -R ../html/* $(GH_PAGES)/test
        git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git add -A .
        -git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git commit -m "Updated doc from commit $(TRAVIS_COMMIT)."
        git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git push
+endif
+
+else # cmd.exe
+
+all doc mostlyclean clean install:
+
+endif # cmd.exe