-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 857 Bytes
/
Makefile
File metadata and controls
44 lines (35 loc) · 857 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Makefile for Caddy Module
.PHONY: all build build-xcaddy clean deps fmt
PACKAGE_NAME=agentcortex/caddy-runtime
BINARY_NAME=caddy-runtime
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
XCADDY=xcaddy
all: clean deps build
# Build the binary (recommended method)
build:
@echo "Building $(BINARY_NAME)..."
$(GOBUILD) -o $(BINARY_NAME) ./cmd/caddy/main.go
build-xcaddy:
@echo "Buiding with xcaddy..."
XCADDY_DEBUG=1 $(XCADDY) build --with github.com/agent-guide/$(PACKAGE_NAME)=$(shell pwd)
# Clean build artifacts
clean:
@echo "Cleaning..."
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -rf buildenv_*
# Download dependencies
deps:
@echo "Downloading dependencies..."
$(GOMOD) download
$(GOMOD) tidy
# Format code
fmt:
@echo "Formatting code..."
$(GOCMD) fmt ./...