aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Trevor Elliott <trevor@galois.com>2013-06-21 14:29:28 -0700
committerGravatar Trevor Elliott <trevor@galois.com>2013-06-21 14:40:26 -0700
commit4b9a4468238b96482478b3fabdfe6fb8cabb4fd6 (patch)
treec904129516281f7984cb350981843af3565bd35a
parentd538e07c07c6057126748ac9cccac3139600be5b (diff)
Populate the gh-pages branch of the repo
-rw-r--r--Makefile59
-rw-r--r--doc/build.mk22
-rw-r--r--mk/util.mk4
-rw-r--r--src/js/chrome/build.mk1
-rw-r--r--src/js/firefox/build.mk8
5 files changed, 67 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index b9c915c..497caa7 100644
--- a/Makefile
+++ b/Makefile
@@ -39,6 +39,12 @@ distclean:: clean
.PHONY: test
test:
+.PHONY: generate
+generate:
+
+.PHONY: deploy
+deploy:
+
# Utilities ####################################################################
@@ -60,6 +66,8 @@ endif
build-dir := $(topdir)/build
+gh-pages-dir := $(build-dir)/gh-pages
+
$(build-dir):
$(call cmd,mkdir)
@@ -82,40 +90,51 @@ $(eval $(call subdir,profiles))
$(eval $(call subdir,doc))
-# Package Deployment ###########################################################
+# GH-Pages Generation ##########################################################
ifeq "$(git-cmd)" ""
$(call strict-error,"unable to locate git")
-else
+endif
remote-url := $(shell $(git-cmd) config remote.origin.url)
-$(build-dir)/gh-pages: | $(build-dir)
+$(gh-pages-dir): | $(build-dir)
$(call label,CLONE $(call drop-prefix,$@))\
( $(git-cmd) clone $(if $(Q),-q) $(topdir) $@ \
- && cd $@ \
+ && cd $(gh-pages-dir) \
&& $(git-cmd) remote set-url origin $(remote-url) \
- && $(git-cmd) fetch $(if $(Q),-q) origin \
+ && $(git-cmd) fetch $(if $(Q),-q) origin gh-pages \
&& $(git-cmd) checkout $(if $(Q),-q) gh-pages )
-$(build-dir)/gh-pages/binaries/%: $(build-dir)/% \
- | $(build-dir)/gh-pages
+
+generate: pull-gh-pages
+
+.PHONY: pull-gh-pages
+ifeq "$(pull)" "0"
+pull-gh-pages:
+else
+pull-gh-pages: $(gh-pages-dir)
+ $(call label,PULL $(call drop-prefix,$(gh-pages-dir)))\
+ ( cd $(gh-pages-dir) \
+ && $(git-cmd) pull $(if $(Q),-q) )
+endif
+
+
+# Move extensions into the binaries directory of the gh-pages branch
+$(gh-pages-dir)/binaries/%: $(build-dir)/% pull-gh-pages
$(call cmd,cp)
-.PHONY: genereate
-generate: $(build-dir)/gh-pages/binaries/fiveui.xpi \
- $(build-dir)/gh-pages/binaries/fiveui.crx
- $(call label,GENERATE)\
- ( cd $(build-dir)/gh-pages \
- && $(git-cmd) pull $(if $(Q),-q) \
- && $(git-cmd) add binaries \
- && $(git-cmd) add -u binaries \
- && $(git-cmd) commit $(if $(Q),-q) -m "deploy extensions" )
+generate: $(build-dir)/gh-pages/binaries/fiveui.xpi
+generate: $(build-dir)/gh-pages/binaries/fiveui.crx
-.PHONY: deploy
+
+# GH-Pages Deployment ##########################################################
+
+# this should be the only implementation of deploy.
deploy: generate
$(call label,DEPLOY)\
- ( cd $(build-dir)/gh-pages \
+ ( cd $(gh-pages-dir) \
+ && $(git-cmd) commit $(if $(Q),-q) -m "deploy gh-pages" \
+ && $(git-cmd) add \
+ && $(git-cmd) add -u \
&& git push $(if $(Q),-q) origin gh-pages )
-
-endif
diff --git a/doc/build.mk b/doc/build.mk
index 79efa14..8015747 100644
--- a/doc/build.mk
+++ b/doc/build.mk
@@ -62,3 +62,25 @@ $(jsdoc-dir)/index.html: \
$(topdir)/src/js/fiveui/injected/jquery-plugins.js \
| $(build-dir)
$(call label,JSDOC)$(topdir)/tools/bin/jsdoc $^ $(redir)
+
+
+
+# Web Manual Publishing ########################################################
+
+generate: generate-docs
+
+.PHONY: generate-docs
+generate-docs: $(gh-pages-dir)/manual
+
+# this is a bit conservative, as it will copy the documentation through each
+# time the rule gets invoked. Some sort of a tag file to track actual changes
+# would be sufficient to not perform extra work.
+$(gh-pages-dir)/manual: DIR := $(manual-dir)
+$(gh-pages-dir)/manual: web-manual | pull-gh-pages
+ $(call cmd,copydir)
+
+generate-docs: $(gh-pages-dir)/jsdoc
+
+$(gh-pages-dir)/jsdoc: DIR := $(jsdoc-dir)
+$(gh-pages-dir)/jsdoc: $(jsdoc-dir)/index.html | pull-gh-pages
+ $(call cmd,copydir)
diff --git a/mk/util.mk b/mk/util.mk
index c37c8034..a7d2239 100644
--- a/mk/util.mk
+++ b/mk/util.mk
@@ -14,7 +14,7 @@ cmd = @$(echo-cmd) $(cmd_$1)
label = $(if $(Q),$(Q)echo ' $1';)
-find-cmd = $(shell which $1 2$(redir))
+find-cmd = $(shell which $1 2>/dev/null)
drop-prefix = $(patsubst $(topdir)/%,%,$1)
@@ -23,7 +23,7 @@ quiet_cmd_mkdir = MKDIR $(call drop-prefix,$@)
cmd_mkdir = mkdir -p $@
quiet_cmd_copydir = CPDIR $(call drop-prefix,$@)
- cmd_copydir = cp -r $(DIR) $@
+ cmd_copydir = cp -r $(DIR) $(dir $@)
quiet_cmd_cp = CP $(call drop-prefix,$@)
cmd_cp = cp $< $@
diff --git a/src/js/chrome/build.mk b/src/js/chrome/build.mk
index 30c07f3..f06fb20 100644
--- a/src/js/chrome/build.mk
+++ b/src/js/chrome/build.mk
@@ -6,6 +6,7 @@ all: stage-chrome
package: $(build-dir)/fiveui.crx
+
chrome-dir := $(path)
chrome-build := $(build-dir)/chrome
diff --git a/src/js/firefox/build.mk b/src/js/firefox/build.mk
index 0a20a80..36fad92 100644
--- a/src/js/firefox/build.mk
+++ b/src/js/firefox/build.mk
@@ -83,10 +83,8 @@ stage-firefox: \
$(firefox-build)/data/icons/options-icon.js \
| $(firefox-build)
-$(build-dir)/fiveui.xpi: \
- stage-firefox \
- $(addon-sdk-unpacked) \
- $(topdir)/profiles/firefox
+$(build-dir)/fiveui.xpi: stage-firefox \
+ | $(topdir)/profiles/firefox $(addon-sdk-unpacked)
$(call label,XPI $(call drop-prefix,$@))\
$(call cfx,$(build-dir),xpi -p $(topdir)/profiles/firefox \
--pkgdir=$(firefox-build) )
@@ -94,5 +92,5 @@ $(build-dir)/fiveui.xpi: \
# Testing ######################################################################
-run-firefox: stage-firefox $(addon-sdk-unpacked)
+run-firefox: stage-firefox | $(addon-sdk-unpacked)
$(call label,RUNFF)$(call cfx,$(firefox-build),run)