From 075cdbcdd2668f998340d3ae421a2b35ea4ed962 Mon Sep 17 00:00:00 2001 From: Matthias Cramer Date: Wed, 11 Feb 2026 14:06:31 +0100 Subject: [PATCH] BINDIR and MANDIR --- Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0af1548..0d08cfc 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,14 @@ OBJS = $(SRCS:.c=.o) TARGET = pcapmirror # Installation directory - PREFIX = /usr -ifdef HOMEBREW_PREFIX -PREFIX = $(HOMEBREW_PREFIX) + +ifndef BINDIR +BINDIR = $(DESTDIR)$(PREFIX)/bin +endif + +ifndef MANDIR +MANDIR = $(DESTDIR)$(PREFIX)/share/man endif # Default rule @@ -49,8 +53,8 @@ clean: # Install the executable install: $(TARGET) mkdir -p $(DESTDIR)$(PREFIX)/bin - install -s -D $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET) - install -D $(TARGET).8 $(DESTDIR)$(PREFIX)/share/man/man8/$(TARGET).8 + install -s -D $(TARGET) $(BINDIR)/$(TARGET) + install -D $(TARGET).8 $(MANDIR)/man8/$(TARGET).8 # Uninstall the executable