From ca8d0fce22bc0fba0c2356bb0529b139f620c670 Mon Sep 17 00:00:00 2001
From: Nan Liu <nan.liu@gmail.com>
Date: Fri, 7 Oct 2016 09:34:02 -0700
Subject: [PATCH] Fix #1264 make install works with new build path

Add OS and ARCH detection so make install copies the correct file to
/usr/local/bin
---
 Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 081cb4538..97b9e27c1 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,9 @@
 #See the License for the specific language governing permissions and
 #limitations under the License.
 
+OS = $(shell uname -s | tr '[:upper:]' '[:lower:]')
+ARCH = $(shell uname -m)
+
 default:
 	$(MAKE) deps
 	$(MAKE) all
@@ -35,7 +38,7 @@ check:
 all:
 	bash -c "./scripts/build_snap.sh"
 install:
-	cp build/bin/snapd /usr/local/bin/
-	cp build/bin/snapctl /usr/local/bin/
+	cp build/$(OS)/$(ARCH)/snapd /usr/local/bin/
+	cp build/$(OS)/$(ARCH)/snapctl /usr/local/bin/
 proto:
 	cd `echo $(GOPATH) | cut -d: -f 1`; bash -c "./src/github.com/intelsdi-x/snap/scripts/gen-proto.sh"