GO ?= go
GOCACHE ?= /private/tmp/go-build-cache
BINARY ?= iot_ctrl
GO_LDFLAGS ?= -linkmode=external

.PHONY: build
build:
	GOCACHE=$(GOCACHE) $(GO) build -ldflags="$(GO_LDFLAGS)" -o $(BINARY) ./cmd/iot_ctrl

.PHONY: test
test:
	GOCACHE=$(GOCACHE) $(GO) test -ldflags="$(GO_LDFLAGS)" ./cmd/iot_ctrl

.PHONY: clean
clean:
	rm -f $(BINARY)
