-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1016 Bytes
/
Makefile
File metadata and controls
50 lines (37 loc) · 1016 Bytes
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
PACKAGE = datavis
NODEUNIT = ./node_modules/nodeunit/bin/nodeunit
RJS = ./node_modules/requirejs/bin/r.js
NPM = npm
GIT = git
JSDIR = public/js
TESTDIR = test
BUILD ?= ./dist/app.build.js
DISTLIB ?= ./dist/datavis.js
DISTCSS ?= ./dist/datavis.css
MINIFY ?= 0
BUILDDIR = ./build
SOURCES = $(shell find $(JSDIR) -name "*.js")
CSS_SOURCES = $(shell find public/css -name "*.css")
ifeq ($(MINIFY),0)
RJSOPTS = "optimize=none"
endif
all: test
init:
@ $(NPM) install
@ $(GIT) submodule update --init
$(DISTCSS): $(CSS_SOURCES)
@ $(RJS) -o out=$(DISTCSS) cssIn=dist/app.build.css $(RJSOPTS)
@ perl -pi -e 's|\.\./public|..|g' $(DISTCSS)
$(DISTLIB): $(SOURCES) $(BUILD)
@ $(RJS) -o $(BUILD) out=$(DISTLIB) $(RJSOPTS)
dist: init $(DISTLIB) $(DISTCSS)
build: init
@ $(RJS) -o $(BUILD) \
appDir=./public dir=$(BUILDDIR) baseUrl=js namespace=
test: init
@ $(NODEUNIT) $(TESTDIR)
clean:
rm -rf $(DISTLIB) $(BUILDDIR)
dist-clean: clean
rm -rf node_modules/
.PHONY: test all dist