From 0e9e3e068d7e164a0069240cf54cbddc53abbe22 Mon Sep 17 00:00:00 2001 From: Johannes 'fish' Ziemke Date: Mon, 12 Aug 2013 16:18:07 +0200 Subject: [PATCH] Add flags to build prometheus statically Change-Id: I8fc883247e0657d26aa8ca6f24315fb9217277f3 --- .gitignore | 1 + Makefile | 5 +++++ Makefile.INCLUDE | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 16bfed94a..24dd88eb2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ *.pyc *.rej *.so +*.tar.gz *~ .*.swp .DS_Store diff --git a/Makefile b/Makefile index 77f8f4d8f..fb26ceef1 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,11 @@ build: config dependencies model preparation tools web docker: build docker build -t prometheus:$(REV) . +tarball: build prometheus-$(REV).tar.gz + +prometheus-$(REV).tar.gz: + tar -czf prometheus-$(REV).tar.gz prometheus + $(BUILD_PATH)/cache/$(GOPKG): curl -o $@ http://go.googlecode.com/files/$(GOPKG) diff --git a/Makefile.INCLUDE b/Makefile.INCLUDE index 1200bd004..2f288fe2b 100644 --- a/Makefile.INCLUDE +++ b/Makefile.INCLUDE @@ -89,6 +89,9 @@ BUILDFLAGS := -ldflags \ -X main.goVersion $(GO_VERSION)\ -X main.leveldbVersion $(LEVELDB_VERSION)\ -X main.protobufVersion $(PROTOCOL_BUFFERS_VERSION)\ - -X main.snappyVersion $(SNAPPY_VERSION)" + -X main.snappyVersion $(SNAPPY_VERSION)\ + -linkmode external\ + -extldflags '-lstdc++ -lpthread -static\ + $(PREFIX)/lib/libleveldb.a $(PREFIX)/lib/libsnappy.a'" PROTOC := $(LOCAL_BINARIES)/protoc