X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2FMakefile;h=d0985841968bb35436a072ef7631f61f102cc697;hb=refs%2Fheads%2Fupstream;hp=0251c4ab3ce210e14c1b17c5665c456052a80f88;hpb=354a049cce8415487552ce405cce167b7071fe1f;p=dactyl.git diff --git a/common/Makefile b/common/Makefile index 0251c4a..d098584 100644 --- a/common/Makefile +++ b/common/Makefile @@ -1,11 +1,17 @@ #### configuration +_SH := $(shell if which dash >/dev/null 2>&1; \ + then echo dash; \ + else echo sh; \ + fi) +SH ?= $(_SH) AWK ?= awk B64ENCODE ?= base64 CURL ?= curl SED := $(shell if [ "xoo" = x$$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ]; \ - then echo sed -E; else echo sed -r; \ + then echo sed -E; \ + else echo sed -r; \ fi) TOP = $(shell pwd) @@ -28,7 +34,7 @@ LOCALEDIR = locale DOC_FILES = $(wildcard $(LOCALEDIR)/*/*.xml) export VERSION BUILD_DATE -MAKE_JAR = sh $(BASE)/make_jar.sh +MAKE_JAR = $(SH) $(BASE)/make_jar.sh # TODO: specify source files manually? JAR_BASES = $(TOP) $(BASE) @@ -90,26 +96,6 @@ info: jar: $(JAR) -# This is not for you! -dist: $(XPI) - @echo DIST $(XPI) $(GOOGLE) - set -e; \ - \ - proj=$$(echo -n $(NAME) | sed 's/\(.\).*/\1/' | tr a-z A-Z); \ - proj="$$proj$$(echo $(NAME) | sed 's/.//')"; \ - [ -z "$$summary" ] && summary="$$proj $(VERSION) Release"; \ - labels="Project-$$proj,$(labels)"; \ - [ -n "$(featured)" ] && labels="$$labels,Featured"; \ - \ - IFS=,; for l in $$labels; do \ - set -- "$$@" --form-string "label=$$l"; \ - done; \ - auth=$$(echo -n "$(GOOGLE_USER):$(GOOGLE_PASS)" | $(B64ENCODE)); \ - $(CURL) "$$@" --form-string "summary=$$summary" \ - -F "filename=@$(XPI)" \ - -H "Authorization: Basic $$auth" \ - -i "$(GOOGLE)" | sed -n '/^Location/{p;q;}' - install: export dir; \ for dir in $(PROFILEPATHS); do \ @@ -177,6 +163,10 @@ xpi: $(CHROME) -f $(BASE)/process_manifest.awk \ "$(TOP)/chrome.manifest" >"$(XPI_PATH)/chrome.manifest" + $(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \ + -f $(BASE)/process_config.awk \ + "$(TOP)/config.json" >"$(XPI_PATH)/config.json" + version="$(VERSION)"; \ hg root >/dev/null 2>&1 && \ case "$$version" in \