From 8236b0dd74bbcd65d4420e5d810c4f93e69ccaac Mon Sep 17 00:00:00 2001
From: Oliver Schmidt 
Date: Sun, 9 Mar 2014 01:20:39 +0100
Subject: [PATCH] Upload zip file.
---
 .travis.yml       |  2 +-
 Makefile.gh-pages | 21 +++++++++++++++++++++
 doc/Makefile      | 18 +-----------------
 libsrc/Makefile   |  2 +-
 src/Makefile      |  2 +-
 5 files changed, 25 insertions(+), 20 deletions(-)
 create mode 100644 Makefile.gh-pages
diff --git a/.travis.yml b/.travis.yml
index 088ee69aa..3a9583e94 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,7 +7,7 @@ script:
   - make -C src clean all CROSS_COMPILE=i686-w64-mingw32-
   - make doc zip
 after_success:
-  - make -C doc gh-pages
+  - make -f Makefile.gh-pages
 env:
   global:
     - secure: "h+hoQdEHGPLNwaqGKmSaM8NBRDLc2X+W05VsnNG2Feq/wPv/AiBjONNlzN7jRf6D6f3aoPXaQ2Lc3bYWdxGvFRCmwiofdxkJI9n5L8HPHLZ2lf37MQsXmGJzoTFOvjPLj73H6HlbI9Ux0El3zO6hvalxiXj6TfoZ41dbhNyvpYk="
diff --git a/Makefile.gh-pages b/Makefile.gh-pages
new file mode 100644
index 000000000..573edfe9b
--- /dev/null
+++ b/Makefile.gh-pages
@@ -0,0 +1,21 @@
+.PHONY: all
+
+.SUFFIXES:
+
+GH_PAGES = ../gh-pages
+
+all:
+	date +%D | zip -z cc65
+ifdef GH_TOKEN
+	git clone --branch=gh-pages https://$(GH_TOKEN)@github.com/oliverschmidt/cc65.git $(GH_PAGES)
+	cd $(GH_PAGES) && git config user.name "Oliver Schmidt"
+	cd $(GH_PAGES) && git config user.email "ol.sc@web.de"
+	cd $(GH_PAGES) && git config push.default simple
+	cd $(GH_PAGES) && $(RM) -r doc download
+	cd $(GH_PAGES) && mkdir doc download
+	cp html/*.* $(GH_PAGES)/doc
+	cp cc65.zip $(GH_PAGES)/download/cc65-snapshot.zip
+	cd $(GH_PAGES) && git add -A doc download
+	cd $(GH_PAGES) && git commit -m "Updated from commit $(TRAVIS_COMMIT)."
+	cd $(GH_PAGES) && git push
+endif
diff --git a/doc/Makefile b/doc/Makefile
index 207a331f3..159c30021 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -21,13 +21,11 @@ TOC_LEVEL = 0
 
 TOC_LEVEL = 2
 
-GH_PAGES = ../../gh-pages
-
 clean:
 	$(RM) -r ../html ../info
 
 zip:
-	cd .. && zip cc65 html/*.*
+	@cd .. && zip cc65 html/*.*
 
 doc: html info
 
@@ -47,18 +45,4 @@ info: $(addprefix ../info/,$(SGMLS:.sgml=.info))
 ../info/%.info: %.sgml | ../info
 	@cd ../info && linuxdoc -B info ../doc/$<
 
-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"
-	git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git config push.default simple
-	$(RM) -r $(GH_PAGES)/doc
-	mkdir $(GH_PAGES)/doc
-	cp ../html/* $(GH_PAGES)/doc
-	git --work-tree=$(GH_PAGES) --git-dir=$(GH_PAGES)/.git add -A doc
-	-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
-
 endif # CMD_EXE
diff --git a/libsrc/Makefile b/libsrc/Makefile
index 877a22950..3a355b954 100644
--- a/libsrc/Makefile
+++ b/libsrc/Makefile
@@ -98,7 +98,7 @@ endif # CMD_EXE
 
 define ZIP_recipe
 
-cd .. && zip cc65 $(dir)/*.*
+@cd .. && zip cc65 $(dir)/*.*
 
 endef # ZIP_recipe
 
diff --git a/src/Makefile b/src/Makefile
index 17e3bc229..81f28dee5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -98,7 +98,7 @@ unavail:
 endif # CMD_EXE
 
 zip:
-	cd .. && zip cc65 bin/*
+	@cd .. && zip cc65 bin/*
 
 define OBJS_template
 
-- 
2.39.5