@@ -194,20 +194,20 @@ $(BOOKS_CLEAN):
194194# github pages
195195
196196PHONY += $(GH_PAGES)
197−$(GH_PAGES):
197+$(GH_PAGES)::
198198 $(MAKE) docs
199199 [ -d "gh-pages/.git" ] || git clone $(GIT_URL) gh-pages
200− -cd $(GH_PAGES); git checkout --orphan gh-pages || exit 0
201− rm -rf $(GH_PAGES)/* $(GH_PAGES)/.gitignore
202− touch $(GH_PAGES)/.nojekyll ;\
200+ -cd $(GH_PAGES); git checkout gh-pages >/dev/null
201+ -cd $(GH_PAGES); ls -A | grep -v '.git$$' | xargs rm -rf
203202 cp -r $(DOCS_DIST)/* $(GH_PAGES)/
203+ touch $(GH_PAGES)/.nojekyll
204204 echo "<html><head><META http-equiv='refresh' content='0;URL=index.html'></head></html>" > $(GH_PAGES)/404.html
205− -cd $(GH_PAGES); git push origin :gh-pages
206205 cd $(GH_PAGES);\
207206 git add --all . ;\
208207 git commit -m "gh-pages: updated" ;\
209208 git push origin gh-pages
210209
210+
211211PHONY += docs-clean
212212docs-clean: $(BOOKS_CLEAN)
213213 $(call cmd,sphinx_clean)