-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·64 lines (55 loc) · 1.54 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
YEAR = $(shell date +%Y)
DATE = $(shell date +%I:%M%p)
CHECK = \033[32m✔\033[39m
HR = \#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#\#
#
# BUILD
#
build: build_start jslint build_js build_end
#
# RUN LINT AND UNIT TESTS
# jshint & phantomjs are required
#
jslint:
@jshint ./jquery.external_links.js --config ./.jshintrc
@echo "Running JSHint on JS... ${CHECK} Done"
test: jslint
@node test/server.js &
@sleep 1
@$$( \
phantomjs test/phantom.js "http://localhost:3000/test/index.html"; \
TEST_EXIT_STATUS="$$?"; \
kill -9 `cat ./test/pid.txt`; \
rm test/pid.txt; \
exit $$TEST_EXIT_STATUS \
)
@echo "Running qUnit tests... ${CHECK} Done"
#
# VARIOUS BUILD STEPS
# recess & uglifyjs are required
#
build_start:
@echo "\n"
@echo "Starting build ..."
@echo "${HR}\n"
build_end:
@echo "\n${HR}"
@echo "Successfully built on ${DATE}."
@echo "\n"
build_js:
# remove anything from a previous build
@rm -rf ./jquery.external_links.min.js
@echo "Removing existing minified JS... ${CHECK} Done"
# gen minified versions of JS files
@uglifyjs -nc ./jquery.external_links.js > ./jquery.external_links.min.js
@echo "Compiling and minifying JS... ${CHECK} Done"
#
# WATCH LESS & JS FILES
#
watch:
@echo "Watching files ..."; \
watchr build.watchr
#
# Makefile phonies ... see http://www.gnu.org/savannah-checkouts/gnu/make/manual/html_node/Phony-Targets.html
#
.PHONY: watch jslint build_start build_end build_js