forked from mapbox/mapbox.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (47 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
CLEANCSS = node_modules/.bin/cleancss
BROWSERIFY = node_modules/.bin/browserify
# the default rule when someone runs simply `make`
all: \
dist/mapbox.js \
dist/mapbox.uncompressed.js \
dist/mapbox.internals.js \
dist/mapbox.standalone.js \
dist/mapbox.standalone.uncompressed.js \
dist/mapbox.css \
dist/mapbox.standalone.css \
dist/images/icons-404040.png
node_modules/.install: package.json
npm install && touch node_modules/.install
mapbox%js:
@cat $(filter %.js,$^) > $@
dist:
mkdir -p dist
dist/mapbox.css: dist/mapbox.uncompressed.css
$(CLEANCSS) dist/mapbox.uncompressed.css -o dist/mapbox.css
dist/mapbox.uncompressed.css: theme/style.css
cat theme/style.css > dist/mapbox.uncompressed.css
dist/mapbox.standalone.css: theme/style.css
cat theme/style.css | $(CLEANCSS) > dist/mapbox.standalone.css
theme/images: theme/images/icons.svg
./theme/images/render.sh
dist/images/icons-404040.png: theme/images
cp -r theme/images/ dist/images
cp -r node_modules/leaflet/dist/images/ dist/images
rm -f dist/images/render.sh
# assemble a complete library for development
dist/mapbox.js: node_modules/.install dist $(shell $(BROWSERIFY) --list src/index.js)
$(BROWSERIFY) src/index.js --debug -p [minifyify --map mapbox.js.map --output dist/mapbox.js.map] > $@
# assemble an uncompressed but complete library for development
dist/mapbox.uncompressed.js: node_modules/.install dist $(shell $(BROWSERIFY) --list src/index.js)
$(BROWSERIFY) src/index.js --debug > $@
# assemble a library without bundled leaflet
dist/mapbox.standalone.js: node_modules/.install dist $(shell $(BROWSERIFY) --list src/mapbox.js)
$(BROWSERIFY) src/mapbox.js --debug -p [minifyify --map mapbox.standalone.js.map --output dist/mapbox.standalone.js.map] > $@
# assemble an uncompressed library without bundled leaflet
dist/mapbox.standalone.uncompressed.js: node_modules/.install dist $(shell $(BROWSERIFY) --list src/mapbox.js)
$(BROWSERIFY) src/mapbox.js --debug > $@
# assemble an uncompressed but complete library for development
dist/mapbox.internals.js: node_modules/.install dist $(shell $(BROWSERIFY) --list src/internals.js)
$(BROWSERIFY) src/internals.js --debug > $@
clean:
rm -rf dist/*