Skip to content

Commit

Permalink
feat: Add makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
caffeine-addictt committed Apr 4, 2024
1 parent 0b90e40 commit 9ce12cf
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
BINARY_NAME:=main.out


# =================================== DEFAULT =================================== #

default: all

## default: Runs build and test
.PHONY: default
all: build test

# =================================== HELPERS =================================== #

## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

# =================================== DEVELOPMENT =================================== #

## build: builds the binary
.PHONY: build
build: |
go build -o $(BINARY_NAME) main.go

## test: Test the program
.PHONY: test
test: |
go test -v main.go

# =================================== QUALITY ================================== #

## tidy: Tidy mod file
.PHONY: tidy
tidy: |
go mod tidy -v

## clean: Clean binaries
.PHONY: clean
clean: |
go clean && rm ${BINARY_NAME}

## fmt: Format code
.PHONY: fmt
fmt:
go fmt ./...

0 comments on commit 9ce12cf

Please sign in to comment.