uBlock/Makefile

78 lines
1.8 KiB
Makefile
Raw Normal View History

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