2021-02-11 21:21:22 +01:00
|
|
|
PROJECT?=github.com/edgebox-iot/sysctl
|
|
|
|
|
|
|
|
RELEASE ?= dev
|
|
|
|
COMMIT := $(shell git rev-parse --short HEAD)
|
|
|
|
BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
|
|
|
|
BUILD_DIR = bin
|
|
|
|
|
|
|
|
build-all:
|
|
|
|
GOOS=linux GOARCH=amd64 make build
|
|
|
|
|
|
|
|
build:
|
|
|
|
@echo "Building ${GOOS}-${GOARCH}"
|
|
|
|
GOOS=${GOOS} GOARCH=${GOARCH} go build \
|
|
|
|
-trimpath -ldflags "-s -w -X ${PROJECT}/internal/diagnostics.Version=${RELEASE} \
|
|
|
|
-X ${PROJECT}/internal/diagnostics.Commit=${COMMIT} \
|
|
|
|
-X ${PROJECT}/internal/diagnostics.BuildDate=${BUILD_DATE}" \
|
2021-02-11 21:33:05 +01:00
|
|
|
-o bin/sysctl-${GOOS}-${GOARCH} ${PROJECT}/cmd/sysctl
|
2021-02-11 21:21:22 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf ${BUILD_DIR} ${DIST_DIR}
|
|
|
|
go clean
|