From f9c8526a4f11e075b4a9a506b246605e6dae1436 Mon Sep 17 00:00:00 2001 From: jan Date: Tue, 11 Oct 2016 15:59:52 +0200 Subject: Makefile 'app' target diff --git a/Makefile b/Makefile index fbef6fa..9206ed2 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ include config.mk +BINARY_PATH=./bin +APP_NAME=grilist IMPORTER_FILES = $(shell find tools/importer/ -type f -name '*.go') 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 -include $(DEPFILES) -all: $(CSS_FILES) $(LESS_FILES) $(JS_FILES) +all: assets app print_info: @echo $(CSS_FILES) @@ -20,6 +22,9 @@ print_info: @echo $(JS_FILES) @echo $(DEPFILES) +app: + go build -o $(BINARY_PATH)/$(APP_NAME) + .npm_update: package.json touch $@ npm install @@ -27,7 +32,9 @@ print_info: package.json: package.json.tpl config.mk export NAME=$(NAME) &&\ export VERSION=$(VERSION) &&\ - ./bin/template.awk < $< | sh > $@ + $(BINARY_PATH)/template.awk < $< | sh > $@ + +assets: $(CSS_FILES) $(LESS_FILES) $(JS_FILES) assets/css/%.css: assets_src/css/%.css @mkdir -p $(@D) @@ -39,13 +46,14 @@ assets/css/%.css: assets_src/css/%.less .npm_update @$(LESSC) $< > $@ assets_src/js/%.d: assets_src/js/%.js - @./bin/generate-dependencies $(patsubst assets_src/%, assets/%, $<) $< $@ + @$(BINARY_PATH)/generate-dependencies $(patsubst assets_src/%, assets/%, $<) $< $@ assets/js/%.js: assets_src/js/%.js assets_src/js/%.d .babelrc .npm_update @echo browserify $< -o $@ @$(BROWSERIFY) --debug $< -o $@ -t babelify clean: + -rm -- $(BINARY_PATH)/$(APP_NAME) -rm -- $(CSS_FILES) -rm -- $(LESS_FILES) -rm -- $(JS_FILES) @@ -59,11 +67,11 @@ superclean: clean ultraclean: superclean -rm -r -- node_modules -run: all +run: assets go run *.go importer: $(IMPORTER_FILES) go build -o importer tools/importer/*.go -.PHONY: all print_info clean superclean ultraclean run +.PHONY: all assets app print_info clean superclean ultraclean run -- cgit v0.10.1