-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (33 loc) · 899 Bytes
/
Makefile
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Makefile
# Binary name
BINARY_NAME := solizard
# Installation directory (GOPATH/bin)
INSTALL_DIR := $(GOPATH)/bin
# Main package to build
MAIN_PACKAGE := ./cmd/solizard
# Go commands
GO := go
GOBUILD := $(GO) build
GOINSTALL := $(GO) install
# Default target (build)
all: build
# Build binary
build:
$(GOBUILD) -o $(BINARY_NAME) $(MAIN_PACKAGE)
chmod +x $(BINARY_NAME)
# Install
install:
$(GOBUILD) -o $(INSTALL_DIR)/$(BINARY_NAME) $(MAIN_PACKAGE)
chmod +x $(INSTALL_DIR)/$(BINARY_NAME)
# Clean (remove built files)
clean:
rm -f $(BINARY_NAME)
# Help (display available commands)
help:
@echo "Available commands:"
@echo " make - Default build (build)"
@echo " make build - Build binary"
@echo " make install - Install binary"
@echo " make clean - Remove built files"
@echo " make help - Display available commands"
.PHONY: all build install clean help