This repository was archived by the owner on Oct 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 1.25 KB
/
Makefile
File metadata and controls
49 lines (38 loc) · 1.25 KB
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
COFFEE_DIR = ./src
DOCS_DIR = ./docs
DIST_DIR = ./dist
BUILD_DIR = ./build
PID_FILE = .watch-pid
SASS_DIR = ./docs/scss
CSS_DIR = ./docs/css
all: build watch
build: sass coffee
@cp -r ${BUILD_DIR}/synapse* ${DOCS_DIR}/js
@`which node` bin/r.js -o build.js > /dev/null
dist: clean build optimize
@echo 'Creating a source distributions...'
sass:
@echo 'Compiling Sass...'
@mkdir -p ${CSS_DIR}
@`which sass` --scss --style=compressed ${SASS_DIR}:${CSS_DIR} -r ${SASS_DIR}/bourbon/lib/bourbon.rb --update
coffee:
@echo 'Compiling CoffeeScript...'
@`which coffee` -b -o ${BUILD_DIR} -c ${COFFEE_DIR}
watch: unwatch
@echo 'Watching in the background...'
@`which coffee` -w -b -o ${BUILD_DIR} -c ${COFFEE_DIR} &> /dev/null & echo $$! > ${PID_FILE}
@`which sass` --scss --style=compressed ${SASS_DIR}:${CSS_DIR} \
-r ${SASS_DIR}/bourbon/lib/bourbon.rb --watch &> /dev/null & echo $$! >> ${PID_FILE}
unwatch:
@if [ -f ${PID_FILE} ]; then \
echo 'Watchers stopped'; \
for pid in `cat ${PID_FILE}`; do kill -9 $$pid; done; \
rm ${PID_FILE}; \
fi;
optimize:
@echo 'Optimizing the javascript...'
@mkdir -p ${DIST_DIR}
@`which node` bin/r.js -o build-optimize.js > /dev/null
clean:
@rm -rf ${DIST_DIR}
.PHONY: all sass coffee watch unwatch build optimize clean