-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (51 loc) · 1.79 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# The name of the extension.
extension_name := laproscope
# The UUID of the extension.
extension_uuid := laproscope@red-bean.com
# The name of the profile dir where the extension can be installed.
profile_dir := laproscope
# The zip application to be used.
ZIP := zip
# The target XPI file.
xpi_file := $(extension_name).xpi
# The type of operating system this make command is running on.
os_type := $(patsubst darwin%,darwin,$(shell echo $(OSTYPE)))
# The location of the extension profile.
profile_location := \
~/.mozilla/firefox/$(profile_dir)/extensions/\{$(extension_uuid)\}
# The temporary location where the extension tree will be copied and built.
build_dir := build
# This builds the extension XPI file.
.PHONY: all
all: $(xpi_file)
@echo
@echo "Build finished successfully."
@echo
# This cleans all temporary files and directories created by 'make'.
.PHONY: clean
clean:
@rm -rf $(build_dir)
@rm -f $(xpi_file)
@echo "Cleanup is done."
# The sources for the XPI file.
xpi_built := install.rdf \
chrome.manifest \
bootstrap.js \
options.xul \
$(wildcard content/*.js) \
$(wildcard content/*.jsm) \
$(wildcard content/*.xul) \
$(wildcard content/*.xml) \
$(wildcard content/*.css) \
$(wildcard skin/*.css) \
$(wildcard skin/*.png) \
$(wildcard locale/*/*.dtd) \
$(wildcard locale/*/*.properties)
# This builds everything except for the actual XPI, and then it copies it to the
# specified profile directory, allowing a quick update that requires no install.
.PHONY: install
install: $(build_dir) $(xpi_built)
cp -Rf $(build_dir)/* $(profile_location)
$(xpi_file): $(xpi_built)
$(ZIP) $(xpi_file).tmp $(xpi_built)
mv $(xpi_file).tmp $(xpi_file)