summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorpankunull <panku_null@proton.me>2025-08-30 20:15:59 +0200
committerpankunull <panku_null@proton.me>2025-08-30 20:15:59 +0200
commit3a4dd7dd423023b35d501bdad966f13e18703cef (patch)
tree1b276cf70ff6d1479b9c04dc1de73e0a96897255 /Makefile
parent297e7abf41ec4be028b0a250c16c1ab800963d32 (diff)
The program got out of hand, I'm doing stuff it doesn't need.HEADmaster
Good exercise!
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index af3c7f7..23a3caa 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,10 @@ CFLAGS = -Wall -O2
SRC_DIR = src
BIN_DIR = bin
+# Installation directory
+PREFIX ?= /usr/local
+BINDIR ?= $(PREFIX)/bin
+
# Source and target names
TARGET = chproc
SRC = $(SRC_DIR)/$(TARGET).c
@@ -57,6 +61,18 @@ define run_test
fi
endef
+# Install
+install: $(BIN)
+ @echo "Installing $(TARGET) to $(BINDIR)"
+ mkdir -p $(BINDIR)
+ cp -v $(BIN) $(BINDIR)/
+
+# Uninstall
+uninstall:
+ @echo "Removing $(TARGET) from $(BINDIR)"
+ rm -v -f $(BINDIR)/$(TARGET)
+
+# Test
test: $(BIN)
$(call run_test,$(TARGET),no args)
$(call run_test,$(TARGET),$(ARG))