forked from tangrams/tangram
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
46 lines (34 loc) · 1.3 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
BROWSERIFY = node_modules/.bin/browserify
UGLIFY = node_modules/.bin/uglifyjs
KARMA = ./node_modules/karma/bin/karma
JSHINT = ./node_modules/.bin/jshint
all: \
src/gl/shader_sources.js \
dist/tangram.min.js \
dist/tangram.debug.js
# browserify --debug adds source maps
dist/tangram.debug.js: $(shell $(BROWSERIFY) --list -t es6ify src/module.js)
node build.js --debug=true --require './src/module.js' > dist/tangram.debug.js
dist/tangram.min.js: dist/tangram.debug.js
$(UGLIFY) dist/tangram.debug.js -c warnings=false -m -o dist/tangram.min.js
# Process shaders into strings and export as a module
src/gl/shader_sources.js: $(wildcard src/gl/shaders/modules/*.glsl) $(wildcard src/gl/shaders/*.glsl)
bash ./build_shaders.sh > src/gl/shader_sources.js
build-testable: lint dist/tangram.debug.js
node build.js --debug=true --includeLet --all './test/*.js' > dist/tangram.test.js
test: build-testable
$(KARMA) start --single-run
test-ci: build-testable
$(KARMA) start --browsers SL_Firefox --single-run
clean:
rm -f dist/*
rm -f src/gl/shader_sources.js
lint:
$(JSHINT) src/gl/*.js
$(JSHINT) src/*.js
$(JSHINT) test/*.js
karma-start:
$(KARMA) start --browsers Chrome --no-watch
run-tests: build-testable
$(KARMA) run --browsers Chrome
.PHONY : clean all dev test lint build-testable karma-start run-tests