aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-06-15 00:28:22 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-06-15 00:47:09 +0200
commit3cc44be399ce1929792f65bcb2fa3de9bc12d2dd (patch)
tree77a2da7186885ce80fdd28b5820b8ff8708acfd0 /Makefile
parent09be103ad9fd3d468db65b4c885738336d55df98 (diff)
Add MacOs/darwin package generation
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d7ad5c2..ca04632 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
ROOT_SRCDIR := $(patsubst %/,%,$(dir $(mkfile_path)))
ROOT_GOPRJ := $(abspath $(ROOT_SRCDIR)/../../../..)
LOCAL_BINDIR := $(ROOT_SRCDIR)/bin
-LOCAL_TOOLSDIR := $(ROOT_SRCDIR)/tools
+LOCAL_TOOLSDIR := $(ROOT_SRCDIR)/tools/${HOST_GOOS}
PACKAGE_DIR := $(ROOT_SRCDIR)/package
export GOPATH := $(shell go env GOPATH):$(ROOT_GOPRJ)
@@ -77,7 +77,7 @@ build: vendor tools/syncthing/copytobin
@echo "### Build XDS agent (version $(VERSION), subversion $(SUB_VERSION)) - $(BUILD_MODE)";
@cd $(ROOT_SRCDIR); $(BUILD_ENV_FLAGS) go build $(VERBOSE_$(V)) -i -o $(LOCAL_BINDIR)/xds-agent$(EXT) -ldflags "$(GORELEASE) -X main.AppVersion=$(VERSION) -X main.AppSubVersion=$(SUB_VERSION)" .
-package: clean build
+package: clean tools/syncthing build
@mkdir -p $(PACKAGE_DIR)/xds-agent
@cp agent-config.json.in $(PACKAGE_DIR)/xds-agent/agent-config.json
@cp -a $(LOCAL_BINDIR)/* $(PACKAGE_DIR)/xds-agent
@@ -89,6 +89,8 @@ package-all:
GOOS=linux GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile package
@echo "# Build windows amd64..."
GOOS=windows GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile package
+ @echo "# Build darwin amd64..."
+ GOOS=darwin GOARCH=amd64 RELEASE=1 make -f $(ROOT_SRCDIR)/Makefile package
test: tools/glide
go test --race $(shell ./tools/glide novendor)