aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorrtz12 <koenig@fagott.pw>2016-01-20 18:34:19 (UTC)
committerrtz12 <koenig@fagott.pw>2016-01-20 18:34:19 (UTC)
commit5325336ea46e4347f4ca12d4daaeec6269ce6c7b (patch)
treee608e0eecc6da33aa23fd7811c2e488cfe22ce5d /Makefile
parent94da9601d1d17ddeaf1d7d5ea8df68008e90f3ab (diff)
Buildsystem verfeinert
Dafuer JS temporaer kaputtgemacht
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile53
1 files changed, 41 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 109242b..26ba81f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,29 +1,58 @@
1CSS_FILES := $(shell find assets_src/css/ -maxdepth 1 -type f -name '*.css') 1include config.mk
2CSS_FILES := $(addprefix assets/, $(CSS_FILES:assets_src/%=%))
3LESS_FILES := $(shell find assets_src/css/ -maxdepth 1 -type f -name '*.less')
4LESS_FILES := $(addprefix assets/, $(LESS_FILES:assets_src/%=%))
5LESS_FILES := $(LESS_FILES:.less=.css)
6JS_FILES := $(shell find assets_src/js/ -maxdepth 1 -type f -name '*.js')
7JS_FILES := $(addprefix assets/, $(JS_FILES:assets_src/%=%))
8 2
9all: $(CSS_FILES) $(LESS_FILES) $(JS_FILES) 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'))
5JS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/js/ -maxdepth 1 -type f -name '*.js'))
6
7BROWSERIFY := ./node_modules/browserify/bin/cmd.js
8LESSC := ./node_modules/less/bin/lessc
9
10rewrite_imports = "s/(require\([\"'])lib/\1.\/lib/g"
11
12all: .npm_update $(CSS_FILES) $(LESS_FILES) $(JS_FILES)
13
14print_info:
15 @echo $(CSS_FILES)
16 @echo $(LESS_FILES)
17 @echo $(JS_FILES)
18
19.npm_update: package.json
20 touch $@
21 npm install
22
23package.json: package.json.tpl config.mk
24 export NAME=$(NAME) &&\
25 export VERSION=$(VERSION) &&\
26 ./bin/template.awk < $< | sh > $@
10 27
11assets/css/%.css: assets_src/css/%.css 28assets/css/%.css: assets_src/css/%.css
29 @mkdir -p $(@D)
12 cp $< $@ 30 cp $< $@
13 31
14assets/css/%.css: assets_src/css/%.less 32assets/css/%.css: assets_src/css/%.less
15 lessc $< > $@ 33 mkdir -p $(@D)
34 @echo lessc $< > $@
35 @$(LESSC) $< > $@
16 36
17assets/js/%.js: assets_src/js/%.js 37assets/js/%.js: assets_src/js/%.js .babelrc
18 babel $< -o $@ 38 @echo browserify $< -o $@
39 @$(BROWSERIFY) --debug $< -o $@ -t babelify
19 40
20clean: 41clean:
21 -rm -- $(CSS_FILES) 42 -rm -- $(CSS_FILES)
22 -rm -- $(LESS_FILES) 43 -rm -- $(LESS_FILES)
23 -rm -- $(JS_FILES) 44 -rm -- $(JS_FILES)
45 -rm -r -- .jsobj
46
47superclean: clean
48 -rm -- .npm_last_update
49 -rm -- package.json
50
51ultraclean: superclean
52 -rm -r -- node_modules
24 53
25run: all 54run: all
26 go run *.go 55 go run *.go
27 56
28.PHONY: all clear run 57.PHONY: all print_info clean superclean ultraclean run
29 58