-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a makefile to the project to support the following operations: - build - install - clean - deps - watch - help Update the README to use the Makefile command as well and move from using `go build` to `go install` in the Makefile.
- Loading branch information
Showing
2 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
NAME=slick | ||
VERSION=0.0.1 | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
.PHONY: build | ||
## build: Compile the packages. | ||
build: | ||
@go build -v -o bin/$(NAME) cmd/$(NAME)/main.go | ||
|
||
.PHONY: install | ||
## install: Install the packages. | ||
install: build | ||
@mv bin/$(NAME) $(GOPATH)/bin/$(NAME) | ||
|
||
.PHONY: clean | ||
## clean: Clean projects and previous builds | ||
clean: | ||
@rm -rf bin/* | ||
|
||
.PHONY: deps | ||
## deps: Download modules | ||
deps: | ||
@go mod download | ||
|
||
.PHONY: watch | ||
## watch: Reload the app whenever the source changes | ||
watch: | ||
@which reflex > /dev/null || (go install github.com/cespare/reflex@latest) | ||
reflex -s -r '\.go$$' make run | ||
|
||
.PHONY: help | ||
all: help | ||
## help: show this help message | ||
help: Makefile | ||
@echo | ||
@echo " Choose a command to run:" | ||
@echo | ||
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' | ||
@echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters