makefile should take sql migration files into account for rebuilding binary

This commit is contained in:
Danny 2018-05-30 13:29:07 +02:00
parent 071ea5ace0
commit 72868c5964
1 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,8 @@ LDFLAGS += -extldflags "-static"
MAIN_PKG := ./cmd/fathom MAIN_PKG := ./cmd/fathom
PACKAGES ?= $(shell go list ./... | grep -v /vendor/) PACKAGES ?= $(shell go list ./... | grep -v /vendor/)
JS_SOURCES ?= $(shell find assets/src/. -name "*.js" -type f) JS_SOURCES ?= $(shell find assets/src/. -name "*.js" -type f)
SOURCES ?= $(shell find . -name "*.go" -type f) GO_SOURCES ?= $(shell find . -name "*.go" -type f)
SQL_SOURCES ?= $(shell find . -name "*.sql" -type f)
ENV ?= $(shell export $(cat .env | xargs)) ENV ?= $(shell export $(cat .env | xargs))
.PHONY: all .PHONY: all
@ -17,7 +18,7 @@ install: $(wildcard *.go)
.PHONY: build .PHONY: build
build: $(EXECUTABLE) build: $(EXECUTABLE)
$(EXECUTABLE): $(SOURCES) assets/build $(GOPATH)/bin/packr $(EXECUTABLE): $(GO_SOURCES) $(SQL_SOURCES) assets/build $(GOPATH)/bin/packr
$(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG) $(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG)
dist: assets/dist build/fathom-linux-amd64 dist: assets/dist build/fathom-linux-amd64