This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
CMS/1.Software/UI/gateway-ui/Makefile

28 lines
527 B
Makefile
Raw Permalink Normal View History

2024-11-19 09:19:21 +00:00
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,$(@))