aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 43b5fd9..269e68e 100644
--- a/Makefile
+++ b/Makefile
@@ -3,11 +3,12 @@ include config.mk
3CSS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/css/ -type f -name '*.css')) 3CSS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/css/ -type f -name '*.css'))
4LESS_FILES = $(patsubst assets_src/%.less, assets/%.css, $(shell find assets_src/css/ -type f -name '*.less')) 4LESS_FILES = $(patsubst assets_src/%.less, assets/%.css, $(shell find assets_src/css/ -type f -name '*.less'))
5JS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/js/ -maxdepth 1 -type f -name '*.js')) 5JS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/js/ -maxdepth 1 -type f -name '*.js'))
6DEPFILES = $(patsubst assets/%, assets_src/%, $(JS_FILES:.js=.d))
6 7
7BROWSERIFY := ./node_modules/browserify/bin/cmd.js 8BROWSERIFY := ./node_modules/browserify/bin/cmd.js
8LESSC := ./node_modules/less/bin/lessc 9LESSC := ./node_modules/less/bin/lessc
9 10
10rewrite_imports = "s/(require\([\"'])lib/\1.\/lib/g" 11-include $(DEPFILES)
11 12
12all: .npm_update $(CSS_FILES) $(LESS_FILES) $(JS_FILES) 13all: .npm_update $(CSS_FILES) $(LESS_FILES) $(JS_FILES)
13 14
@@ -15,6 +16,7 @@ print_info:
15 @echo $(CSS_FILES) 16 @echo $(CSS_FILES)
16 @echo $(LESS_FILES) 17 @echo $(LESS_FILES)
17 @echo $(JS_FILES) 18 @echo $(JS_FILES)
19 @echo $(DEPFILES)
18 20
19.npm_update: package.json 21.npm_update: package.json
20 touch $@ 22 touch $@
@@ -34,7 +36,10 @@ assets/css/%.css: assets_src/css/%.less
34 @echo lessc $< > $@ 36 @echo lessc $< > $@
35 @$(LESSC) $< > $@ 37 @$(LESSC) $< > $@
36 38
37assets/js/%.js: assets_src/js/%.js .babelrc 39assets_src/js/%.d: assets_src/js/%.js
40 @./bin/generate-dependencies $(patsubst assets_src/%, assets/%, $<) $< $@
41
42assets/js/%.js: assets_src/js/%.js assets_src/js/%.d .babelrc
38 @echo browserify $< -o $@ 43 @echo browserify $< -o $@
39 @$(BROWSERIFY) --debug $< -o $@ -t babelify 44 @$(BROWSERIFY) --debug $< -o $@ -t babelify
40 45
@@ -42,6 +47,7 @@ clean:
42 -rm -- $(CSS_FILES) 47 -rm -- $(CSS_FILES)
43 -rm -- $(LESS_FILES) 48 -rm -- $(LESS_FILES)
44 -rm -- $(JS_FILES) 49 -rm -- $(JS_FILES)
50 -rm -- $(DEPFILES)
45 51
46superclean: clean 52superclean: clean
47 -rm -- .npm_last_update 53 -rm -- .npm_last_update