From 8b5d3c6b75744cf5938f253d20f367999e92b1a7 Mon Sep 17 00:00:00 2001 From: Trevor Elliott Date: Fri, 7 Jun 2013 16:42:11 -0700 Subject: Remove the addon-sdk from the repo, and download it on demand --- tools/build.mk | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tools/build.mk (limited to 'tools/build.mk') diff --git a/tools/build.mk b/tools/build.mk new file mode 100644 index 0000000..37b84a2 --- /dev/null +++ b/tools/build.mk @@ -0,0 +1,44 @@ + +# just in case the Config.mk isn't up to date +addon-sdk-version ?= 1.14 + +tools-dir := $(path) +addon-sdk-dir := $(tools-dir)/addon-sdk-$(addon-sdk-version) +addon-sdk-file := $(addon-sdk-dir).tar.gz +addon-sdk-url := https://ftp.mozilla.org/pub/mozilla.org/labs/jetpack/addon-sdk-$(addon-sdk-version).tar.gz + +cfx-cmd := $(addon-sdk-dir)/bin/cfx + + +quiet_cmd_wget = WGET $(call drop-prefix,$@) + cmd_wget = wget $(if $(Q),--quiet) -O $@ $(URL) + +$(addon-sdk-file): URL := $(addon-sdk-url) +$(addon-sdk-file): + $(call cmd,wget) + + +quiet_cmd_untar = TAR $(call drop-prefix,$@) + cmd_untar = tar $(if $(Q),,-v) -zxf $(ARCHIVE) -C $(TARGET) + + +addon-sdk-unpacked = $(addon-sdk-dir)/bin/activate + +$(addon-sdk-unpacked): ARCHIVE := $(addon-sdk-file) +$(addon-sdk-unpacked): TARGET := $(tools-dir) +$(addon-sdk-unpacked): $(addon-sdk-file) + $(call cmd,untar) + +.PHONY: addon-sdk +addon-sdk: $(cfx-cmd) + +distclean:: + $(RM) $(addon-sdk-file) + $(RM) -r $(addon-sdk-dir) + + +# wrapper for setting up the environment for running the cfx command +cfx = ( cd $(addon-sdk-dir) $(redir) && \ + . bin/activate $(redir) && \ + cd $1 $(redir) && \ + cfx $2 $(redir) ) -- cgit v1.2.3