From 64593a6987dc005467f32ac72aa63ef304b54c4a Mon Sep 17 00:00:00 2001 From: Adora Laura Kalb Date: Tue, 29 Oct 2024 13:21:36 +0100 Subject: [PATCH] update makefile --- Makefile | 19 ++++++++++++------- constants/constants.go | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 16e8c2e..aeb0267 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,14 @@ -BINARY_NAME=humble-bot -default: build - +# Set the default Go build flags +#GOFLAGS = -ldflags='-w -s -X cmd.Version=$(VERSION)' +GOFLAGS = -ldflags='-w -s' + +# Build the application build: - go build -o ${BINARY_NAME} main.go - + go build $(GOFLAGS) -o bin/humble-bot main.go + +# Clean the build artifacts clean: - go clean - rm ${BINARY_NAME} + rm -rf bin + +# Set a version for the build +VERSION := $(shell git describe --tags --always) diff --git a/constants/constants.go b/constants/constants.go index 8ab356e..88602e8 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -6,7 +6,7 @@ package constants -var AppVersion = "0.2.1" +var AppVersion string var HumbleCategories = []string{"games", "books", "software"}