Skip to content

Commit

Permalink
add Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuf Kanchwala committed Jul 23, 2020
1 parent 61c3224 commit b00157b
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
GITCOMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
BUILD_FLAGS := -v -ldflags "-w -s"

BUILD_DIR = build
BINARY_NAME = terrascan


# default
default: build


# build terrascan binary
build: clean
@mkdir -p $(BUILD_DIR) > /dev/null
go build ${BUILD_FLAGS} -o ${BUILD_DIR}/${BINARY_NAME} cmd/terrascan/main.go
@echo "terrascan binary created in ${BUILD_DIR} directory"


# clean build
clean:
@rm -rf $(BUILD_DIR)


# run all validation tests
validate: gofmt govet golint


# gofmt validation
gofmt:
./scripts/validate-gofmt.sh
./scripts/fix-gofmt.sh


# golint validation
golint:
./scripts/validate-golint.sh


# govet validation
govet:
./scripts/validate-govet.sh

0 comments on commit b00157b

Please sign in to comment.