From 7417d88d730d1677c3bebe9f929016c82f350c69 Mon Sep 17 00:00:00 2001 From: Michele Guerini Rocco Date: Sun, 26 Nov 2023 18:51:38 +0100 Subject: [PATCH] Makefile: make use of `install` portable install -D on GNU is actually install -d on BSD. --- Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f345271..af95c22 100644 --- a/Makefile +++ b/Makefile @@ -115,11 +115,12 @@ clean: # Install libraries, binaries and documentation install: $(BINARIES) $(LIBRARIES) $(SHAREDIR)/doc $(SHAREDIR)/gray.1 - install -Dm555 -t $(PREFIX)/bin $(BINDIR)/* - install -Dm555 -t $(PREFIX)/lib $(LIBDIR)/* - install -Dm644 -t $(PREFIX)/share/doc $(SHAREDIR)/doc/manual.* - install -Dm644 -t $(PREFIX)/share/doc/res $(SHAREDIR)/doc/res/* - install -Dm644 -t $(PREFIX)/share/man/man1 $(SHAREDIR)/gray.1 + mkdir -p $(PREFIX)/{bin,lib,share/{doc/res,man/man1}} + install -m555 -t $(PREFIX)/bin $(BINDIR)/* + install -m555 -t $(PREFIX)/lib $(LIBDIR)/* + install -m644 -t $(PREFIX)/share/doc $(SHAREDIR)/doc/manual.* + install -m644 -t $(PREFIX)/share/doc/res $(SHAREDIR)/doc/res/* + install -m644 -t $(PREFIX)/share/man/man1 $(SHAREDIR)/gray.1 # dependencies $(OBJDIR)/%.o: $(OBJDIR)/%.d @@ -139,7 +140,8 @@ $(LIBDIR)/libgray.a: $(LIBDIR)/libgray.a($(MODULES)) # GRAY static library when compiling from JETTO -include ../include.mk $(JLIBDIR)/libgray.a: $(LIBDIR)/libgray.a - install -Dm755 '$<' '$@' + mkdir -p $(LIBDIR) + install -m755 '$<' '$@' # All documentation docs: $(SHAREDIR)/gray.1 $(SHAREDIR)/doc