Skip to content

Instantly share code, notes, and snippets.

View ahhzaky's full-sized avatar
Curiosity

Zaky ahhzaky

Curiosity
View GitHub Profile
@ahhzaky
ahhzaky / Makefile.bash
Created March 19, 2025 17:08
Makefile for golang
.PHONY: build clean test lint run install cross-build
# Build variables
BINARY_NAME=NAMEBINARY
MAIN_PKG=LOCATIONFILEMAIN.GO
VERSION=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
BUILD_TIME=$(shell date -u '+%Y-%m-%d %H:%M:%S')
LDFLAGS=-ldflags "-s -w -X main.version=$(VERSION) -X main.buildTime=$(BUILD_TIME)"
# Default target