1 # Copyright (c) 2013-2014 IndexData ApS. http://indexdata.com
3 # For running on Mike's local install of node.js
4 MIKE = PATH=$$PATH:/usr/local/lib/node-v0.10.24-linux-x64/bin
6 #PHANTOMJS_URL=https://mkws-dev.indexdata.com/jasmine-popup.html
7 PHANTOMJS_URL=http://localhost:4040/jasmine-local-popup.html
11 JASMINE_NODE= ./node_modules/jasmine-node/bin/jasmine-node
12 PHANTOMJS= ./node_modules/phantomjs/bin/phantomjs
14 SCREENSHOT_WIDTH= 360 480 640 768 1024 1200 1440 2048
15 PERL_SCRIPTS= bin/bomb.pl
17 APACHE_HTTPD:= $(shell env PATH=$$PATH:/usr/sbin which apache2 httpd false)
22 rm -f mkws-error.png mkws-error.html
25 distclean: clean clean-tmp clean-error
27 rm -f ${TMP_DIR}/jasmine-dev
30 rm -f mkws-error.png.* mkws-error.html.*
35 touch ${TMP_DIR}/.gitkeep
37 mkws-complete-syntax-check:
38 ${MAKE} -C../src mkws-complete.min.js
40 check: mkws-complete-syntax-check
41 @if [ ! -e node_modules ]; then echo "please run first: make node-modules"; exit 1; fi
42 ${JASMINE_NODE} --noColor --captureExceptions --forceexit ./spec
47 $(MIKE) jasmine-node --noColor --captureExceptions --forceexit spec
49 phantomjs p: apache-stop apache-start _phantomjs
53 ./bin/bomb.pl --timeout="${PHANTOMJS_TIMEOUT}.5" ${PHANTOMJS} phantom/run-jasmine.js ${PHANTOMJS_URL} ${PHANTOMJS_TIMEOUT}
56 $(MAKE) _phantomjs PHANTOMJS_URL=http://x.example.indexdata.com/jasmine-popup.html
59 ${PHANTOMJS} phantom/screenshot.js ${PHANTOMJS_URL} ${IMAGES}/screenshot.png 1200 1000
62 for i in ${SCREENSHOT_WIDTH}; do \
63 ${PHANTOMJS} phantom/screenshot.js http://mkws.indexdata.com ${IMAGES}/mkws-$$i.png $$i 1000 & \
68 for i in ${SCREENSHOT_WIDTH}; do \
69 ${PHANTOMJS} phantom/screenshot.js http://www.indexdata.com ${IMAGES}/indexdata-$$i.png $$i 1000 & \
73 jsbeautifier jsb indent:
74 for i in package.json ./spec*/*.js ./js/*.js ./phantom/*.js; do \
75 jsbeautifier -j $$i > $@.tmp && mv -f $@.tmp $$i; \
79 @ls ${PERL_SCRIPTS} | xargs -n1 -P16 perl -c 2>/dev/null
80 @ls ${PERL_SCRIPTS} | xargs -n2 -P8 perltidy -b
83 node_modules node-modules:
84 npm install ${NPM_INSTALL_FLAGS}
87 bin/apache-template-update
88 ${APACHE_HTTPD} -f `pwd`/${TMP_DIR}/jasmine-dev
91 @-if [ -e ${TMP_DIR}/mkws-jasmine.pid ]; then \
92 kill `cat ${TMP_DIR}/mkws-jasmine.pid`; \
94 killall apache2 2> /dev/null; \
97 rm -f ${TMP_DIR}/mkws-jasmine.pid
100 @echo "make [ all | check | clean | distclean ]"
101 @echo " [ phantomjs | screenshot ]"
102 @echo " [ jsbeautifier | perltidy ]"
103 @echo " [ node-modules ]"
104 @echo " [ apache-stop apache-start ]"
106 @echo "DEBUG=1 make phantomjs PHANTOMJS_TIMEOUT=12 PHANTOMJS_URL=${PHANTOMJS_URL}"