diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -3,11 +3,12 @@ include config.mk | |||
3 | CSS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/css/ -type f -name '*.css')) | 3 | CSS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/css/ -type f -name '*.css')) |
4 | LESS_FILES = $(patsubst assets_src/%.less, assets/%.css, $(shell find assets_src/css/ -type f -name '*.less')) | 4 | LESS_FILES = $(patsubst assets_src/%.less, assets/%.css, $(shell find assets_src/css/ -type f -name '*.less')) |
5 | JS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/js/ -maxdepth 1 -type f -name '*.js')) | 5 | JS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/js/ -maxdepth 1 -type f -name '*.js')) |
6 | DEPFILES = $(patsubst assets/%, assets_src/%, $(JS_FILES:.js=.d)) | ||
6 | 7 | ||
7 | BROWSERIFY := ./node_modules/browserify/bin/cmd.js | 8 | BROWSERIFY := ./node_modules/browserify/bin/cmd.js |
8 | LESSC := ./node_modules/less/bin/lessc | 9 | LESSC := ./node_modules/less/bin/lessc |
9 | 10 | ||
10 | rewrite_imports = "s/(require\([\"'])lib/\1.\/lib/g" | 11 | -include $(DEPFILES) |
11 | 12 | ||
12 | all: .npm_update $(CSS_FILES) $(LESS_FILES) $(JS_FILES) | 13 | all: .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 | ||
37 | assets/js/%.js: assets_src/js/%.js .babelrc | 39 | assets_src/js/%.d: assets_src/js/%.js |
40 | @./bin/generate-dependencies $(patsubst assets_src/%, assets/%, $<) $< $@ | ||
41 | |||
42 | assets/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 | ||
46 | superclean: clean | 52 | superclean: clean |
47 | -rm -- .npm_last_update | 53 | -rm -- .npm_last_update |