This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathMakefile
54 lines (41 loc) · 1.75 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
FILES=adb.js adb-*.js binary-manager.js bootstrap.js device.js devtools-import.js devtools-require.js events.js fastboot.js main.js scanner.js unload.js
ADDON_NAME=adbhelper
ADDON_VERSION=0.12.2pre
XPI_NAME=$(ADDON_NAME)-$(ADDON_VERSION)
REMOTE_ROOT_PATH=/pub/labs/fxos-simulator/adb-helper/
UPDATE_LINK=https://ftp.mozilla.org$(REMOTE_ROOT_PATH)
UPDATE_URL=$(UPDATE_LINK)
S3_BASE_URL=s3://net-mozaws-prod-delivery-contrib$(REMOTE_ROOT_PATH)
XPIS = $(XPI_NAME)-win32.xpi $(XPI_NAME)-linux.xpi $(XPI_NAME)-linux64.xpi $(XPI_NAME)-mac64.xpi
all: $(XPIS)
define build-xpi
echo "build xpi for $1";
sed -e 's#@@UPDATE_URL@@#$(UPDATE_URL)$1/update.rdf#;s#@@ADDON_VERSION@@#$(ADDON_VERSION)#' template-install.rdf > install.rdf
zip $(XPI_NAME)-$1.xpi -r $2 install.rdf
endef
$(XPI_NAME)-win32.xpi: $(FILES) win32
@$(call build-xpi,win32, $^)
$(XPI_NAME)-linux.xpi: $(FILES) linux linux64
@$(call build-xpi,linux, $^)
$(XPI_NAME)-linux64.xpi: $(FILES) linux linux64
@$(call build-xpi,linux64, $^)
$(XPI_NAME)-mac64.xpi: $(FILES) mac64
@$(call build-xpi,mac64, $^)
clean:
rm -f adbhelper-*.xpi
rm -f update.rdf install.rdf
define release
./sign.sh $(XPI_NAME)-$1.xpi
echo "releasing $1"
aws s3 cp $(XPI_NAME)-$1.xpi $(S3_BASE_URL)$1/$(XPI_NAME)-$1.xpi
# Update the "latest" symbolic link with a copy inside s3
aws s3 cp $(S3_BASE_URL)$1/$(XPI_NAME)-$1.xpi $(S3_BASE_URL)$1/$(ADDON_NAME)-$1-latest.xpi
# Update the update manifest
sed -e 's#@@UPDATE_LINK@@#$(UPDATE_LINK)$1/$(XPI_NAME)-$1.xpi#;s#@@ADDON_VERSION@@#$(ADDON_VERSION)#' template-update.rdf > update.rdf
aws s3 cp --cache-control max-age=3600 update.rdf $(S3_BASE_URL)$1/update.rdf
endef
release: $(XPIS)
@$(call release,win32)
@$(call release,linux)
@$(call release,linux64)
@$(call release,mac64)