diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..50d02c1 --- /dev/null +++ b/Makefile | |||
@@ -0,0 +1,29 @@ | |||
1 | CSS_FILES := $(shell find assets_src/css/ -maxdepth 1 -type f -name '*.css') | ||
2 | CSS_FILES := $(addprefix assets/, $(CSS_FILES:assets_src/%=%)) | ||
3 | LESS_FILES := $(shell find assets_src/css/ -maxdepth 1 -type f -name '*.less') | ||
4 | LESS_FILES := $(addprefix assets/, $(LESS_FILES:assets_src/%=%)) | ||
5 | LESS_FILES := $(LESS_FILES:.less=.css) | ||
6 | JS_FILES := $(shell find assets_src/js/ -maxdepth 1 -type f -name '*.js') | ||
7 | JS_FILES := $(addprefix assets/, $(JS_FILES:assets_src/%=%)) | ||
8 | |||
9 | all: $(CSS_FILES) $(LESS_FILES) $(JS_FILES) | ||
10 | |||
11 | assets/css/%.css: assets_src/css/%.css | ||
12 | cp $< $@ | ||
13 | |||
14 | assets/js/%.css: assets_src/css/%.less | ||
15 | lessc $< > $@ | ||
16 | |||
17 | assets/js/%.js: assets_src/css/%.js | ||
18 | babel $< -o $@ | ||
19 | |||
20 | clean: | ||
21 | -rm -- $(CSS_FILES) | ||
22 | -rm -- $(LESS_FILES) | ||
23 | -rm -- $(JS_FILES) | ||
24 | |||
25 | run: all | ||
26 | go run *.go | ||
27 | |||
28 | .PHONY: all clear run | ||
29 | |||