forked from rlamana/ventus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (42 loc) · 1.2 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
buildname = ventus
# Set the source directory
srcdir = src/ventus
builddir = build
# Less compiler
#@lessc $< > $(addprefix ${builddir}, $(notdir $@))
lessfiles = $(wildcard ${srcdir}/css/*.less)
templatefiles = $(wildcard ${srcdir}/tpl/*.tpl)
cssfile = ${builddir}/${buildname}.css
# Dependencies
targets = build.js
all: less handlebars debug release
debug: ${builddir} ${targets}
r.js -o build.js debug=true optimize=none out=${builddir}/${buildname}.js
release: ${builddir} ${targets}
r.js -o build.js debug=false out=${builddir}/${buildname}.min.js
less: ${builddir} cleanless $(lessfiles:.less=.css)
@echo LESS compiler finished.
@echo
%.css: %.less
@echo Compiling LESS $<
@lessc --yui-compress $< >> ${cssfile}
handlebars: ${builddir} $(templatefiles:.tpl=.tpl.js)
@echo HANDLEBARS template compiler finished.
@echo
%.tpl.js: %.tpl
@echo Compiling HANDLEBARS $<...
@handlebars --amd $< > $<.js
clean:
rm -f ${builddir}/${buildname}.js
rm -f ${builddir}/${buildname}.min.js
rm -f ${cssfile}
rm -f $(wildcard ${srcdir}/tpl/*.tpl.js)
rm -Rf ${builddir}
cleanless:
@rm -f ${cssfile}
${builddir}:
@mkdir -p ${builddir}
install:
npm install requirejs
npm install less
npm install handlebars