From 35150caea45830146a90e19c6108ab128f65457e Mon Sep 17 00:00:00 2001 From: Thibault Cohen Date: Mon, 21 Dec 2015 14:49:56 -0500 Subject: [PATCH] Add a make command with CGO disabled closes #458 --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Makefile b/Makefile index 04f078857..2efad7705 100644 --- a/Makefile +++ b/Makefile @@ -23,12 +23,29 @@ build-windows: "-X main.Version=$(VERSION)" \ ./cmd/telegraf/telegraf.go +build-for-docker: + CGO_ENABLED=0 GOOS=linux go build -o telegraf -ldflags \ + "-X main.Version=$(VERSION)" \ + ./cmd/telegraf/telegraf.go + # Build with race detector dev: prepare go build -race -o telegraf -ldflags \ "-X main.Version=$(VERSION)" \ ./cmd/telegraf/telegraf.go +# Build linux 64-bit, 32-bit and arm architectures +build-linux-bins: prepare + GOARCH=amd64 GOOS=linux go build -o telegraf_linux_amd64 \ + -ldflags "-X main.Version=$(VERSION)" \ + ./cmd/telegraf/telegraf.go + GOARCH=386 GOOS=linux go build -o telegraf_linux_386 \ + -ldflags "-X main.Version=$(VERSION)" \ + ./cmd/telegraf/telegraf.go + GOARCH=arm GOOS=linux go build -o telegraf_linux_arm \ + -ldflags "-X main.Version=$(VERSION)" \ + ./cmd/telegraf/telegraf.go + # Get dependencies and use gdm to checkout changesets prepare: go get github.com/sparrc/gdm