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