2021-08-15 13:47:40 -06:00
|
|
|
# https://stackoverflow.com/a/6273809
|
|
|
|
run_options := $(filter-out $@,$(MAKECMDGOALS))
|
|
|
|
|
2022-09-06 11:47:52 -06:00
|
|
|
.PHONY: all clean test lint chromium firefox npm dig mv3 \
|
2021-08-29 06:58:20 -06:00
|
|
|
compare maxcost medcost mincost modifiers record wasm
|
2021-07-31 06:41:28 -06:00
|
|
|
|
2021-09-11 07:16:20 -06:00
|
|
|
sources := $(wildcard assets/resources/* src/* src/*/* src/*/*/* src/*/*/*/*)
|
2022-09-07 08:15:36 -06:00
|
|
|
platform := $(wildcard platform/* platform/*/* platform/*/*/*)
|
2021-07-31 06:41:28 -06:00
|
|
|
assets := $(wildcard submodules/uAssets/* \
|
|
|
|
submodules/uAssets/*/* \
|
|
|
|
submodules/uAssets/*/*/* \
|
|
|
|
submodules/uAssets/*/*/*/*)
|
|
|
|
|
2021-08-15 08:43:36 -06:00
|
|
|
all: chromium firefox npm
|
2021-07-31 06:41:28 -06:00
|
|
|
|
2021-08-03 09:27:55 -06:00
|
|
|
dist/build/uBlock0.chromium: tools/make-chromium.sh $(sources) $(platform) $(assets)
|
2021-07-31 06:41:28 -06:00
|
|
|
tools/make-chromium.sh
|
|
|
|
|
|
|
|
# Build the extension for Chromium.
|
|
|
|
chromium: dist/build/uBlock0.chromium
|
|
|
|
|
2021-08-03 09:27:55 -06:00
|
|
|
dist/build/uBlock0.firefox: tools/make-firefox.sh $(sources) $(platform) $(assets)
|
2021-07-31 06:41:28 -06:00
|
|
|
tools/make-firefox.sh all
|
|
|
|
|
|
|
|
# Build the extension for Firefox.
|
|
|
|
firefox: dist/build/uBlock0.firefox
|
|
|
|
|
2021-08-15 08:43:36 -06:00
|
|
|
dist/build/uBlock0.npm: tools/make-nodejs.sh $(sources) $(platform) $(assets)
|
|
|
|
tools/make-npm.sh
|
2021-07-31 06:41:28 -06:00
|
|
|
|
|
|
|
# Build the Node.js package.
|
2021-08-15 08:43:36 -06:00
|
|
|
npm: dist/build/uBlock0.npm
|
2021-07-31 06:41:28 -06:00
|
|
|
|
2021-08-15 08:43:36 -06:00
|
|
|
lint: npm
|
2021-08-16 10:34:54 -06:00
|
|
|
cd dist/build/uBlock0.npm && npm run lint
|
2021-08-04 12:40:20 -06:00
|
|
|
|
2021-08-15 08:43:36 -06:00
|
|
|
test: npm
|
2021-08-16 10:34:54 -06:00
|
|
|
cd dist/build/uBlock0.npm && npm run test
|
2021-08-15 08:43:36 -06:00
|
|
|
|
2021-08-17 06:55:31 -06:00
|
|
|
test-full-battery: npm
|
|
|
|
cd dist/build/uBlock0.npm && npm run test-full-battery
|
|
|
|
|
2021-08-18 05:28:23 -06:00
|
|
|
check-leaks: npm
|
|
|
|
cd dist/build/uBlock0.npm && npm run check-leaks
|
|
|
|
|
2021-08-15 08:43:36 -06:00
|
|
|
dist/build/uBlock0.dig: tools/make-nodejs.sh $(sources) $(platform) $(assets)
|
|
|
|
tools/make-dig.sh
|
|
|
|
|
|
|
|
dig: dist/build/uBlock0.dig
|
2021-08-15 13:47:40 -06:00
|
|
|
cd dist/build/uBlock0.dig && npm install
|
|
|
|
|
|
|
|
dig-snfe: dig
|
|
|
|
cd dist/build/uBlock0.dig && npm run snfe $(run_options)
|
2021-08-10 11:50:06 -06:00
|
|
|
|
2022-09-07 08:15:36 -06:00
|
|
|
mv3: tools/make-mv3.sh $(sources) $(platform)
|
|
|
|
tools/make-mv3.sh
|
2022-09-06 11:47:52 -06:00
|
|
|
|
2022-09-07 08:15:36 -06:00
|
|
|
mv3-quick: tools/make-mv3.sh $(sources) $(platform)
|
|
|
|
tools/make-mv3.sh quick
|
2022-09-07 08:23:40 -06:00
|
|
|
|
|
|
|
mv3-full: tools/make-mv3.sh $(sources) $(platform)
|
|
|
|
tools/make-mv3.sh all
|
2022-09-06 11:47:52 -06:00
|
|
|
|
2021-07-31 12:50:31 -06:00
|
|
|
# Update submodules.
|
|
|
|
update-submodules:
|
|
|
|
tools/update-submodules.sh
|
|
|
|
|
2021-07-31 06:41:28 -06:00
|
|
|
clean:
|
2021-08-16 09:54:03 -06:00
|
|
|
rm -rf dist/build tmp/node_modules
|
2021-08-15 13:47:40 -06:00
|
|
|
|
|
|
|
|
|
|
|
# Not real targets, just convenient for auto-completion at shell prompt
|
|
|
|
compare:
|
|
|
|
@echo
|
|
|
|
maxcost:
|
|
|
|
@echo
|
2021-08-29 06:58:20 -06:00
|
|
|
medcost:
|
|
|
|
@echo
|
2021-08-15 13:47:40 -06:00
|
|
|
mincost:
|
|
|
|
@echo
|
2021-08-17 10:48:39 -06:00
|
|
|
modifiers:
|
|
|
|
@echo
|
2021-08-15 13:47:40 -06:00
|
|
|
record:
|
|
|
|
@echo
|
|
|
|
wasm:
|
|
|
|
@echo
|