2023-11-23 19:01:17 -05:00
|
|
|
NAME=blt
|
2023-11-24 14:28:53 -05:00
|
|
|
VERSION=`git describe --tags`
|
2023-11-23 19:01:17 -05:00
|
|
|
|
|
|
|
.PHONY: build
|
|
|
|
## build: Compile the packages.
|
|
|
|
build:
|
2024-05-29 11:04:31 -04:00
|
|
|
@go build -o $(NAME) -ldflags "-X git.metaunix.net/bitgoblin/blt/app.AppVersion=$(VERSION)"
|
2023-11-23 19:01:17 -05:00
|
|
|
|
|
|
|
.PHONY: run
|
|
|
|
## run: Build and Run in development mode.
|
|
|
|
run: build
|
|
|
|
@./$(NAME) -e development
|
|
|
|
|
|
|
|
.PHONY: run-prod
|
|
|
|
## run-prod: Build and Run in production mode.
|
|
|
|
run-prod: build
|
|
|
|
@./$(NAME) -e production
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
## clean: Clean project and previous builds.
|
|
|
|
clean:
|
|
|
|
@rm -f $(NAME)
|
|
|
|
|
|
|
|
.PHONY: deps
|
|
|
|
## deps: Download modules
|
|
|
|
deps:
|
|
|
|
@go mod download
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
## test: Run tests with verbose mode
|
|
|
|
test:
|
|
|
|
@go test -v ./tests/*
|
|
|
|
|
|
|
|
.PHONY: help
|
|
|
|
all: help
|
|
|
|
# help: show this help message
|
|
|
|
help: Makefile
|
|
|
|
@echo
|
|
|
|
@echo " Choose a command to run in "$(APP_NAME)":"
|
|
|
|
@echo
|
|
|
|
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
|
|
|
|
@echo
|