-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
49 lines (43 loc) · 1.38 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
ARCHS=linux linux64 mac64 win32
EXTENSION_NAME=adb-extension
# Please keep only three parts in the value of this `VERSION` variable.
# `build-xpis` below will automatically add a forth part.
VERSION=0.0.8
ROOT_PATH=pub/labs/devtools/$(EXTENSION_NAME)
ROOT_UPDATE_URL=https://ftp.mozilla.org/$(ROOT_PATH)
define build-xpis
pushd extension; \
index=0; \
for arch in $(ARCHS); do \
xpi_name=$(EXTENSION_NAME)-$(VERSION).$$index; \
echo "[release-$$arch] Create dist/$$arch/ folder"; \
mkdir -p ../dist/$$arch; \
echo "[release-$$arch] Create manifest.json"; \
sed \
-e "s#@@ARCH@@#$$arch#" \
-e "s#@@UPDATE_URL@@#$(ROOT_UPDATE_URL)/$$arch/update.json#" \
-e "s#@@VERSION@@#$(VERSION).$$index#" \
template-manifest.json > manifest.json; \
echo "[release-$$arch] ZIP to $$xpi_name-$$arch.xpi"; \
zip ../dist/$$arch/$$xpi_name-$$arch.xpi -r $$arch adb.json manifest.json; \
echo "[release-$$arch] Delete temporary manifest.json"; \
rm manifest.json; \
echo "[release-$$arch] Create update.json"; \
sed \
-e "s#@@UPDATE_LINK@@#$(ROOT_UPDATE_URL)/$$arch/$$xpi_name-$$arch.xpi#" \
-e "s#@@VERSION@@#$(VERSION).$$index#" \
../template-update.json > ../dist/$$arch/update.json; \
index=$$((index + 1)); \
done; \
popd
endef
define clean
for arch in $(ARCHS); do \
rm -rf dist/$$arch/; \
done
endef
package:
@$(call clean)
@$(call build-xpis)
clean:
@$(call clean)