From 25b014cdf44ed378413a7cb945b8c112ee9b9915 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Thu, 16 May 2013 16:24:59 -0700 Subject: Build a likely broken fiveui.xpi --- .gitignore | 1 + Makefile | 2 -- contexts/build.mk | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- profiles/build.mk | 12 ++++++------ 4 files changed, 54 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 7009869..e3b8310 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ chromedriver.log **/.settings /build/ fiveui.crx +fiveui.xpi diff --git a/Makefile b/Makefile index 8b465ec..1c0e9c9 100644 --- a/Makefile +++ b/Makefile @@ -85,5 +85,3 @@ test: chromeExtension profile-chrome profile-firefox ffExtension pkg-rsTester cd $(HEADLESS_DIR) && $(MVN_TEST_CMD) endif - -# Documentation ################################################################ diff --git a/contexts/build.mk b/contexts/build.mk index e259371..6b3e632 100644 --- a/contexts/build.mk +++ b/contexts/build.mk @@ -95,6 +95,9 @@ chrome-dir := $(path)/chrome all: $(topdir)/fiveui.crx +clean:: + $(RM) $(topdir)/fiveui.crx + $(topdir)/fiveui.crx: $(build-dir)/fiveui.crx $(call cmd,cp) @@ -107,8 +110,7 @@ $(build-dir)/fiveui.crx: $(target-dir)/chrome-background.js \ | $(stage-dir)/data/fiveui/images $(call label,MAKECRX $(call drop-prefix,$@)) ( cd $(build-dir) \ && $(topdir)/tools/bin/makecrx stage \ - $(topdir)/contexts/chrome/fiveui.pem \ - fiveui \ + $(topdir)/contexts/chrome/fiveui.pem fiveui \ $(redir) ) @@ -130,3 +132,46 @@ $(target-dir)/chrome-options.js: $(options-deps) \ $(chrome-src)/chrome-options.js \ | $(target-dir) $(call cmd,compilejs) + + +# Firefox Compilation ########################################################## + +addon-sdk := $(topdir)/tools/addon-sdk + +all: $(topdir)/fiveui.xpi + +clean:: + $(RM) $(topdir)/fiveui.xpi + +$(topdir)/fiveui.xpi: $(build-dir)/fiveui.xpi + $(call cmd,cp) + + +# wrapper for setting up the environment for the running the cfx command +cfx = ( cd $(addon-sdk) $(redir) && \ + . bin/activate $(redir) && \ + cd $(build-dir) $(redir) && \ + cfx $1 $(redir) ) + +# build the actual extension +$(build-dir)/fiveui.xpi: \ + $(stage-dir)/package.json \ + $(target-dir)/firefox-main.js \ + | $(topdir)/profiles/firefox + $(call label,XPI $(call drop-prefix,$@))\ + $(call cfx,xpi -p $(topdir)/profiles/firefox \ + --pkgdir=$(stage-dir) ) + +# stage the package description +$(stage-dir)/package.json: $(path)/package.json | $(stage-dir) + $(call cmd,cp) + +# build the main script +$(target-dir)/firefox-main.js: \ + $(fiveui-dir)/settings.js \ + $(fiveui-dir)/messenger.js \ + $(fiveui-dir)/rules.js \ + $(fiveui-dir)/background.js \ + $(fiveui-dir)/utils.js \ + | $(target-dir) + $(call cmd,compilejs) diff --git a/profiles/build.mk b/profiles/build.mk index 9aff102..72cd371 100644 --- a/profiles/build.mk +++ b/profiles/build.mk @@ -1,14 +1,14 @@ + # Macros ####################################################################### define profile -unpack: profile-$1 - -.PHONY: profile-$1 -profile-$1: | $(path)/$1 +$(topdir)/profiles/$1: $(topdir)/profiles/$1/.token ; -$(path)/$1: $(path)/$1.tar - tar -C $(path) -xvf $$< +$(topdir)/profiles/$1/.token: $(path)/$1.tar + $$(call label,PROFILE $1)\ + tar -C $(path) $(if $(Q),,-v) -xf $$< \ + && touch $$@ clean:: $(RM) -r $(path)/$1 -- cgit v1.2.3