Commit 187cf662 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

improve Makefile.

parent fc7f59f8
...@@ -4,18 +4,19 @@ RENDERJS_MIN = renderjs.min.js ...@@ -4,18 +4,19 @@ RENDERJS_MIN = renderjs.min.js
# npm install uglify-js # npm install uglify-js
UGLIFY_CMD = $(shell which uglifyjs || echo node ~/node_modules/uglify-js/bin/uglifyjs) UGLIFY_CMD = $(shell which uglifyjs || echo node ~/node_modules/uglify-js/bin/uglifyjs)
# npm install jslint
LINT_CMD = $(shell which jslint || echo node ~/node_modules/jslint/bin/jslint.js) --terse LINT_CMD = $(shell which jslint || echo node ~/node_modules/jslint/bin/jslint.js) --terse
auto: build auto: build
build: uglify build: uglify
uglify: uglify: $(RENDERJS_MIN)
$(UGLIFY_CMD) "$(RENDERJS)" > "$(RENDERJS_MIN)"
lint: $(RENDERJS_MIN): $(RENDERJS)
$(LINT_CMD) $(RENDERJS) $(UGLIFY_CMD) "$<" > "$@"
clean: lint: $(RENDERJS)
find -name '*~' -delete $(LINT_CMD) "$<"
find -name 'renderjs.min.js' -delete
clean:
rm -f $(RENDERJS_MIN)
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