From 72868c5964d34bc7532f5058b7f1e7e8dd99c6a2 Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 30 May 2018 13:29:07 +0200 Subject: [PATCH] makefile should take sql migration files into account for rebuilding binary --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e96b85e..34583b5 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,8 @@ LDFLAGS += -extldflags "-static" MAIN_PKG := ./cmd/fathom PACKAGES ?= $(shell go list ./... | grep -v /vendor/) 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)) .PHONY: all @@ -17,7 +18,7 @@ install: $(wildcard *.go) .PHONY: build 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) dist: assets/dist build/fathom-linux-amd64