-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
77 lines (55 loc) · 1.8 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Copied over from Jim Smith's copy of MITHGrid
# based on the Makefile for jquery
SRC_DIR = src
TEST_DIR = test
BUILD_DIR = build
PREFIX = .
DIST_DIR = ${PREFIX}/dist
JS_ENGINE ?= `which node nodejs`
COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
BASE_FILES = ${SRC_DIR}/controllers.js \
${SRC_DIR}/register.js \
MG = ${DIST_DIR}/annoclient.js
MG_MIN = ${DIST_DIR}/annoclient.min.js
MG_VER = $(shell cat version.txt)
VER = sed "s/@VERSION/${MG_VER}/"
DATE=$(shell git log --pretty=format:%ad | head -1)
all: core
core: annoclient min lint
@@echo "annoclient build complete"
${DIST_DIR}:
@@mkdir -p ${DIST_DIR}
annoclient: ${MG}
#| \
#sed 's/.function....MITHGrid..{//' | \
#sed 's/}..jQuery..MITHGrid.;//' > ${MG}.tmp;
${MG}: ${DIST_DIR} ${SRC_DIR}/intro.js ${BASE_FILES} ${SRC_DIR}/outro.js
@@echo "Building" ${MG}
@@cat ${BASE_FILES} > ${MG}.tmp
@@cat ${SRC_DIR}/intro.js ${MG}.tmp ${SRC_DIR}/outro.js | \
sed 's/@DATE/'"${DATE}"'/' | \
${VER} > ${MG};
@@rm -f ${MG}.tmp;
lint: annoclient
@@if test ! -z ${JS_ENGINE}; then \
echo "Checking annoclient code against JSLint..."; \
${JS_ENGINE} build/jslint-check.js; \
else \
echo "You must have NodeJS installed in order to test annoclient against JSLint."; \
fi
min: annoclient ${MG_MIN}
${MG_MIN}: ${MG}
@@if test ! -z ${JS_ENGINE}; then \
echo "Minifying annoclient" ${MG_MIN}; \
${COMPILER} ${MG} > ${MG_MIN}.tmp; \
${POST_COMPILER} ${MG_MIN}.tmp > ${MG_MIN}; \
rm -f ${MG_MIN}.tmp; \
else \
echo "You must have NodeJS installed in order to minify OAC VideoAnnotator."; \
fi
clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}
@@rm -rf ${DIST_DIR}
distclean: clean
.PHONY: all annoclient lint min clean distclean core