diff options
| author | David Faulkner <[email protected]> | 2026-08-05 23:25:25 -0500 |
|---|---|---|
| committer | David Faulkner <[email protected]> | 2026-08-05 23:25:25 -0500 |
| commit | 3d51ff671e0bf079063c6270bbb985bd3d218b34 (patch) | |
| tree | 2d99d81b2e0c1cad6ce119dfc6da5844ed49b3e1 /Makefile | |
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
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 34 |
1 files changed, 34 insertions, 0 deletions
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 |
