added Makefiles

This commit is contained in:
Stefan Friese 2025-01-14 15:09:09 +00:00
parent 4e714159a6
commit 324c8bd1a4
3 changed files with 67 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
gontrol gontrol
bin/ bin/
build/
agents/agents agents/agents

33
Makefile Normal file
View File

@ -0,0 +1,33 @@
# Define variables
APP_NAME = gontrol
GO_CMD = go
GO_BUILD = $(GO_CMD) build
GO_INSTALL = $(GO_CMD) install
GO_CLEAN = $(GO_CMD) clean
BUILD_DIR = build
BINARY = $(BUILD_DIR)/$(APP_NAME)
.PHONY: build
all: build
build:
@echo "Building $(APP_NAME)..."
$(GO_BUILD) -o $(BINARY)
install: build
@echo "Installing $(APP_NAME)..."
$(GO_INSTALL)
clean:
@echo "Cleaning up build artifacts..."
$(GO_CLEAN)
rm -f $(BINARY)
help:
@echo "Makefile for $(APP_NAME)"
@echo "Usage:"
@echo " make build - Build the application"
@echo " make install - Install the application"
@echo " make clean - Remove build artifacts"
@echo " make - Default target (build)"

33
agents/Makefile Normal file
View File

@ -0,0 +1,33 @@
# Define variables
APP_NAME = agent
GO_CMD = go
GO_BUILD = $(GO_CMD) build
GO_INSTALL = $(GO_CMD) install
GO_CLEAN = $(GO_CMD) clean
BUILD_DIR = ../build
BINARY = $(BUILD_DIR)/$(APP_NAME)
.PHONY: build
all: build
build:
@echo "Building $(APP_NAME)..."
$(GO_BUILD) -o $(BINARY)
install: build
@echo "Installing $(APP_NAME)..."
$(GO_INSTALL)
clean:
@echo "Cleaning up build artifacts..."
$(GO_CLEAN)
rm -f $(BINARY)
help:
@echo "Makefile for $(APP_NAME)"
@echo "Usage:"
@echo " make build - Build the application"
@echo " make install - Install the application"
@echo " make clean - Remove build artifacts"
@echo " make - Default target (build)"