From 3d51ff671e0bf079063c6270bbb985bd3d218b34 Mon Sep 17 00:00:00 2001 From: David Faulkner Date: Wed, 5 Aug 2026 23:25:25 -0500 Subject: feat: initial commit for ud maintenance utility - Add C source code for Debian apt update, autoremove, and cleanup tasks - Add Makefile with build, install, uninstall, and clean targets - Add README.md with build and usage instructions - Add MIT license and .gitignore for build artifacts --- Makefile | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..939f257 --- /dev/null +++ b/Makefile @@ -0,0 +1,34 @@ +# Compiler and flags +CC := gcc +CFLAGS := -Wall -Wextra -Wpedantic -O2 -std=c11 -D_POSIX_C_SOURCE=200809L +TARGET := ud +SRC := main.c +OBJ := $(SRC:.c=.o) + +# Default rule +all: $(TARGET) + +# Link binary +$(TARGET): $(OBJ) + $(CC) $(CFLAGS) -o $@ $^ + +# Compile source files to object files +%.o: %.c + $(CC) $(CFLAGS) -c $< -o $@ + +# Install binary to user's local bin path (~/.local/bin) +install: $(TARGET) + @mkdir -p $(HOME)/.local/bin + install -m 755 $(TARGET) $(HOME)/.local/bin/$(TARGET) + @echo "Installed $(TARGET) to $(HOME)/.local/bin/" + +# Uninstall binary from local bin path +uninstall: + rm -f $(HOME)/.local/bin/$(TARGET) + @echo "Removed $(TARGET) from $(HOME)/.local/bin/" + +# Clean build directory +clean: + rm -f $(OBJ) $(TARGET) + +.PHONY: all clean install uninstall -- cgit v1.2.3