BUILD_DIR = build SERVICES = gateway-ui CGO_ENABLED ?= 0 # GOARCH ?= "amd64" GOARCH ?= arm64 GOOS ?= linux # GOARM ?= 7 define compile_service CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -ldflags "-s -w" -o ${BUILD_DIR}/$(1) main.go endef all: $(SERVICES) .PHONY: all $(SERVICES) clean: rm -rf ${BUILD_DIR} install: cp ${BUILD_DIR}/* $(GOBIN) test: go test -v -race -count 1 -tags test $(shell go list ./... | grep -v 'vendor\|cmd') $(SERVICES): $(call compile_service,$(@))