forked from mathquill/mathquill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (52 loc) · 1.4 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
57
58
59
60
SOURCE_DIR = src
FILES = \
${SOURCE_DIR}/HEADER \
${SOURCE_DIR}/intro.js \
${SOURCE_DIR}/baseclasses.js \
${SOURCE_DIR}/rootelements.js \
${SOURCE_DIR}/commands.js \
${SOURCE_DIR}/symbols.js \
${SOURCE_DIR}/cursor.js \
${SOURCE_DIR}/publicapi.js \
${SOURCE_DIR}/outro.js
BUILD_DIR = ./build
BUILD_FILE = ${BUILD_DIR}/mathquill.js
MINIFIED_BUILD_FILE = ${BUILD_DIR}/mathquill.min.js
all: cat minify
cat:
[ -d "${BUILD_DIR}" ] || mkdir "${BUILD_DIR}"
cat ${FILES} > "${BUILD_FILE}"
minify: cat
which uglifyjs >/dev/null && \
uglifyjs "${BUILD_FILE}" > "${MINIFIED_BUILD_FILE}"
publish:
[ "`git symbolic-ref -q HEAD`" = "refs/heads/fancyeditor" ] || ( \
echo "err: Please check out fancyeditor first." >&2; exit 1 \
)
make minify
cp mathquill.css build/mathquill.css
git stash
git checkout gh-pages
git pull origin gh-pages
cp build/* .
cp build/*.js dev
sed 's:url(:url(../:g' build/mathquill.css > dev/mathquill.css
rm build/mathquill.css
git commit -a -m "publish new mathquill.{js, css}"
git push origin gh-pages
git checkout -
git stash pop
publish-dev: cat minify
cp mathquill.css build/mathquill.css
git stash
git checkout gh-pages
git pull origin gh-pages
cp build/*.js dev
sed 's:url(:url(../:g' build/mathquill.css > dev/mathquill.css
rm build/mathquill.css
git commit -a -m "publish new dev/mathquill.{js, css}"
git push origin gh-pages
git checkout -
git stash pop
lol:
@@echo "LOL!"