blob: ec00ad4c34d4e4e644c8ed9d112f75ffea6d30b1 [file] [log] [blame]
Adrià Vilanova Martínez86fda492022-05-31 15:05:21 +02001.PHONY: node_deps clean_dist deps clean_deps serve_chromium serve_chromium_mv3 serve_edge serve_edge_mv3 release release_chromium_stable release_chromium_beta release_edge build_test_extension clean_releases clean
avm99963f01af0e2020-12-26 23:11:10 +01002
Adrià Vilanova Martíneza197d862022-05-27 17:33:20 +02003.DEFAULT_GOAL := release
4WEBPACK := ./node_modules/webpack-cli/bin/cli.js
5RELEASE_SCRIPT := bash tools/release.bash
avm99963f01af0e2020-12-26 23:11:10 +01006
Adrià Vilanova Martíneza197d862022-05-27 17:33:20 +02007node_deps:
8 npm ci --no-save
avm999639bbb3a42020-12-29 03:29:44 +01009
Adrià Vilanova Martíneza197d862022-05-27 17:33:20 +020010clean_dist:
11 rm -rf dist
avm99963f01af0e2020-12-26 23:11:10 +010012
Adrià Vilanova Martíneza197d862022-05-27 17:33:20 +020013deps: node_deps
14 mkdir -p dist
15
16clean_deps:
17 rm -rf node_modules
18
19
20serve_chromium: deps
21 $(WEBPACK) --mode development --env browser_target=chromium --watch
22
Adrià Vilanova Martínez86fda492022-05-31 15:05:21 +020023serve_chromium_mv3: deps
24 $(WEBPACK) --mode development --env browser_target=chromium_mv3 --watch
25
Adrià Vilanova Martínez8b63fb32022-05-29 23:26:50 +020026serve_edge: deps
27 $(WEBPACK) --mode development --env browser_target=edge --watch
28
Adrià Vilanova Martínez86fda492022-05-31 15:05:21 +020029serve_edge_mv3: deps
30 $(WEBPACK) --mode development --env browser_target=edge_mv3 --watch
31
Adrià Vilanova Martínez8b63fb32022-05-29 23:26:50 +020032release: release_chromium_stable release_chromium_beta release_edge
Adrià Vilanova Martíneza197d862022-05-27 17:33:20 +020033
34release_chromium_stable: deps
35 $(WEBPACK) --mode production --env browser_target=chromium
36 $(RELEASE_SCRIPT) -c stable -b chromium -f
37 rm -rf dist/chromium
38
39release_chromium_beta: deps
40 $(WEBPACK) --mode production --env browser_target=chromium
41 $(RELEASE_SCRIPT) -c beta -b chromium -f
42 rm -rf dist/chromium
43
Adrià Vilanova Martínez8b63fb32022-05-29 23:26:50 +020044release_edge: deps
45 $(WEBPACK) --mode production --env browser_target=edge
46 $(RELEASE_SCRIPT) -c stable -b edge -f
47 rm -rf dist/edge
48
Adrià Vilanova Martínezd4f82c52022-05-29 21:54:34 +020049# Target to build the extension for webext lint in the Zuul Check Pipeline.
50build_test_extension: deps
51 $(WEBPACK) --mode production --env browser_target=chromium
52 $(RELEASE_SCRIPT) -c stable -b chromium -f
53
Adrià Vilanova Martíneza197d862022-05-27 17:33:20 +020054clean_releases:
avm99963f01af0e2020-12-26 23:11:10 +010055 rm -rf out
Adrià Vilanova Martíneza197d862022-05-27 17:33:20 +020056
57clean: clean_deps clean_dist clean_releases