diff --git a/src/Makefile b/src/Makefile index f8e8838..b66cdd9 100755 --- a/src/Makefile +++ b/src/Makefile @@ -40,9 +40,22 @@ profile_id := mozilla-dev # ("could not be installed because Firefox cannot modify the needed file") ZIP := zip # --symlinks +ifdef DEBUG +build_debug := -debug +copy_and_strip_maybe = \ +@mkdir -p $(dir $(1)); \ +cp -f $(2) $(1); +else +copy_and_strip_maybe = \ +@mkdir -p $(dir $(1)); \ +echo "Stripping debug calls from JS file $<"; \ +sed '/log.debug(/d' $(2) > $(1); +endif + # The target location of the build and build files. -git_rev = $(shell git rev-parse --short HEAD) -build_dir := ../build-$(git_rev) +git_rev = -$(shell git rev-parse --short HEAD) +build_dir := ../build$(git_rev)$(build_debug) + # The location of the extension profile. (this extension is intended for Linux only) profile_locations := \ @@ -137,26 +150,11 @@ build: $(xpi_built) clean: clean_build @echo "Cleanup is done." -# Regex for 'no' -YES_RE := yes|y|Y|true|on - # called via $(build_includes) $(build_dir)/%: % @mkdir -p $(dir $@) @cp -f $< $@ # -d for symlinks -copy_and_strip_maybe = \ - @mkdir -p $(dir $(1)); \ - case "$(DEBUG)" in \ - $(YES_RE)) \ - cp -f $(2) $(1); \ - ;; \ - *) \ - echo "Stripping debug calls from JS file $<"; \ - sed '/log.debug(/d' $(2) > $(1); \ - ;; \ - esac - # Debug calls are removed for performance. # NOTE: we could also use m4 for filtering source files... $(build_dir)/$(chrome_source_root)/%.js: $(chrome_source_root)/%.js @@ -184,8 +182,8 @@ $(profile_locations): done clean_build: - @echo "Removing build dir: $(build_dir)" - @rm -rf $(build_dir) + @echo "Removing build dirs: $(build_dir)*" + @rm -rf $(build_dir)* # Version fetched from install.rdf const_file := modules/commons.js