Makefile updates

This commit is contained in:
Ryan Uber
2015-09-30 12:39:05 -07:00
parent 3a695326ca
commit 9dcf65eed5
3 changed files with 21 additions and 14 deletions

View File

@@ -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

View File

@@ -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
...
```

View File

@@ -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