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:
parent
eeba54808b
commit
143712cffd
20
Makefile
20
Makefile
|
@ -1,16 +1,16 @@
|
||||||
|
|
||||||
#SOURCES= *.go \
|
SOURCES=$(shell find . -not -path "./cmd/*" -type f -name "*.go")
|
||||||
# api/*.go \
|
|
||||||
# business/*.go \
|
|
||||||
# cmd/*.go \
|
|
||||||
# database/*.go \
|
|
||||||
# frontend/*.go \
|
|
||||||
# models/*.go
|
|
||||||
|
|
||||||
SOURCES=$(shell find . -type f -name "*.go")
|
all: bin/server bin/generate
|
||||||
|
|
||||||
bin/server: bin/ $(SOURCES)
|
bin/server: cmd/server.go bin/ $(SOURCES)
|
||||||
go build -o bin/server cmd/server.go
|
go build -o bin/server $<
|
||||||
|
|
||||||
|
bin/generate: cmd/generate.go bin/ $(SOURCES)
|
||||||
|
go build -o bin/server $<
|
||||||
|
|
||||||
bin/:
|
bin/:
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf bin/
|
||||||
|
|
Loading…
Reference in New Issue