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