forked from todc/todc-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (30 loc) · 1.27 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
DIST_DIR = dist
CSS_FILE = ${DIST_DIR}/todc-bootstrap.css
BOOTSTRAP_DIR = bootstrap
BOOTSTRAP_URL = https://github.com/twitter/bootstrap.git
BOOTSTRAP_VERSION = v2.3.0
build:
@test -d $(BOOTSTRAP_DIR) || $(MAKE) checkout_bootstrap
@mkdir -p ${DIST_DIR}
lessc less/todc-bootstrap.less > ${CSS_FILE}
checkout_bootstrap:
git clone ${BOOTSTRAP_URL} ${BOOTSTRAP_DIR}
cd ${BOOTSTRAP_DIR} && git checkout tags/${BOOTSTRAP_VERSION}
#
# For @todc
#
docs:
@rm -rf ./docs/
@$(MAKE) build
@cp less/variables.less ${BOOTSTRAP_DIR}/less/
@$(MAKE) --directory=${BOOTSTRAP_DIR}
@cp -r bootstrap/docs ./docs
@cp ${CSS_FILE} docs/assets/css/
@cp js/*.js ./docs/assets/js/
@cp img/* ./docs/assets/img/
@sed -i '' 's|</head>|<link href="assets/css/todc-bootstrap.css" rel="stylesheet"></head>|g' ./docs/*.html
@sed -i '' 's|<script src="assets/js/application.js"></script>|<script src="assets/js/google-select-dropdown.js"></script><script src="assets/js/google-select.js"></script><script src="assets/js/application.js"></script>|g' ./docs/*.html
@sed -i '' 's|window.prettyPrint \&\& prettyPrint()|window.prettyPrint \&\& prettyPrint(); $$("select:not([multiple])").gSelect() |' ./docs/assets/js/application.js
@rm -rf docs/build
@rm -rf docs/templates
.PHONY: build docs checkout_bootstrap