diff --git a/.gitignore b/.gitignore index bbee398..2a6cc79 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ bin/* +tmp/ + # Output of the go coverage tool, specifically when used with LiteIDE *.out diff --git a/Makefile b/Makefile index e1506e6..e69de29 100644 --- a/Makefile +++ b/Makefile @@ -1,46 +0,0 @@ - -# Project metadata -APP_NAME := hspguard -CMD_DIR := ./cmd/$(APP_NAME) -BIN_DIR := ./bin -BIN_PATH := $(BIN_DIR)/$(APP_NAME) -PKG := ./... -GO_FILES := $(shell find . -type f -name '*.go' -not -path "./vendor/*") - -# Go tools -GO := go -GOLINT := golangci-lint -GOFMT := gofmt -GOTEST := go test - -# Build flags -LD_FLAGS := -s -w -BUILD_TIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ') -GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown") - -.PHONY: all build clean fmt lint run - -all: build - -build: - @mkdir -p $(BIN_DIR) - $(GO) build -ldflags "-X main.buildTime=$(BUILD_TIME) -X main.commitHash=$(GIT_COMMIT) $(LD_FLAGS)" -o $(BIN_PATH) $(CMD_DIR) - -run: - $(GO) run $(CMD_DIR) - -fmt: - $(GOFMT) -s -w $(GO_FILES) - -lint: - $(GOLINT) run - -test: - $(GOTEST) -v $(PKG) - -clean: - @rm -rf $(BIN_DIR) - -mod: - $(GO) mod tidy -