generated from edgexfoundry-holding/template-repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
21 lines (13 loc) · 746 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.PHONY: build clean
GO=CGO_ENABLED=1 go
APPVERSION=1.3.0
# This pulls the version of the SDK from the go.mod file. If the SDK is the only required module,
# it must first remove the word 'required' so the offset of $2 is the same if there are multiple required modules
SDKVERSION=$(shell cat ./go.mod | grep 'github.com/edgexfoundry/app-functions-sdk-go v' | sed 's/require//g' | awk '{print $$2}')
MICROSERVICE=app-service-influx
GOFLAGS=-ldflags "-X github.com/edgexfoundry/app-functions-sdk-go/internal.SDKVersion=$(SDKVERSION) -X github.com/edgexfoundry/app-functions-sdk-go/internal.ApplicationVersion=$(APPVERSION)"
GIT_SHA=$(shell git rev-parse HEAD)
build:
$(GO) build $(GOFLAGS) -o $(MICROSERVICE)
clean:
rm -f $(MICROSERVICE)