Fix makefile

- Exclude files in cmd/ when looking for sources.
- Explicitly build cmd/server.go and cmd/generate.go separately.
- Add bin/generate recipe.
This commit is contained in:
Zorchenhimer 2021-02-13 12:02:41 -05:00
parent eeba54808b
commit 143712cffd
1 changed files with 10 additions and 10 deletions

View File

@ -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/