-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (40 loc) · 1.83 KB
/
Makefile
File metadata and controls
53 lines (40 loc) · 1.83 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
45
46
47
48
49
50
51
52
53
BROWSERIFY := node_modules/.bin/browserify
PRETTIER := node_modules/.bin/prettier
LESSC := node_modules/.bin/lessc
CLEAN_FILES := css js
PRETTIER_FILES := $(wildcard *.json *.js popup/*.js offscreen/*.js options/*.js thunderbird/experiment/*.js thunderbird/experiment/*.json *.less popup/*.less options/*.less *.html popup/*.html offscreen/*.html options/*.html)
.PHONY: all
all: deps prettier css/popup.dist.css css/options.dist.css js/background.dist.js js/popup.dist.js js/offscreen.dist.js js/options.dist.js js/inject.dist.js
.PHONY: deps
deps:
yarn install
.PHONY: prettier
prettier: $(PRETTIER) $(PRETTIER_FILES)
$(PRETTIER) --write $(PRETTIER_FILES)
css/popup.dist.css: $(LESSC) popup/*.less
[ -d css ] || mkdir -p css
$(LESSC) popup/popup.less css/popup.dist.css
css/options.dist.css: $(LESSC) options/*.less
[ -d css ] || mkdir -p css
$(LESSC) options/options.less css/options.dist.css
js/background.dist.js: $(BROWSERIFY) background.js helpers/*.js thunderbird.js
[ -d js ] || mkdir -p js
$(BROWSERIFY) -o js/background.dist.js background.js
js/popup.dist.js: $(BROWSERIFY) popup/*.js helpers/*.js
[ -d js ] || mkdir -p js
$(BROWSERIFY) -o js/popup.dist.js popup/popup.js
js/offscreen.dist.js: $(BROWSERIFY) offscreen/*.js helpers/*.js
[ -d js ] || mkdir -p js
$(BROWSERIFY) -o js/offscreen.dist.js offscreen/offscreen.js
js/options.dist.js: $(BROWSERIFY) options/*.js
[ -d js ] || mkdir -p js
$(BROWSERIFY) -o js/options.dist.js options/options.js
js/inject.dist.js: $(BROWSERIFY) inject.js
[ -d js ] || mkdir -p js
$(BROWSERIFY) -o js/inject.dist.js inject.js
# Firefox requires the last command to evaluate to something serializable
# https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript#Return_value
echo ";undefined" >> js/inject.dist.js
.PHONY: clean
clean:
rm -rf $(CLEAN_FILES)