From f1a85e7d01231eaef650aa737962e0d1ec358df2 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 15 May 2018 14:41:08 +0200 Subject: [PATCH] move gulp into build task to ensure latest assets are packrd --- Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b00eebc..2300580 100644 --- a/Makefile +++ b/Makefile @@ -3,26 +3,24 @@ EXECUTABLE := fathom LDFLAGS += -extldflags "-static" MAIN_PKG := ./cmd/fathom PACKAGES ?= $(shell go list ./... | grep -v /vendor/) +JS_SOURCES ?= $(shell find assets/. -name "*.js" -type f) SOURCES ?= $(shell find . -name "*.go" -type f) ENV ?= $(shell export $(cat .env | xargs)) .PHONY: all -all: assets build +all: build .PHONY: install install: $(wildcard *.go) - packr install $(MAIN_PKG) + packr install -v -ldflags '-w $(LDFLAGS)' $(MAIN_PKG) .PHONY: build build: $(EXECUTABLE) -$(EXECUTABLE): $(SOURCES) - packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG) - -.PHONY: assets -assets: +$(EXECUTABLE): $(SOURCES) $(JS_SOURCES) if [ ! -d "node_modules" ]; then npm install; fi - gulp + gulp + packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG) .PHONY: docker docker: