Makefile 1.6 KB
Newer Older
1
VERSION=2.0.0
2
3
BOOTSTRAP = ./bootstrap.css
BOOTSTRAP_MIN = ./bootstrap.min.css
4
BOOTSTRAP_LESS = ./less/bootstrap.less
5
6
BOOTSTRAP_RESPONSIVE = ./bootstrap-responsive.css
BOOTSTRAP_RESPONSIVE_MIN = ./bootstrap-responsive.min.css
7
BOOTSTRAP_RESPONSIVE_LESS = ./less/responsive.less
Marc Chung's avatar
Marc Chung committed
8
LESS_COMPRESSOR ?= `which lessc`
9
UGLIFY_JS ?= `which uglifyjs`
10
WATCHR ?= `which watchr`
11

12
13
14
15
#
# Build less files
#

16
build:
Marc Chung's avatar
Marc Chung committed
17
	@@if test ! -z ${LESS_COMPRESSOR}; then \
Jacob Thornton's avatar
Jacob Thornton committed
18
		sed -e 's/@VERSION/'"v${VERSION}"'/' -e 's/@DATE/'"`date`"'/' <${BOOTSTRAP_LESS} >${BOOTSTRAP_LESS}.tmp; \
19
20
21
		lessc ${BOOTSTRAP_LESS}.tmp > ${BOOTSTRAP}; \
		lessc ${BOOTSTRAP_LESS}.tmp > ${BOOTSTRAP_MIN} --compress; \
		rm -f ${BOOTSTRAP_LESS}.tmp; \
22
23
24
25
		sed -e 's/@VERSION/'"v${VERSION}"'/' -e 's/@DATE/'"`date`"'/' <${BOOTSTRAP_RESPONSIVE_LESS} >${BOOTSTRAP_RESPONSIVE_LESS}.tmp; \
		lessc ${BOOTSTRAP_RESPONSIVE_LESS}.tmp > ${BOOTSTRAP_RESPONSIVE}; \
		lessc ${BOOTSTRAP_RESPONSIVE_LESS}.tmp > ${BOOTSTRAP_RESPONSIVE_MIN} --compress; \
		rm -f ${BOOTSTRAP_RESPONSIVE_LESS}.tmp; \
26
27
28
29
30
		echo "Bootstrap successfully built! - `date`"; \
	else \
		echo "You must have the LESS compiler installed in order to build Bootstrap."; \
		echo "You can install it by running: npm install less -g"; \
	fi
31

32
33
34
#
# Watch less files
#
35

36
watch:
Jacob Thornton's avatar
Jacob Thornton committed
37
	@@if test ! -z ${WATCHR}; then \
38
	  echo "Watching less files..."; \
39
	  watchr -e "watch('less/.*\.less') { system 'make' }"; \
40
	else \
41
		echo "You must have the watchr installed in order to watch Bootstrap Less files."; \
42
43
		echo "You can install it by running: gem install watchr"; \
	fi
44

45
46
47
48
49
50
51
52
53
#
# Build docs from templates
#

docs:
	@ node docs/build


.PHONY: build watch docs