From 0d706ae72ceefd74053ad6cb0900ecce6cf1f085 Mon Sep 17 00:00:00 2001 From: auric Date: Sat, 21 Feb 2026 11:08:36 -0600 Subject: Add Umbrella 0.1.5 --- Makefile | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7cfa4a1 --- /dev/null +++ b/Makefile @@ -0,0 +1,57 @@ +# ── umbrella Makefile ───────────────────────────────────────────────────────── + +CC = gcc +CFLAGS = -Wall -Wextra -Wpedantic -std=c11 -D_GNU_SOURCE \ + -O2 -g +LDFLAGS = -lyaml + +DAEMON_SRCS = \ + src/main.c \ + src/daemon.c \ + src/unit.c \ + src/proto.c \ + src/client.c \ + src/log.c \ + src/log_tail.c \ + src/console/rcon.c + +CLI_SRCS = clients/umbrella-cli/main.c + +DAEMON_OBJS = $(DAEMON_SRCS:.c=.o) +CLI_OBJS = $(CLI_SRCS:.c=.o) + +.PHONY: all clean install + +all: umbrella umbrella-cli + +umbrella: $(DAEMON_OBJS) + $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) + +umbrella-cli: $(CLI_OBJS) + $(CC) $(CFLAGS) -o $@ $^ + +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +# ── Install ─────────────────────────────────────────────────────────────────── +PREFIX ?= /usr/local +CONF_DIR = /etc/umbrella +UNITS_DIR = /etc/umbrella/units +RUN_DIR = /run/umbrella +LOG_DIR = /var/log/umbrella + +install: all + install -Dm755 umbrella $(PREFIX)/sbin/umbrella + install -Dm755 umbrella-cli $(PREFIX)/bin/umbrella-cli + install -dm755 $(CONF_DIR) + install -dm755 $(UNITS_DIR) + install -dm755 $(RUN_DIR) + install -dm755 $(LOG_DIR) + @if [ ! -f $(CONF_DIR)/umbrella.conf ]; then \ + install -Dm644 umbrella.conf.example $(CONF_DIR)/umbrella.conf; \ + echo "Installed default config to $(CONF_DIR)/umbrella.conf"; \ + fi + @echo "Done. Edit $(CONF_DIR)/umbrella.conf and add unit files to $(UNITS_DIR)/" + +clean: + rm -f $(DAEMON_OBJS) $(CLI_OBJS) umbrella umbrella-cli -- cgit v1.2.3