-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (30 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
44 lines (30 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.POSIX:
SRC := src/main.ts src/common.ts src/options.ts
JS := $(SRC:%.ts=%.js)
EXTENSION_DIR := web-ext-artifacts/extension
EXTENSION_ZIP := web-ext-artifacts/extension.zip
ICONS = src/icon16.png src/icon32.png src/icon48.png src/icon64.png src/icon128.png
build: $(EXTENSION_ZIP) $(EXTENSION_DIR)
lint:
npx web-ext lint
run:
npx web-ext run $(ARGS)
release:
@[ -n "`git tag --points-at HEAD`" ] || { echo "Cannot make release from non-tagged commit" >&2; exit 1; }
./scripts/gen-installer.sh
gh release create `git tag --points-at HEAD` scripts/output/installers/install-*
node_modules: package.json
npm install
touch -m $@
$(JS): $(SRC) src/types.d.ts tsconfig.json node_modules
npx tsc
src/browser-polyfill.js: node_modules
cp node_modules/webextension-polyfill/dist/browser-polyfill.js $@
src/icon%.png: src/icon.svg
rsvg-convert --width=$* --height=$* --keep-aspect-ratio $? > $@
$(EXTENSION_ZIP): $(JS) src/browser-polyfill.js src/options.html $(ICONS) src/manifest.json
npx web-ext build -n `basename $(EXTENSION_ZIP)`
$(EXTENSION_DIR): $(EXTENSION_ZIP)
unzip -o -d $@ $?
touch -m $@
.PHONY: build lint run release