-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (25 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.PHONY: all dep test lint build
WORKSPACE ?= $$(pwd)
GO_PKG_LIST := $(shell go list ./... | grep -v /vendor/)
lint:
@golint -set_exit_status ${GO_PKG_LIST}
dep:
@echo "Resolving go package dependencies"
@go mod tidy
@go mod vendor
@echo "Package dependencies completed"
update-sdk:
@echo "Updating SDK dependencies"
@export GOFLAGS="" && go get "github.com/Axway/agent-sdk@main"
${WORKSPACE}/apic_traceability_agent: dep
@export time=`date +%Y%m%d%H%M%S` && \
export version=`cat version` && \
export commit_id=`git rev-parse --short HEAD` && \
go build -tags static_all \
-ldflags="-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildTime=$${time}' \
-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildVersion=$${version}' \
-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildCommitSha=$${commit_id}' \
-X 'github.com/Axway/agent-sdk/pkg/cmd.BuildAgentName=SampleTraceabilityAgent'" \
-a -o ${WORKSPACE}/bin/apic_traceability_agent ${WORKSPACE}/main.go
build:${WORKSPACE}/apic_traceability_agent
@echo "Build complete"