unignore bower_components
[bootswatch] / 2 / bower_components / bootstrap / Makefile
1 BOOTSTRAP = ./docs/assets/css/bootstrap.css
2 BOOTSTRAP_LESS = ./less/bootstrap.less
3 BOOTSTRAP_RESPONSIVE = ./docs/assets/css/bootstrap-responsive.css
4 BOOTSTRAP_RESPONSIVE_LESS = ./less/responsive.less
5 DATE=$(shell date +%I:%M%p)
6 CHECK=\033[32m✔\033[39m
7 HR=\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
8
9
10 #
11 # BUILD DOCS
12 #
13
14 build:
15         @echo "\n${HR}"
16         @echo "Building Bootstrap..."
17         @echo "${HR}\n"
18         @./node_modules/.bin/jshint js/*.js --config js/.jshintrc
19         @./node_modules/.bin/jshint js/tests/unit/*.js --config js/.jshintrc
20         @echo "Running JSHint on javascript...             ${CHECK} Done"
21         @./node_modules/.bin/recess --compile ${BOOTSTRAP_LESS} > ${BOOTSTRAP}
22         @./node_modules/.bin/recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > ${BOOTSTRAP_RESPONSIVE}
23         @echo "Compiling LESS with Recess...               ${CHECK} Done"
24         @node docs/build
25         @cp img/* docs/assets/img/
26         @cp js/*.js docs/assets/js/
27         @cp js/tests/vendor/jquery.js docs/assets/js/
28         @echo "Compiling documentation...                  ${CHECK} Done"
29         @cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > docs/assets/js/bootstrap.js
30         @./node_modules/.bin/uglifyjs -nc docs/assets/js/bootstrap.js > docs/assets/js/bootstrap.min.tmp.js
31         @echo "/**\n* Bootstrap.js v2.3.2 by @fat & @mdo\n* Copyright 2013 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > docs/assets/js/copyright.js
32         @cat docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js > docs/assets/js/bootstrap.min.js
33         @rm docs/assets/js/copyright.js docs/assets/js/bootstrap.min.tmp.js
34         @echo "Compiling and minifying javascript...       ${CHECK} Done"
35         @echo "\n${HR}"
36         @echo "Bootstrap successfully built at ${DATE}."
37         @echo "${HR}\n"
38         @echo "Thanks for using Bootstrap,"
39         @echo "<3 @mdo and @fat\n"
40
41 #
42 # RUN JSHINT & QUNIT TESTS IN PHANTOMJS
43 #
44
45 test:
46         ./node_modules/.bin/jshint js/*.js --config js/.jshintrc
47         ./node_modules/.bin/jshint js/tests/unit/*.js --config js/.jshintrc
48         node js/tests/server.js &
49         phantomjs js/tests/phantom.js "http://localhost:3000/js/tests"
50         kill -9 `cat js/tests/pid.txt`
51         rm js/tests/pid.txt
52
53 #
54 # CLEANS THE ROOT DIRECTORY OF PRIOR BUILDS
55 #
56
57 clean:
58         rm -r bootstrap
59
60 #
61 # BUILD SIMPLE BOOTSTRAP DIRECTORY
62 # recess & uglifyjs are required
63 #
64
65 bootstrap: bootstrap-img bootstrap-css bootstrap-js
66
67
68 #
69 # JS COMPILE
70 #
71 bootstrap-js: bootstrap/js/*.js
72
73 bootstrap/js/*.js: js/*.js
74         mkdir -p bootstrap/js
75         cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js js/bootstrap-affix.js > bootstrap/js/bootstrap.js
76         ./node_modules/.bin/uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.tmp.js
77         echo "/*!\n* Bootstrap.js by @fat & @mdo\n* Copyright 2013 Twitter, Inc.\n* http://www.apache.org/licenses/LICENSE-2.0.txt\n*/" > bootstrap/js/copyright.js
78         cat bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js > bootstrap/js/bootstrap.min.js
79         rm bootstrap/js/copyright.js bootstrap/js/bootstrap.min.tmp.js
80
81 #
82 # CSS COMPLILE
83 #
84
85 bootstrap-css: bootstrap/css/*.css
86
87 bootstrap/css/*.css: less/*.less
88         mkdir -p bootstrap/css
89         ./node_modules/.bin/recess --compile ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.css
90         ./node_modules/.bin/recess --compress ${BOOTSTRAP_LESS} > bootstrap/css/bootstrap.min.css
91         ./node_modules/.bin/recess --compile ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.css
92         ./node_modules/.bin/recess --compress ${BOOTSTRAP_RESPONSIVE_LESS} > bootstrap/css/bootstrap-responsive.min.css
93
94 #
95 # IMAGES
96 #
97
98 bootstrap-img: bootstrap/img/*
99
100 bootstrap/img/*: img/*
101         mkdir -p bootstrap/img
102         cp img/* bootstrap/img/
103
104
105 #
106 # MAKE FOR GH-PAGES 4 FAT & MDO ONLY (O_O  )
107 #
108
109 gh-pages: bootstrap docs
110         rm -f docs/assets/bootstrap.zip
111         zip -r docs/assets/bootstrap.zip bootstrap
112         rm -r bootstrap
113         rm -f ../bootstrap-gh-pages/assets/bootstrap.zip
114         node docs/build production
115         cp -r docs/* ../bootstrap-gh-pages
116
117 #
118 # WATCH LESS FILES
119 #
120
121 watch:
122         echo "Watching less files..."; \
123         watchr -e "watch('less/.*\.less') { system 'make' }"
124
125
126 .PHONY: docs watch gh-pages bootstrap-img bootstrap-css bootstrap-js