From 8708873a6e85ed2cc729283e6f2b1004f367541f Mon Sep 17 00:00:00 2001 From: Slava Bacherikov Date: Sat, 16 Jul 2016 23:42:53 +0300 Subject: [PATCH] Update build scripts --- .gitignore | 1 - Makefile | 26 +++++++++++++++++++++----- hero.html => index.html | 0 3 files changed, 21 insertions(+), 6 deletions(-) rename hero.html => index.html (100%) diff --git a/.gitignore b/.gitignore index 063ade4..8dbf586 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -index.html .*.sw[po] *.bak upload/ diff --git a/Makefile b/Makefile index 4bc7215..2e2c722 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,26 @@ +.PHONY: clean -COMPILE_COMMAND = closure-compiler +COMPILE_COMMAND ?= closure-compiler +UPLOAD_DIR = upload -JS_FILES = $(filter-out %.min.js, $(wildcard *.js)) -COMPILED_JS_FILES = $(JS_FILES:%.js=%.min.js) +JS_FILES = $(wildcard *.js) +COMPILED_JS_FILES = $(JS_FILES:%.js=$(UPLOAD_DIR)/%.min.js) -%.min.js: %.js +INDEX_FILE = index.html + +all: $(UPLOAD_DIR) $(UPLOAD_DIR)/index.html $(COMPILED_JS_FILES) $(UPLOAD_DIR)/bootstrap.min.css + +$(UPLOAD_DIR)/%.min.js: %.js $(UPLOAD_DIR) $(COMPILE_COMMAND) $< --js_output_file $@ -all: $(COMPILED_JS_FILES) +$(UPLOAD_DIR)/index.html: $(INDEX_FILE) $(UPLOAD_DIR) + cp "$<" "$@" + +$(UPLOAD_DIR)/%.css: %.css + cp "$<" "$@" + +$(UPLOAD_DIR): + mkdir "$(UPLOAD_DIR)" + +clean: + @$(RM) -r $(UPLOAD_DIR) diff --git a/hero.html b/index.html similarity index 100% rename from hero.html rename to index.html