From e36b76885e6499c18b2507ba2a0c54c5ddc72452 Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Thu, 13 Apr 2017 10:49:09 +0200 Subject: [PATCH] Added install support on make Fixed #1544 I added `make install` support. By default it does: ``` cp -r ./bin/* /usr/local/bin ``` There is a env var `$PREFIX` in make. By default it's `/usr/local` Signed-off-by: Gianluca Arbezzano --- Makefile | 5 +++++ README.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 27f89efed..d0f6d65f0 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,8 @@ ifeq ($(GOOS),darwin) default: bin/infrakit-instance-hyperkit endif +PREFIX?=/usr/local/ + MOBY_DEPS=$(wildcard src/cmd/moby/*.go) Makefile vendor.conf MOBY_DEPS+=$(wildcard src/initrd/*.go) $(wildcard src/pad4/*.go) bin/moby: $(MOBY_DEPS) | bin @@ -46,6 +48,9 @@ test-qemu-efi: test-efi.iso bin: mkdir -p $@ +install: + cp -R ./bin/* $(PREFIX)/bin + define check_test_log @cat $1 |grep -q 'Moby test suite PASSED' endef diff --git a/README.md b/README.md index da92782d1..37bcd853f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ LinuxKit, a toolkit for building custom minimal, immutable Linux distributions. ### Build the `moby` tool Simple build instructions: use `make` to build. This will build the customisation tool in `bin/`. Add this -to your `PATH` or copy it to somewhere in your `PATH` eg `sudo cp bin/moby /usr/local/bin/`. +to your `PATH` or copy it to somewhere in your `PATH` eg `sudo cp bin/moby /usr/local/bin/`. Or you can use `sudo make install`. If you already have `go` installed you can use `go get -u github.com/docker/moby/src/cmd/moby` to install the `moby` tool, and then use `moby build linuxkit.yml` to build the example configuration. You