From 88af9ba666b70f69485b33ed71ca16ac344ae18f Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 1 Feb 2015 21:18:46 -0800 Subject: [PATCH] Consolidate developers docs and Makefile, create symlink automatically --- BUILDDEPS.md | 20 ++++++++++++++------ CONTRIBUTING.md | 8 +++++--- Makefile | 11 +++++------ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/BUILDDEPS.md b/BUILDDEPS.md index 1935aec57..591a28336 100644 --- a/BUILDDEPS.md +++ b/BUILDDEPS.md @@ -35,10 +35,12 @@ $ export PATH=$PATH:$GOPATH/bin .... Add paths to your bashrc .... -$ echo "export PATH=$PATH:${HOME}/local/go/bin" >> ${HOME}/.bashrc -$ echo "export GOROOT=${HOME}/local/go" >> ${HOME}/.bashrc -$ echo "export GOPATH=$HOME/mygo" >> ${HOME}/.bashrc -$ echo "export PATH=$PATH:$GOPATH/bin" >> ${HOME}/.bashrc +$ cat << EOF > ${HOME}/.bashrc +export PATH=$PATH:${HOME}/local/go/bin +export GOROOT=${HOME}/local/go +export GOPATH=$HOME/mygo +export PATH=$PATH:$GOPATH/bin +EOF ``` ## Mac OSX (Yosemite) 10.10 @@ -77,9 +79,15 @@ $ mkdir -p $HOME/mygo $ export GOPATH=$HOME/mygo $ export PATH=$PATH:$GOPATH/bin +$ GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6) +$ export GOROOT=$(brew --prefix)/Cellar/go/$GOVERSION/libexec .... Add paths to your bashrc .... -$ echo "export GOPATH=$HOME/mygo" >> ${HOME}/.bashrc -$ echo "export PATH=$PATH:$GOPATH/bin" >> ${HOME}/.bashrc +$ cat << EOF > ~/.bashrc +GOVERSION=$(brew list go | head -n 1 | cut -d '/' -f 6) +export GOPATH=$HOME/mygo +export PATH=$PATH:$GOPATH/bin +export GOROOT=$(brew --prefix)/Cellar/go/$GOVERSION/libexec +EOF ``` diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06c5acde0..1803aa33e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,20 +3,22 @@ Fork [Minio upstream](https://github.com/Minio-io/minio/fork) source repository ```sh $ git clone https://github.com/$USER_ID/minio $ cd minio -$ mkdir -p ${GOPATH}/src/github.com/minio-io -$ ln -s ${PWD} $GOPATH/src/github.com/minio-io/ ``` ### Compiling Minio from source -Minio uses ``Makefile`` to wrap around some of the limitations of ``go build``. To compile Minio source, simply change to your workspace folder and type ``make``. +Minio uses ``Makefile`` to wrap around some of the limitations of ``go`` build system. To compile Minio source, simply change to your workspace folder and type ``make``. ```sh $ make Checking if proper environment variables are set.. Done ... Checking dependencies for Minio.. Done +Installed godep +Installed cover +Building Libraries ... ... ``` + ### Developer Guidelines ``Minio`` community welcomes your contribution. To make the process as seamless as possible, we ask for the following: * Go ahead and fork the project and make your changes. We encourage pull requests to discuss code changes. diff --git a/Makefile b/Makefile index 3e6987f08..ed57c1fec 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,21 @@ #GOPATH := $(CURDIR)/tmp/gopath MAKE_OPTIONS := -s -ARCH := $(shell uname -s) all: getdeps install checkdeps: @./checkdeps.sh +createsymlink: + @if test ! -h $(GOPATH)/src/github.com/minio-io/minio; then echo "Creating symlink to $(GOPATH)/src/github.com/minio-io/minio" && ln -s $(PWD) $(GOPATH)/src/github.com/minio-io/minio; fi + getdeps: checkdeps @go get github.com/tools/godep && echo "Installed godep" @go get golang.org/x/tools/cmd/cover && echo "Installed cover" -build-erasure: getdeps - @godep go generate github.com/minio-io/minio/pkg/storage/erasure - @godep go build github.com/minio-io/minio/pkg/storage/erasure - -build-all: getdeps build-erasure +build-all: getdeps createsymlink @echo "Building Libraries" + @godep go generate ./... @godep go build ./... test-all: build-all