forked from arshaw/xdate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (26 loc) · 784 Bytes
/
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
SRC_DIR = src
BUILD_DIR = build
DIST_DIR = dist
DEVELOPMENT_FILE = xdate.dev.js
PRODUCTION_FILE = xdate.js
VERSION = `cat version.txt`
VERSION_SED = sed s/@VERSION/"${VERSION}"/
DATE = `git log -1 --pretty=format:%ad`
DATE_SED = sed s/@DATE/"${DATE}"/
xdate:
@rm -f ${BUILD_DIR}/xdate*.js
@cat ${SRC_DIR}/xdate.js \
| ${VERSION_SED} \
| ${DATE_SED} \
> ${BUILD_DIR}/${DEVELOPMENT_FILE}
@java -jar ${BUILD_DIR}/compiler.jar \
--warning_level VERBOSE \
--jscomp_off checkTypes \
--externs ${BUILD_DIR}/externs.js \
--js ${BUILD_DIR}/${DEVELOPMENT_FILE} \
> ${BUILD_DIR}/${PRODUCTION_FILE}
@mkdir -p ${DIST_DIR}
@mv ${BUILD_DIR}/${PRODUCTION_FILE} ${BUILD_DIR}/${DEVELOPMENT_FILE} ${DIST_DIR}
clean:
@rm -f ${BUILD_DIR}/xdate*.js
@rm -f ${DIST_DIR}/xdate*.js