2021-08-15 19:47:40 +00:00
|
|
|
# https://stackoverflow.com/a/6273809
|
|
|
|
|
run_options := $(filter-out $@,$(MAKECMDGOALS))
|
|
|
|
|
|
2024-11-11 18:20:54 +00:00
|
|
|
.PHONY: all clean cleanassets test lint chromium opera firefox npm dig \
|
2025-03-08 15:43:59 +00:00
|
|
|
mv3-chromium mv3-firefox mv3-edge \
|
2021-08-29 12:58:20 +00:00
|
|
|
compare maxcost medcost mincost modifiers record wasm
|
2021-07-31 12:41:28 +00:00
|
|
|
|
2023-03-23 17:40:51 +00:00
|
|
|
sources := $(wildcard assets/* assets/*/* dist/version src/* src/*/* src/*/*/* src/*/*/*/*)
|
2023-04-07 14:19:43 +00:00
|
|
|
platform := $(wildcard platform/* platform/*/* platform/*/*/* platform/*/*/*/* platform/*/*/*/*/*)
|
2022-11-14 14:50:53 +00:00
|
|
|
assets := dist/build/uAssets
|
2021-07-31 12:41:28 +00:00
|
|
|
|
2021-08-15 14:43:36 +00:00
|
|
|
all: chromium firefox npm
|
2021-07-31 12:41:28 +00:00
|
|
|
|
2021-08-03 15:27:55 +00:00
|
|
|
dist/build/uBlock0.chromium: tools/make-chromium.sh $(sources) $(platform) $(assets)
|
2021-07-31 12:41:28 +00:00
|
|
|
tools/make-chromium.sh
|
|
|
|
|
|
|
|
|
|
# Build the extension for Chromium.
|
|
|
|
|
chromium: dist/build/uBlock0.chromium
|
|
|
|
|
|
2023-01-01 15:21:54 +00:00
|
|
|
dist/build/uBlock0.opera: tools/make-opera.sh $(sources) $(platform) $(assets)
|
|
|
|
|
tools/make-opera.sh
|
|
|
|
|
|
|
|
|
|
# Build the extension for Opera.
|
|
|
|
|
opera: dist/build/uBlock0.opera
|
|
|
|
|
|
2021-08-03 15:27:55 +00:00
|
|
|
dist/build/uBlock0.firefox: tools/make-firefox.sh $(sources) $(platform) $(assets)
|
2021-07-31 12:41:28 +00:00
|
|
|
tools/make-firefox.sh all
|
|
|
|
|
|
|
|
|
|
# Build the extension for Firefox.
|
|
|
|
|
firefox: dist/build/uBlock0.firefox
|
|
|
|
|
|
2021-08-15 14:43:36 +00:00
|
|
|
dist/build/uBlock0.npm: tools/make-nodejs.sh $(sources) $(platform) $(assets)
|
|
|
|
|
tools/make-npm.sh
|
2021-07-31 12:41:28 +00:00
|
|
|
|
2025-01-11 15:53:36 +00:00
|
|
|
npm: dist/build/uBlock0.npm
|
|
|
|
|
|
2025-01-09 14:33:22 +00:00
|
|
|
# Dev tools
|
2025-01-10 16:08:54 +00:00
|
|
|
node_modules:
|
2025-01-09 14:33:22 +00:00
|
|
|
npm install
|
2021-07-31 12:41:28 +00:00
|
|
|
|
2025-01-11 15:53:36 +00:00
|
|
|
init: node_modules
|
2025-01-10 16:08:54 +00:00
|
|
|
|
2025-01-11 15:53:36 +00:00
|
|
|
lint: init
|
2025-01-09 14:33:22 +00:00
|
|
|
npm run lint
|
2021-08-04 18:40:20 +00:00
|
|
|
|
2021-08-15 14:43:36 +00:00
|
|
|
test: npm
|
2021-08-16 16:34:54 +00:00
|
|
|
cd dist/build/uBlock0.npm && npm run test
|
2021-08-15 14:43:36 +00:00
|
|
|
|
2021-08-17 12:55:31 +00:00
|
|
|
test-full-battery: npm
|
|
|
|
|
cd dist/build/uBlock0.npm && npm run test-full-battery
|
|
|
|
|
|
2021-08-18 11:28:23 +00:00
|
|
|
check-leaks: npm
|
|
|
|
|
cd dist/build/uBlock0.npm && npm run check-leaks
|
|
|
|
|
|
2021-08-15 14:43:36 +00:00
|
|
|
dist/build/uBlock0.dig: tools/make-nodejs.sh $(sources) $(platform) $(assets)
|
|
|
|
|
tools/make-dig.sh
|
|
|
|
|
|
|
|
|
|
dig: dist/build/uBlock0.dig
|
2021-08-15 19:47:40 +00:00
|
|
|
cd dist/build/uBlock0.dig && npm install
|
|
|
|
|
|
|
|
|
|
dig-snfe: dig
|
|
|
|
|
cd dist/build/uBlock0.dig && npm run snfe $(run_options)
|
2021-08-10 17:50:06 +00:00
|
|
|
|
2025-03-08 18:39:53 +00:00
|
|
|
mv3-assets:
|
|
|
|
|
mkdir dist/build/mv3-data
|
|
|
|
|
|
|
|
|
|
dist/build/uBOLite.chromium: tools/make-mv3.sh $(sources) $(platform) mv3-assets
|
2023-04-07 14:19:43 +00:00
|
|
|
tools/make-mv3.sh chromium
|
|
|
|
|
|
2024-11-11 18:20:54 +00:00
|
|
|
mv3-chromium: dist/build/uBOLite.chromium
|
|
|
|
|
|
2025-03-08 18:39:53 +00:00
|
|
|
dist/build/uBOLite.firefox: tools/make-mv3.sh $(sources) $(platform) mv3-assets
|
2023-04-07 14:19:43 +00:00
|
|
|
tools/make-mv3.sh firefox
|
2022-09-06 17:47:52 +00:00
|
|
|
|
2024-11-11 18:20:54 +00:00
|
|
|
mv3-firefox: dist/build/uBOLite.firefox
|
|
|
|
|
|
2025-03-08 18:39:53 +00:00
|
|
|
dist/build/uBOLite.edge: tools/make-mv3.sh tools/make-edge.mjs $(sources) $(platform) mv3-assets
|
2025-03-08 15:43:59 +00:00
|
|
|
tools/make-mv3.sh edge
|
2022-09-13 21:44:24 +00:00
|
|
|
|
2025-03-08 15:43:59 +00:00
|
|
|
mv3-edge: dist/build/uBOLite.edge
|
2022-09-06 17:47:52 +00:00
|
|
|
|
2022-11-14 14:50:53 +00:00
|
|
|
dist/build/uAssets:
|
|
|
|
|
tools/pull-assets.sh
|
2021-07-31 18:50:31 +00:00
|
|
|
|
2021-07-31 12:41:28 +00:00
|
|
|
clean:
|
2025-01-10 16:08:54 +00:00
|
|
|
rm -rf dist/build tmp/node_modules node_modules
|
2021-08-15 19:47:40 +00:00
|
|
|
|
2024-02-25 23:27:07 +00:00
|
|
|
cleanassets:
|
|
|
|
|
rm -rf dist/build/mv3-data dist/build/uAssets
|
2021-08-15 19:47:40 +00:00
|
|
|
|
|
|
|
|
# Not real targets, just convenient for auto-completion at shell prompt
|
|
|
|
|
compare:
|
|
|
|
|
@echo
|
|
|
|
|
maxcost:
|
|
|
|
|
@echo
|
2021-08-29 12:58:20 +00:00
|
|
|
medcost:
|
|
|
|
|
@echo
|
2021-08-15 19:47:40 +00:00
|
|
|
mincost:
|
|
|
|
|
@echo
|
2021-08-17 16:48:39 +00:00
|
|
|
modifiers:
|
|
|
|
|
@echo
|
2021-08-15 19:47:40 +00:00
|
|
|
record:
|
|
|
|
|
@echo
|
|
|
|
|
wasm:
|
|
|
|
|
@echo
|