Browse Source

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
pull/10/head
Kevin Ernst 4 years ago
parent
commit
d7a9033886
  1. 11
      Makefile

11
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:

Loading…
Cancel
Save