forked from pvdspek/jquery.autoellipsis
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
47 lines (30 loc) · 844 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
PROJECT = jquery.autoellipsis
SOURCEDIR = src
DISTDIR = dist
UGLIFY ?= `which uglifyjs`
BASEFILES = ${SOURCEDIR}/${PROJECT}.js
VERSION = ${shell cat version.txt}
DISTFILE = ${DISTDIR}/${PROJECT}-${VERSION}.js
DISTMINFILE = ${DISTDIR}/${PROJECT}-${VERSION}.min.js
all: build minify jsdoc
clean:
@@rm -rf ${DISTDIR}
build: ${DISTFILE}
minify: build ${DISTMINFILE}
jsdoc: ${DISTJSDOC}
${DISTDIR}:
@@mkdir -p ${DISTDIR}
${DISTFILE}: ${BASEFILES} | ${DISTDIR}
@@echo "Building" ${DISTFILE};
@@cat ${BASEFILES} \
> ${DISTFILE};
${DISTMINFILE}: uglifyavailable ${DISTFILE}
@@echo "Minifying" ${DISTMINFILE};
@@ ${UGLIFY} ${DISTFILE} > ${DISTMINFILE};
uglifyavailable:
@@if test -z ${UGLIFY}; then \
echo "You must have UglifyJS installed"; \
echo " install with:"; \
echo " npm install uglify-js"; \
exit 1; \
fi