diff --git a/Makefile b/Makefile index f08999c21..eff369b13 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,10 @@ EXTERNAL_TOOLS=\ golang.org/x/tools/cmd/cover \ golang.org/x/tools/cmd/vet +all: test -all: deps format - @mkdir -p bin/ - @bash --norc -i ./scripts/build.sh +dev: deps format + @NOMAD_DEV=1 sh -c "'$(CURDIR)/scripts/build.sh'" bin: @sh -c "'$(CURDIR)/scripts/build.sh'" @@ -21,19 +21,16 @@ cov: deps: @echo "--> Installing build dependencies" - @bash --norc scripts/deps.sh -d -v + @DEP_ARGS="-d -v" sh -c "'$(CURDIR)/scripts/deps.sh'" updatedeps: deps @echo "--> Updating build dependencies" - @bash --norc scripts/deps.sh -d -f -u + @DEP_ARGS="-d -f -u" sh -c "'$(CURDIR)/scripts/deps.sh'" test: deps - @./scripts/test.sh + @sh -c "'$(CURDIR)/scripts/test.sh'" @$(MAKE) vet -integ: - go list ./... | INTEG_TESTS=yes xargs -n1 go test - cover: deps go list ./... | xargs -n1 go test --cover diff --git a/README.md b/README.md index 11085ed48..57c646b90 100644 --- a/README.md +++ b/README.md @@ -96,12 +96,22 @@ $ make test ... ``` -To compile a development version of Nomad, run `make`. This will put the +To compile a development version of Nomad, run `make dev`. This will put the Nomad binary in the `bin` and `$GOPATH/bin` folders: ```sh -$ make +$ make dev ... $ bin/nomad ... ``` + +To cross-compile Nomad, run `make bin`. This will compile Nomad for multiple +platforms and place the resulting binaries into the `./pkg` directory: + +```sh +$ make bin +... +$ ls ./pkg +... +``` diff --git a/scripts/deps.sh b/scripts/deps.sh index e731dfa3e..dfe348ac7 100755 --- a/scripts/deps.sh +++ b/scripts/deps.sh @@ -1,9 +1,9 @@ #!/bin/bash # First get the OS-specific packages -GOOS=windows go get $@ github.com/StackExchange/wmi -GOOS=windows go get $@ github.com/shirou/w32 +GOOS=windows go get $DEP_ARGS github.com/StackExchange/wmi +GOOS=windows go get $DEP_ARGS github.com/shirou/w32 # Get the rest of the deps DEPS=$(go list -f '{{range .TestImports}}{{.}} {{end}}' ./...) -go get $@ ./... $DEPS +go get $DEP_ARGS ./... $DEPS