aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 17 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 452e1d5..754b1e4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
1include config.mk 1include config.mk
2 2
3BINARY_PATH = ./bin
4TARGET = $(BINARY_PATH)/$(NAME)
3IMPORTER_FILES = $(shell find tools/importer/ -type f -name '*.go') 5IMPORTER_FILES = $(shell find tools/importer/ -type f -name '*.go')
4 6
5CSS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/css/ -type f -name '*.css')) 7CSS_FILES = $(patsubst assets_src/%, assets/%, $(shell find assets_src/css/ -type f -name '*.css'))
@@ -12,7 +14,7 @@ LESSC := ./node_modules/less/bin/lessc
12 14
13-include $(DEPFILES) 15-include $(DEPFILES)
14 16
15all: $(CSS_FILES) $(LESS_FILES) $(JS_FILES) eventlogging/events.go 17all: assets $(TARGET) $(IMPORTER)
16 18
17print_info: 19print_info:
18 @echo $(CSS_FILES) 20 @echo $(CSS_FILES)
@@ -20,6 +22,11 @@ print_info:
20 @echo $(JS_FILES) 22 @echo $(JS_FILES)
21 @echo $(DEPFILES) 23 @echo $(DEPFILES)
22 24
25$(NAME): $(TARGET)
26
27$(TARGET): eventlogging/events.go
28 go build -o $@
29
23.npm_update: package.json 30.npm_update: package.json
24 touch $@ 31 touch $@
25 npm install 32 npm install
@@ -27,7 +34,9 @@ print_info:
27package.json: package.json.tpl config.mk 34package.json: package.json.tpl config.mk
28 export NAME=$(NAME) &&\ 35 export NAME=$(NAME) &&\
29 export VERSION=$(VERSION) &&\ 36 export VERSION=$(VERSION) &&\
30 ./bin/template.awk < $< | sh > $@ 37 $(BINARY_PATH)/template.awk < $< | sh > $@
38
39assets: $(CSS_FILES) $(LESS_FILES) $(JS_FILES)
31 40
32assets/css/%.css: assets_src/css/%.css 41assets/css/%.css: assets_src/css/%.css
33 @mkdir -p $(@D) 42 @mkdir -p $(@D)
@@ -39,16 +48,17 @@ assets/css/%.css: assets_src/css/%.less .npm_update
39 @$(LESSC) $< > $@ 48 @$(LESSC) $< > $@
40 49
41assets_src/js/%.d: assets_src/js/%.js 50assets_src/js/%.d: assets_src/js/%.js
42 @./bin/generate-dependencies $(patsubst assets_src/%, assets/%, $<) $< $@ 51 @$(BINARY_PATH)/generate-dependencies $(patsubst assets_src/%, assets/%, $<) $< $@
43 52
44assets/js/%.js: assets_src/js/%.js assets_src/js/%.d .babelrc .npm_update 53assets/js/%.js: assets_src/js/%.js assets_src/js/%.d .babelrc .npm_update
45 @echo browserify $< -o $@ 54 @echo browserify $< -o $@
46 @$(BROWSERIFY) --debug $< -o $@ -t babelify 55 @$(BROWSERIFY) --debug $< -o $@ -t babelify
47 56
48eventlogging/events.go: eventlogging/events.txt 57eventlogging/events.go: eventlogging/events.txt
49 @./bin/generate-events < $< > $@ 58 ./bin/generate-events < $< > $@
50 59
51clean: 60clean:
61 -rm -- $(BINARY_PATH)/$(NAME)
52 -rm -- $(CSS_FILES) 62 -rm -- $(CSS_FILES)
53 -rm -- $(LESS_FILES) 63 -rm -- $(LESS_FILES)
54 -rm -- $(JS_FILES) 64 -rm -- $(JS_FILES)
@@ -63,11 +73,11 @@ superclean: clean
63ultraclean: superclean 73ultraclean: superclean
64 -rm -r -- node_modules 74 -rm -r -- node_modules
65 75
66run: all 76run: assets $(TARGET)
67 go run *.go 77 $(TARGET)
68 78
69importer: $(IMPORTER_FILES) 79importer: $(IMPORTER_FILES)
70 go build -o importer tools/importer/*.go 80 go build -o importer tools/importer/*.go
71 81
72.PHONY: all print_info clean superclean ultraclean run 82.PHONY: all assets $(NAME) $(TARGET) print_info clean superclean ultraclean run
73 83