Skip to content

Commit

Permalink
Add a make command with CGO disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
titilambert authored and sparrc committed Feb 5, 2016
1 parent f01da8f commit 35150ca
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 35150ca

Please sign in to comment.