Files
hbot/Makefile
Jason A. Donenfeld b52ec14d2d Initial commit of utilities
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-06-03 18:38:26 +02:00

16 lines
390 B
Makefile

targets := $(patsubst cmd/%,%,$(wildcard cmd/*))
input := $(wildcard hbot/* go.mod go.sum)
all: $(targets)
define gobuild
$(1): $$(wildcard cmd/$(1)/*.go) $$(input)
CGO_ENABLED=0 go build -buildmode=pie -v -o $(1) ./cmd/$(1)
endef
$(foreach target,$(targets),$(eval $(call gobuild,$(target))))
clean:
rm -f $(targets)
fmt:
go fmt ./...
test:
go test -v ./...
.PHONY: all clean fmt test