31 lines
532 B
Makefile
31 lines
532 B
Makefile
CLEAN_GOPATH := $(shell echo $(GOPATH) | tr ":" "\n" | grep -v '^$$' | grep -v $(PWD) | tr "\n" ":")
|
|
GOPATH := $(PWD):$(CLEAN_GOPATH)
|
|
PACKAGES := \
|
|
meatballhat.com/sylvilagus-conntest \
|
|
meatballhat.com/sylvilagus-chapter02-hello-world-consumer
|
|
|
|
export GOPATH
|
|
|
|
|
|
test: build
|
|
go test $(PACKAGES)
|
|
|
|
build: deps
|
|
go install $(PACKAGES)
|
|
|
|
deps:
|
|
go get $(PACKAGES)
|
|
|
|
fmt:
|
|
go fmt $(PACKAGES)
|
|
|
|
clean:
|
|
rm -v bin/*
|
|
find pkg -name '*.a' -exec rm -v {} \;
|
|
|
|
env:
|
|
@echo GOPATH=$(GOPATH)
|
|
@echo PACKAGES=$(PACKAGES)
|
|
|
|
.PHONY: all clean env fmt
|