2021-08-04 20:40:20 +02:00
|
|
|
.PHONY: all clean lint install chromium firefox nodejs install-nodejs-link install-nodejs uninstall-nodejs
|
2021-07-31 14:41:28 +02:00
|
|
|
|
|
|
|
sources := $(wildcard src/* src/*/* src/*/*/* src/*/*/*/*)
|
|
|
|
platform := $(wildcard platform/* platform/*/*)
|
|
|
|
assets := $(wildcard submodules/uAssets/* \
|
|
|
|
submodules/uAssets/*/* \
|
|
|
|
submodules/uAssets/*/*/* \
|
|
|
|
submodules/uAssets/*/*/*/*)
|
|
|
|
|
|
|
|
all: chromium firefox nodejs
|
|
|
|
|
2021-08-03 17:27:55 +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
|
|
|
|
|
2021-08-03 17:27:55 +02:00
|
|
|
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
|
|
|
|
|
2021-08-03 17:27:55 +02:00
|
|
|
dist/build/uBlock0.nodejs: tools/make-nodejs.sh $(sources) $(platform) $(assets)
|
2021-07-31 14:41:28 +02:00
|
|
|
tools/make-nodejs.sh
|
|
|
|
|
|
|
|
# Build the Node.js package.
|
|
|
|
nodejs: dist/build/uBlock0.nodejs
|
|
|
|
|
|
|
|
# Install the Node.js package as a link in the node_modules directory. This is
|
|
|
|
# convenient for development, but it breaks when the dist/build directory is
|
|
|
|
# cleaned up.
|
|
|
|
install-nodejs-link: dist/build/uBlock0.nodejs
|
|
|
|
npm install dist/build/uBlock0.nodejs --no-save
|
|
|
|
|
|
|
|
dist/build/uBlock0.nodejs.tgz: dist/build/uBlock0.nodejs
|
2021-08-01 00:36:31 +02:00
|
|
|
cd dist/build && tar czf uBlock0.nodejs.tgz uBlock0.nodejs
|
2021-07-31 14:41:28 +02:00
|
|
|
|
|
|
|
# Install the Node.js package.
|
|
|
|
install-nodejs: dist/build/uBlock0.nodejs.tgz
|
|
|
|
npm install dist/build/uBlock0.nodejs.tgz --no-save
|
|
|
|
|
|
|
|
# Uninstall the Node.js package.
|
|
|
|
uninstall-nodejs:
|
2021-08-02 15:17:56 +02:00
|
|
|
npm uninstall '@gorhill/ubo-core' --no-save
|
2021-07-31 14:41:28 +02:00
|
|
|
|
2021-08-04 20:40:20 +02:00
|
|
|
lint: nodejs
|
|
|
|
eslint -c platform/nodejs/eslintrc.json \
|
|
|
|
dist/build/uBlock0.nodejs/js \
|
|
|
|
dist/build/uBlock0.nodejs/*.js
|
|
|
|
|
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:
|
|
|
|
rm -rf dist/build
|