diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-05-05 20:03:47 -0400 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2011-05-05 20:03:47 -0400 |
commit | 8d66a56b9169f0ad8fe67e68a030e7c121bdb88f (patch) | |
tree | 60ecb6d2832be8105d4a9948b49e69500cd95453 /web/Makefile | |
parent | Compare by name if dates are the same. (diff) | |
download | PhotoFloat-8d66a56b9169f0ad8fe67e68a030e7c121bdb88f.tar.xz PhotoFloat-8d66a56b9169f0ad8fe67e68a030e7c121bdb88f.zip |
Add stump of web project.
Diffstat (limited to 'web/Makefile')
-rw-r--r-- | web/Makefile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/web/Makefile b/web/Makefile new file mode 100644 index 0000000..5885fa3 --- /dev/null +++ b/web/Makefile @@ -0,0 +1,35 @@ +JS_DIR = js +CSS_DIR = css + +JS_MIN = $(JS_DIR)/scripts.min.js +CSS_MIN = $(CSS_DIR)/styles.min.css + +JS_MIN_FILES := $(patsubst %.js, %.min.js, $(filter-out %.min.js, $(wildcard $(JS_DIR)/*.js))) +CSS_MIN_FILES := $(patsubst %.css, %.min.css, $(filter-out %.min.css, $(wildcard $(CSS_DIR)/*.css))) + +JS_COMPILER = utils/google-compiler --warning_level QUIET +CSS_COMPILER = utils/yuicompressor --type css + +.PHONY: all clean + +all: $(JS_MIN) $(CSS_MIN) + +%.min.js: %.js + @echo "Compiling javascript" $< + @$(JS_COMPILER) --js $< --js_output_file $@ + +%.min.css: %.css + @echo "Compiling stylesheet" $< + @$(CSS_COMPILER) -o $@ $< + +$(JS_MIN): $(JS_MIN_FILES) + @echo "Assembling compiled javascripts" + @cat $^ > $@ + +$(CSS_MIN): $(CSS_MIN_FILES) + @echo "Assembling compiled stylesheets" + @cat $^ > $@ + +clean: + @rm -fv $(JS_MIN) $(JS_MIN_FILES) $(CSS_MIN) $(CSS_MIN_FILES) + |