This repository has been archived by the owner on Apr 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 385
/
Makefile
59 lines (45 loc) · 2.09 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
# 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
npx 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 | npx 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 npx browserify --list src/index.js)
npx 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 npx browserify --list src/index.js)
npx browserify src/index.js --debug > $@
# assemble a library without bundled leaflet
dist/mapbox.standalone.js: node_modules/.install dist $(shell npx browserify --list src/mapbox.js)
npx 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 npx browserify --list src/mapbox.js)
npx browserify src/mapbox.js --debug > $@
# assemble an uncompressed but complete library for development
dist/mapbox.internals.js: node_modules/.install dist $(shell npx browserify --list src/internals.js)
npx browserify src/internals.js --debug > $@
clean:
rm -rf dist/*