From 324c8bd1a42de63129664509952c26301afbcb45 Mon Sep 17 00:00:00 2001 From: Stefan Friese Date: Tue, 14 Jan 2025 15:09:09 +0000 Subject: [PATCH] added Makefiles --- .gitignore | 1 + Makefile | 33 +++++++++++++++++++++++++++++++++ agents/Makefile | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 Makefile create mode 100644 agents/Makefile diff --git a/.gitignore b/.gitignore index 6d1cb42..e7a3946 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ gontrol bin/ +build/ agents/agents diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..557734d --- /dev/null +++ b/Makefile @@ -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)" diff --git a/agents/Makefile b/agents/Makefile new file mode 100644 index 0000000..75b166b --- /dev/null +++ b/agents/Makefile @@ -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)"