blob: 0123e00d99fb28b277670a4973809753e8706681 [file] [log] [blame]
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02001.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_gecko release release_chromium_stable release_chromium_beta release_gecko_stable build_test_extension clean_releases clean
avm999636c357302020-08-09 19:54:08 +02002
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02003WEBPACK := ./node_modules/webpack-cli/bin/cli.js
4RELEASE_SCRIPT := bash tools/release.bash
avm999636c357302020-08-09 19:54:08 +02005
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02006node_deps:
7 npm ci --no-save
avm999636c357302020-08-09 19:54:08 +02008
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +02009clean_dist:
10 rm -rf dist
avm999636c357302020-08-09 19:54:08 +020011
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020012deps: node_deps
13 mkdir -p dist
avm99963bbc88c62020-12-25 03:44:41 +010014
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020015clean_deps:
16 rm -rf node_modules
avm999636c357302020-08-09 19:54:08 +020017
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020018serve_chromium: deps
19 $(WEBPACK) --mode development --env browser_target=chromium --watch
20
21serve_chromium_mv3: deps
22 $(WEBPACK) --mode development --env browser_target=chromium_mv3 --watch
23
24serve_gecko: deps
25 $(WEBPACK) --mode development --env browser_target=gecko --watch
26
27release: release_chromium_stable release_chromium_beta release_gecko_stable
28
29release_chromium_stable: deps
30 $(WEBPACK) --mode production --env browser_target=chromium
31 $(RELEASE_SCRIPT) -c stable -b chromium
32 rm -rf dist/chromium
33
34release_chromium_beta: deps
35 $(WEBPACK) --mode production --env browser_target=chromium
36 $(RELEASE_SCRIPT) -c beta -b chromium
37 rm -rf dist/chromium
38
39release_gecko_stable: deps
40 $(WEBPACK) --mode production --env browser_target=gecko
41 $(RELEASE_SCRIPT) -c stable -b gecko
42 rm -rf dist/gecko
43
44# Target to build the extension for webext lint in the Zuul Check Pipeline.
45build_test_extension: deps
46 $(WEBPACK) --mode production --env browser_target=gecko
47 $(RELEASE_SCRIPT) -c stable -b gecko
48
49clean_releases:
avm999636c357302020-08-09 19:54:08 +020050 rm -rf out
Adrià Vilanova Martínez3465e772021-07-11 19:18:41 +020051
52clean: clean_deps clean_dist clean_releases