Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from Shopify/makefile
Browse files Browse the repository at this point in the history
Add more flags to makefile
  • Loading branch information
jinankjain authored Sep 21, 2017
2 parents f920d0c + 55a8d44 commit b4f513c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/kubeaudit
/kubeaudit_unix
/tmp
/.glide
/.dev
Expand Down
34 changes: 28 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,34 @@
all: build_native
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
BINARY_NAME=kubeaudit
BINARY_UNIX=$(BINARY_NAME)_unix

build_native:
go build -o kubeaudit .
all: test build

build:
$(GOBUILD) -o $(BINARY_NAME) -v

test:
go test -cover ./cmd/... .
$(GOTEST) -cover ./... .

clean:
/bin/rm -v kubeaudit
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_UNIX)

run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)


# Cross Compilation
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v

docker-build:
docker run --rm -it -v "$(GOPATH)":/go -w /go/src/github.com/Shopify/kubeaudit golang:1.9 go build -o "$(BINARY_UNIX)" -v

.PHONY: build_native clean test
.PHONY: build clean test run build-linux docker-build

0 comments on commit b4f513c

Please sign in to comment.