Commit 322fc688 authored by Tristan Cavelier's avatar Tristan Cavelier

Makefile improved

parent db517423
OUT = jio.js OUT = jio.js
UGLY_OUT = jio.min.js UGLY_OUT = jio.min.js
LINT_CMD = jslint --terse --indent 2 --maxlen 80 LINT_CMD = jslint --terse
UGLIFY_CMD = uglifyjs UGLIFY_CMD = uglifyjs
FILE_DIR = src/jio FILE_DIR = src/jio
STORAGE_DIR = src/jio.storage STORAGE_DIR = src/jio.storage
...@@ -23,13 +23,12 @@ uglify: ...@@ -23,13 +23,12 @@ uglify:
# lint all files in FILES and STORAGE_FILES # lint all files in FILES and STORAGE_FILES
# command: jslint [options] file # command: jslint [options] file
# [options] are defined in the source file: # [options] are defined at the top of the source file:
# The file can contain a line beginning by: # Example:
# // -*- jslint: [options] -*- # /*jslint indent: 2, maxlen: 80 */
# If there is several such lines, only the first is used. Example: # /*global hex_sha256: true, jQuery: true */
# // -*- jslint: --sloppy --maxlen 80 --predef hex_sha256 -*-
lint: lint:
bash -c "result=0 ; for file in $(LINT_FILES:%=$(FILE_DIR)/%.js) $(STORAGE_FILES:%=$(STORAGE_DIR)/%.js) ; do out=\"\$$($(LINT_CMD) \$$(grep '^// *-\*- *jslint: .* -\*-' \$$file | head -1 | sed 's/^\/\/ *-\*- *jslint: \(.*\) -\*-/\1/') \$$file)\" ; res=\$$? ; [ \$$res != 0 ] && echo \"\$$out\" ; [ \$$res -gt \$$result ] && result=\$$res ; done ; exit \$$result ;" $(LINT_CMD) -- $(LINT_FILES:%=$(FILE_DIR)/%.js)
.phony: clean .phony: clean
clean: clean:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment