Skip to content

Instantly share code, notes, and snippets.

@ariefrahmansyah
Last active September 9, 2018 18:12
Show Gist options
  • Select an option

  • Save ariefrahmansyah/77d9965da6c7b6073007d4450e901cc1 to your computer and use it in GitHub Desktop.

Select an option

Save ariefrahmansyah/77d9965da6c7b6073007d4450e901cc1 to your computer and use it in GitHub Desktop.
Go's Simple Makefile
GO=go
GOBUILD=${GO} build
GOINSTALL=${GO} install
GOTEST=${GO} test
GODEP=dep
export NOW=$(shell date +'%FT%T%z')
ROOT_PATH="github.com/ariefrahmansyah"
APP_NAME="[MY-AWESOME-APP]"
all: test build run
get-deps:
@echo "${NOW} UPDATING..."
@${GODEP} ensure -v
test:
@echo "${NOW} TESTING..."
@${GOTEST} -v -cover -race ./...
build:
@echo "${NOW} BUILDING ${APP_NAME}..."
@${GOBUILD} -race -o ${APP_NAME} ./cmd/${APP_NAME}
run:
@echo "${NOW} RUNNING..."
@./${APP_NAME}
install:
@echo "${NOW} INSTALLING ${APP_NAME}..."
@${GOINSTALL} ./cmd/${APP_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment