From a31b115b0640f904c9b8e2dcc7449bc11f3a3706 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Tue, 3 Feb 2015 12:36:39 +0000 Subject: [PATCH] Add 'build' makefile target --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1d492d64..8a15e798 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PUBLISH=publish_weave publish_weavedns publish_weavetools .DEFAULT: all -.PHONY: all update tests publish $(PUBLISH) clean +.PHONY: all update tests publish $(PUBLISH) clean prerequisites build # If you can use docker without being root, you can do "make SUDO=" SUDO=sudo @@ -78,3 +78,12 @@ clean: -$(SUDO) docker rmi $(WEAVER_IMAGE) $(WEAVEDNS_IMAGE) $(WEAVETOOLS_IMAGE) rm -f $(WEAVER_EXE) $(WEAVEDNS_EXE) $(WEAVER_EXPORT) $(WEAVEDNS_EXPORT) $(WEAVETOOLS_EXPORT) $(SUDO) rm -rf $(WEAVETOOLS_EXES) + +prerequisites: + $(SUDO) apt-get -y update + $(SUDO) apt-get -y install --no-install-recommends build-essential git ca-certificates golang docker.io mercurial libpcap-dev + +build: prerequisites + $(SUDO) go clean -i net + $(SUDO) go install -tags netgo std + $(MAKE) build_weavetools_exes_in_container=