-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (39 loc) · 1.08 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
SRC_DIR = src/mass
BUILD_DIR = build
PREFIX = .
DIST_DIR = ${PREFIX}/dist
JAVA_ENGINE ?= `which java`
PYTHON_ENGINE ?= `which python`
COMPILER = ${JAVA_ENGINE} -jar ${BUILD_DIR}/compiler.jar
MASS = ${DIST_DIR}/mass.js
MASS_MIN = ${DIST_DIR}/mass.min.js
#get version
MASS_VER = $(shell cat version.txt)
VERSION = sed "s/@VERSION/${MASS_VER}/"
DATE = $(shell git log -l --pretty=format:%ad)
${DIST_DIR}:
@@mkdir -p ${DIST_DIR}
mass: $(MASS)
all: update_submodules minfiles
build: ${MASS}
${MASS}: clean ${DIST_DIR}
@@if test ! -z ${PYTHON_ENGINE}; then \
${PYTHON_ENGINE} packager.py; \
fi
${MASS_MIN}: ${MASS}
@@if test ! -z ${JAVA_ENGINE}; then \
echo "Minifying " ${MASS_MIN}; \
${COMPILER} --jscomp_off=internetExplorerChecks --js ${MASS} --js_output_file ${MASS_MIN}; \
fi
min: ${MASS_MIN}
update_submodules:
@if [ -d .git ]; then\
if git submodule status | grep -q -E -i '^-'; then \
git submodule update --init --recursive; \
else \
git submodule update --init --recursive --merge; \
fi; \
fi
clean:
@@echo "Removing Dist dir:" ${DIST_DIR}
@@rm -rf ${DIST_DIR}