forked from mapbox/geojson.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (65 loc) · 2.56 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
BROWSERIFY = node_modules/.bin/browserify
SMASH = node_modules/.bin/smash
CLEANCSS = node_modules/.bin/cleancss
UGLIFY = node_modules/.bin/uglifyjs
LIBS = $(shell find lib -type f -name '*.js')
all: dist/site.js dist/site.mobile.js dist/delegate.js lib/mapbox.js/latest lib/mapbox.js/latest/mapbox.js
node_modules: package.json
npm install
dist:
mkdir -p dist
dist/d3.js: node_modules node_modules/d3/*
$(SMASH) node_modules/d3/src/start.js \
node_modules/d3/src/arrays/entries.js \
node_modules/d3/src/arrays/set.js \
node_modules/d3/src/arrays/pairs.js \
node_modules/d3/src/arrays/range.js \
node_modules/d3/src/behavior/drag.js \
node_modules/d3/src/core/rebind.js \
node_modules/d3/src/core/functor.js \
node_modules/d3/src/event/dispatch.js \
node_modules/d3/src/event/event.js \
node_modules/d3/src/selection/select.js \
node_modules/d3/src/selection/transition.js \
node_modules/d3/src/transition/each.js \
node_modules/d3/src/xhr/json.js \
node_modules/d3/src/xhr/json.js \
node_modules/d3/src/time/time.js \
node_modules/d3/src/time/format.js \
node_modules/d3/src/xhr/text.js \
node_modules/d3/src/geo/mercator.js \
node_modules/d3/src/geo/path.js \
node_modules/d3/src/end.js > dist/d3.js
dist/d3.min.js: dist/d3.js
$(UGLIFY) dist/d3.js > dist/d3.min.js
dist/lib.js: dist dist/d3.js $(LIBS)
cat dist/d3.js \
lib/hashchange.js \
lib/blob.js \
lib/base64.js \
lib/bucket.js \
lib/queue.js \
lib/d3.keybinding.js \
lib/d3.trigger.js \
lib/d3-compat.js \
lib/draw/leaflet.draw-src.js \
lib/drag/leaflet.drag.js \
lib/codemirror/lib/codemirror.js \
lib/codemirror/mode/javascript/javascript.js > dist/lib.js
dist/delegate.js: src/delegate.js
$(BROWSERIFY) src/delegate.js > dist/delegate.js
lib/mapbox.js/latest:
mkdir -p lib/mapbox.js/latest
lib/mapbox.js/latest/mapbox.js: node_modules/mapbox.js/*
$(BROWSERIFY) node_modules/mapbox.js > lib/mapbox.js/latest/mapbox.js
$(UGLIFY) -o lib/mapbox.js/latest/mapbox.js lib/mapbox.js/latest/mapbox.js
cp -r node_modules/mapbox.js/theme/images/ lib/mapbox.js/latest/images/
$(CLEANCSS) -o lib/mapbox.js/latest/mapbox.css --skip-rebase node_modules/mapbox.js/theme/style.css
dist/site.js: dist/lib.js src/index.js $(shell $(BROWSERIFY) --list src/index.js)
$(BROWSERIFY) --noparse=src/source/local.js -t brfs -r topojson src/index.js > dist/site.js
dist/site.mobile.js: dist/lib.js src/mobile.js $(shell $(BROWSERIFY) --list src/mobile.js)
$(BROWSERIFY) --noparse=src/source/local.js -t brfs -r topojson src/mobile.js > dist/site.mobile.js
clean:
rm -f dist/*
test:
npm test