Browse Source

Some useful targets for testing extensions.

Douglas William Thrift 10 years ago
parent
commit
9094507bae
2 changed files with 31 additions and 4 deletions
  1. 22 4
      GNUmakefile
  2. 9 0
      makefile

+ 22 - 4
GNUmakefile

@@ -7,23 +7,41 @@
 ifeq ($(OS),Windows_NT)
 SED := C:\cygwin\bin\sed.exe
 ZIP := C:\cygwin\bin\zip.exe
+PROFILE := $(subst /,\,$(firstword $(wildcard $(APPDATA)/Instantbird/Profiles/*.default)))
 RM_F := del /F /A
 else
-SED := gsed
+SED := sed
 ZIP := zip
+PROFILE := $(firstword $(wildcard ~/.instantbird/*.default))
 RM_F := rm -f
 endif
 
 files := install.rdf bootstrap.js
-version := $(shell $(SED) -re "s|^.*<em:version>(.+)</em:version>|\1|p;d" install.rdf)
-xpi := tabcomplete-$(version).xpi
+id := $(firstword $(shell $(SED) -re "s|^.*<em:id>(.+)</em:id>.*$$|\1|p;d" install.rdf))
+version := $(shell $(SED) -re "s|^.*<em:version>(.+)</em:version>.*$$|\1|p;d" install.rdf)
+xpi := $(shell echo $(id) | $(SED) -re "s/^(.+)@.*$$/\1/")-$(version).xpi
+shortcut := $(PROFILE)/extensions/$(id)
+cwd := $(CURDIR)/
 
-.PHONY: all clean
+ifeq ($(OS),Windows_NT)
+shortcut := $(subst /,\,$(shortcut))
+cwd := $(subst /,\,$(cwd))
+endif
+
+.PHONY: all install deinstall uninstall clean
 
 all: $(xpi)
 
 $(xpi): $(files)
 	$(ZIP) -ll $(xpi) $(files)
 
+install:
+	echo $(cwd) > $(shortcut)
+
+deinstall:
+	-$(RM_F) $(shortcut)
+
+uninstall: deinstall
+
 clean:
 	-$(RM_F) *.xpi

+ 9 - 0
makefile

@@ -7,5 +7,14 @@
 all:
 	mingw32-make $@
 
+install:
+	mingw32-make $@
+
+deinstall:
+	mingw32-make $@
+
+uninstall:
+	mingw32-make $@
+
 clean:
 	mingw32-make $@