-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
95 lines (67 loc) · 2.16 KB
/
Makefile
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
default: build
TARGET ?= chromium
PACKAGES := node_modules/.packages.build
BUILD := build.json
MANIFEST := manifest.json
MODS := $(shell pwd)/node_modules
NPATH := $(MODS)/.bin
TOOLPATH := $(shell pwd)/tools/bin
SRC := $(shell find src scss pages templates images -type f 2>/dev/null)
########################################################
# Building & cleaning targets
########################################################
$(PACKAGES): package.json
npm install
$(MAKE) -C $(MODS)/sauce-chartjs
touch $@
$(BUILD): $(SRC) $(MANIFEST) $(PACKAGES) Makefile .git/index
$(MAKE) sass
$(MAKE) mods
echo '{"git_commit": "$(shell git rev-parse HEAD 2>/dev/null || echo 0)"}' > $@
# Needed when mozilla store QA runs a build in a zip bundle
.git/index:
sass:
$(TOOLPATH)/sassrender
cp -a scss/site/fonts css/site/
mods:
rm -rf src/common/jscoop src/common/jsfit
cp -r $(MODS)/jscoop/src src/common/jscoop
cp -r $(MODS)/jsfit/src src/common/jsfit
cp $(MODS)/fflate/esm/browser.js src/common/fflate.mjs
cp $(MODS)/sauce-chartjs/dist/Chart.pretty.js src/site/chartjs/Chart.js
clean:
rm -rf $(PACKAGES) builds css
realclean: clean
rm -rf node_modules
build: $(BUILD)
build-gecko:
TARGET=gecko $(MAKE) manifest build
build-safari:
TARGET=safari $(MAKE) manifest build
build-safari-release:
TARGET=safari $(MAKE) manifest-release build
lint:
$(NPATH)/eslint src
translate:
$(TOOLPATH)/translate
$(MANIFEST): manifest_base.json manifest_$(TARGET).json Makefile
$(MAKE) manifest
manifest:
$(TOOLPATH)/mergejson manifest_base.json manifest_$(TARGET).json > manifest.json.tmp
$(TOOLPATH)/mergejson manifest.json.tmp manifest_dev.json > manifest.json
rm -f manifest.json.tmp
manifest-release:
$(TOOLPATH)/mergejson manifest_base.json manifest_$(TARGET).json > manifest.json
packages:
$(TOOLPATH)/package gecko
$(TOOLPATH)/package chromium
alpha-packages:
$(TOOLPATH)/package chromium_alpha
########################################################
# Runtime-only targets
########################################################
sass-watch:
$(TOOLPATH)/sassrender --watch
lint-watch:
$(TOOLPATH)/lintwatch
.PHONY: lint sass clean realclean packages manifest build mods