Permalink
Browse files

Improve client build

  • Loading branch information...
brettstimmerman committed Apr 6, 2012
1 parent fc982c4 commit ea1e844124c0e64e705fe4eadbe8709747a67e40
Showing with 15 additions and 12 deletions.
  1. +15 −12 Makefile
View
@@ -1,26 +1,29 @@
-CLIENT = release/temple-min.js
-GRAMMAR = src/temple.y
-LEXER = src/temple.l
-PARSER = lib/temple/parser.js
+CLIENT = release/temple.js
+CLIENT_MIN = release/temple-min.js
+GRAMMAR = src/temple.y
+LEXER = src/temple.l
+PARSER = lib/temple/parser.js
all: parser client
parser:
@jison $(GRAMMAR) $(LEXER) -m commonjs
@mv temple.js $(PARSER)
-clean:
- rm -f $(PARSER) $(PARSER).client $(CLIENT)
-
-client:
+parser-client:
@jison $(GRAMMAR) $(LEXER) -m js
@mv temple.js $(PARSER).client
- @node scripts/build_client.js | uglifyjs > $(CLIENT)
+
+clean:
+ rm -f $(PARSER) $(PARSER).client release/*
+
+client: parser-client
+ @node scripts/build_client.js > $(CLIENT)
+ @cat $(CLIENT) | uglifyjs > $(CLIENT_MIN)
size: client
- @cat $(CLIENT) | wc -c
- @gzip -c6 $(CLIENT) | wc -c
- @make clean
+ @cat $(CLIENT_MIN) | wc -c
+ @gzip -c6 $(CLIENT_MIN) | wc -c
lint:
@jshint .

0 comments on commit ea1e844

Please sign in to comment.