mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
0574abc228
* add rust program for fetching platform data * fix new line error * add CLI options to add the measurement to platform_info.json file * add documentation for platform info testing * add explanation for sev-snp-measure * delete excess space * fix minor errors * fix minor errors * add file permision constant
34 lines
1.0 KiB
Makefile
34 lines
1.0 KiB
Makefile
BUILD_DIR = build
|
|
SERVICES = manager agent cli
|
|
PLATFORM_INFO = platform_info
|
|
CGO_ENABLED ?= 0
|
|
GOARCH ?= amd64
|
|
VERSION ?= $(shell git describe --abbrev=0 --tags --always)
|
|
COMMIT ?= $(shell git rev-parse HEAD)
|
|
TIME ?= $(shell date +%F_%T)
|
|
empty:=
|
|
space:= $(empty) $(empty)
|
|
|
|
define compile_service
|
|
CGO_ENABLED=$(CGO_ENABLED) GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) \
|
|
go build -ldflags "-s -w \
|
|
-X 'github.com/absmach/magistrala.BuildTime=$(TIME)' \
|
|
-X 'github.com/absmach/magistrala.Version=$(VERSION)' \
|
|
-X 'github.com/absmach/magistrala.Commit=$(COMMIT)'" \
|
|
-o ${BUILD_DIR}/cocos-$(1) cmd/$(1)/main.go
|
|
endef
|
|
|
|
.PHONY: all $(SERVICES) $(PLATFORM_INFO)
|
|
|
|
all: $(SERVICES)
|
|
|
|
$(SERVICES):
|
|
$(call compile_service,$(@))
|
|
|
|
$(PLATFORM_INFO):
|
|
$(MAKE) -C ./scripts/platform_info
|
|
|
|
protoc:
|
|
protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative agent/agent.proto
|
|
protoc -I. --go_out=./pkg --go_opt=paths=source_relative --go-grpc_out=./pkg --go-grpc_opt=paths=source_relative manager/manager.proto
|