1- .PHONY : all clean lint chromium firefox nodejs
1+ # https://stackoverflow.com/a/6273809
2+ run_options := $(filter-out $@ ,$(MAKECMDGOALS ) )
3+
4+ .PHONY : all clean test lint chromium firefox npm dig \
5+ compare maxcost mincost modifiers record wasm
26
37sources := $(wildcard src/* src/* /* src/* /* /* src/* /* /* /* )
48platform := $(wildcard platform/* platform/* /* )
@@ -7,7 +11,7 @@ assets := $(wildcard submodules/uAssets/* \
711 submodules/uAssets/* /* /* \
812 submodules/uAssets/* /* /* /* )
913
10- all : chromium firefox nodejs
14+ all : chromium firefox npm
1115
1216dist/build/uBlock0.chromium : tools/make-chromium.sh $(sources ) $(platform ) $(assets )
1317 tools/make-chromium.sh
@@ -21,20 +25,51 @@ dist/build/uBlock0.firefox: tools/make-firefox.sh $(sources) $(platform) $(asset
2125# Build the extension for Firefox.
2226firefox : dist/build/uBlock0.firefox
2327
24- dist/build/uBlock0.nodejs : tools/make-nodejs.sh $(sources ) $(platform ) $(assets )
25- tools/make-nodejs .sh
28+ dist/build/uBlock0.npm : tools/make-nodejs.sh $(sources ) $(platform ) $(assets )
29+ tools/make-npm .sh
2630
2731# Build the Node.js package.
28- nodejs : dist/build/uBlock0.nodejs
32+ npm : dist/build/uBlock0.npm
33+
34+ lint : npm
35+ cd dist/build/uBlock0.npm && npm run lint
36+
37+ test : npm
38+ cd dist/build/uBlock0.npm && npm run test
39+
40+ test-full-battery : npm
41+ cd dist/build/uBlock0.npm && npm run test-full-battery
42+
43+ check-leaks : npm
44+ cd dist/build/uBlock0.npm && npm run check-leaks
2945
30- lint : nodejs
31- eslint -c platform/nodejs/eslintrc.json \
32- dist/build/uBlock0.nodejs/js \
33- dist/build/uBlock0.nodejs/* .js
46+ dist/build/uBlock0.dig : tools/make-nodejs.sh $(sources ) $(platform ) $(assets )
47+ tools/make-dig.sh
48+
49+ dig : dist/build/uBlock0.dig
50+ cd dist/build/uBlock0.dig && npm install
51+
52+ dig-snfe : dig
53+ cd dist/build/uBlock0.dig && npm run snfe $(run_options )
3454
3555# Update submodules.
3656update-submodules :
3757 tools/update-submodules.sh
3858
3959clean :
40- rm -rf dist/build
60+ rm -rf dist/build tmp/node_modules
61+
62+
63+ # Not real targets, just convenient for auto-completion at shell prompt
64+ compare :
65+ @echo
66+ maxcost :
67+ @echo
68+ mincost :
69+ @echo
70+ modifiers :
71+ @echo
72+ record :
73+ @echo
74+ wasm :
75+ @echo
0 commit comments