From d7a90338869e4659839ab58d21445b11782d78ab Mon Sep 17 00:00:00 2001 From: Kevin Ernst Date: Fri, 24 Sep 2021 13:03:39 -0400 Subject: [PATCH] Makefile: fix MANDIR, fix for macOS - MANDIR was not a directory before; now it is - macOS has no "root" group, and -g/-o are rarely needed anyway - hat tip to osmcode/libosmium#18 - fairly-recent macOS (Mojave) still does not have 'install -D' so do 'install -d' explicitly for the parent directories, particularly for 'man8', since that probably won't exist in most people's /usr/local/share/man to begin with --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 211c397..5212507 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,10 @@ # Makefile for symlinks CC = gcc +# append options like `-o owner -g group` here if desired INSTALL = install CFLAGS += $(shell getconf LFS_CFLAGS 2>/dev/null) -OWNER = root -GROUP = root PREFIX ?= /usr/local -MANDIR ?= $(PREFIX)/share/man/man8/symlinks.8 +MANDIR ?= $(PREFIX)/share/man/man8 BINDIR ?= $(PREFIX)/bin @@ -16,8 +15,10 @@ symlinks: symlinks.c $(CC) -Wall -Wstrict-prototypes -O2 $(CFLAGS) -o symlinks symlinks.c install: all symlinks.8 - $(INSTALL) -c -o $(OWNER) -g $(GROUP) -m 755 symlinks $(BINDIR) - $(INSTALL) -c -o $(OWNER) -g $(GROUP) -m 644 symlinks.8 $(MANDIR) + $(INSTALL) -d $(BINDIR) + $(INSTALL) -m 755 symlinks $(BINDIR) + $(INSTALL) -d $(MANDIR) + $(INSTALL) -m 644 symlinks.8 $(MANDIR) .PHONY: clean clean: