From d56ac81fd66f6f6b30dc09412fe01213f4573ef0 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Sun, 5 Apr 2015 22:52:08 +0300 Subject: [PATCH] Build static binaries on !OS X. #142 --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a4c224aa..4d4b41d1 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,14 @@ else GOM=gom endif +UNAME := $(shell uname) + +ifeq ($(UNAME), Darwin) +GOLDFLAGS= +else +GOLDFLAGS=--ldflags='-extldflags -static' +endif + all: test check system-test prepare: @@ -40,7 +48,7 @@ check: $(GOM) exec golint $(ALL_PACKAGES:%=./%) install: - $(GOM) build -o $(BINPATH)/aptly + $(GOM) build -o $(BINPATH)/aptly $(GOLDFLAGS) system-test: install if [ ! -e ~/aptly-fixture-db ]; then git clone https://github.com/aptly-dev/aptly-fixture-db.git ~/aptly-fixture-db/; fi