summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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))