From 143712cffdda648d43f692865a8421a5a76d89b7 Mon Sep 17 00:00:00 2001 From: Zorchenhimer Date: Sat, 13 Feb 2021 12:02:41 -0500 Subject: [PATCH] Fix makefile - Exclude files in cmd/ when looking for sources. - Explicitly build cmd/server.go and cmd/generate.go separately. - Add bin/generate recipe. --- Makefile | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 616340a..f366a5b 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ -#SOURCES= *.go \ -# api/*.go \ -# business/*.go \ -# cmd/*.go \ -# database/*.go \ -# frontend/*.go \ -# models/*.go +SOURCES=$(shell find . -not -path "./cmd/*" -type f -name "*.go") -SOURCES=$(shell find . -type f -name "*.go") +all: bin/server bin/generate -bin/server: bin/ $(SOURCES) - go build -o bin/server cmd/server.go +bin/server: cmd/server.go bin/ $(SOURCES) + go build -o bin/server $< + +bin/generate: cmd/generate.go bin/ $(SOURCES) + go build -o bin/server $< bin/: mkdir -p bin + +clean: + rm -rf bin/