File: Makefile

package info (click to toggle)
debpkg 0.0.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80 kB
  • sloc: makefile: 33
file content (48 lines) | stat: -rw-r--r-- 1,099 bytes parent folder | download
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
45
46
47
48
# Makefile for debpkg

.PHONY: build install clean test run-example help

BINARY_NAME=debpkg
INSTALL_PATH=/usr/local/bin

# Default target
all: build

# Build the application
build:
	@echo "Building $(BINARY_NAME)..."
	go build -o $(BINARY_NAME) .
	@echo "Build complete: ./$(BINARY_NAME)"

# Install the application to system
install: build
	@echo "Installing $(BINARY_NAME) to $(INSTALL_PATH)..."
	sudo cp $(BINARY_NAME) $(INSTALL_PATH)/
	@echo "Installation complete. You can now run '$(BINARY_NAME)' from anywhere."

# Clean build artifacts
clean:
	@echo "Cleaning..."
	rm -f $(BINARY_NAME)
	go clean

# Run tests
test:
	@echo "Running tests..."
	go test ./...

# Download dependencies
deps:
	@echo "Downloading dependencies..."
	go mod download
	go mod tidy

# Show help
help:
	@echo "Available targets:"
	@echo "  build     - Build the application"
	@echo "  install   - Install the application to $(INSTALL_PATH)"
	@echo "  clean     - Clean build artifacts"
	@echo "  test      - Run tests"
	@echo "  deps      - Download and tidy dependencies"
	@echo "  help      - Show this help message"