forked from arnika-project/arnika
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (20 loc) · 731 Bytes
/
Copy pathMakefile
File metadata and controls
26 lines (20 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Define the name of the application and its version
NAME := arnika
VERSION := $(shell git describe --tags --always)
# Define the Go compiler and other tools
GO = go
# Build flags
GO_BUILD_VARS := CGO_ENABLED=0 GOEXPERIMENT=runtimesecret
BUILD_FLAGS = -trimpath -ldflags "-w -s -extldflags=-Wl,-Bsymbolic -X 'main.Version=$(VERSION)' -X 'main.APPName=$(NAME)'"
BINARY_NAME ?= arnika
BUILD_DIR ?= build
# Default target: build the binary
default: $(BUILD_DIR)/$(BINARY_NAME)
# Build rule: create a new executable
build:
@echo "Building $(BINARY_NAME)"
$(GO_BUILD_VARS) $(GO) build $(BUILD_FLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) .
# Clean rule: remove build artifacts
clean:
rm -rf $(BUILD_DIR)/*
.PHONY: default build clean