From 1f618d0d8d70b067f1cb1222c19022ba693157b0 Mon Sep 17 00:00:00 2001 From: Gus Wiedey Date: Tue, 12 Dec 2017 15:07:18 -0500 Subject: [PATCH] Update Makefile to support versions of install that don't recognize -D On some versions of MacOS (e.g. the one I'm currently using), the system default version of `install` doesn't recognize the `-D` option (the closest equivalent is `-d`); this provides support for those versions. --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index 7785fb7..556f213 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,11 @@ COLOR = yes CURSES = -lncurses #CURSES = -lcurses +# Uncomment this if your machine's version of install doesn't recognize +# the -D option. +# +#INSTALL_NO_D_FLAG = true + # Just in case your operating system keeps its user-added header files # somewhere unusual... # @@ -292,16 +297,26 @@ $(BLORB_TARGET): $(BLORB_OBJECT) @echo install: $(NAME) +ifeq ($(INSTALL_NO_D_FLAG), true) + @install -d $(DESTDIR)$(PREFIX)/bin -m 755 $(BINNAME)$(EXTENSION) "$(DESTDIR)$(PREFIX)/bin/$(BINNAME)$(EXTENSION)" + @install -d $(DESTDIR)$(MAN_PREFIX)/man/man6 -m 644 doc/$(NAME).6 "$(DESTDIR)$(MAN_PREFIX)/man/man6/$(NAME).6" +else @install -D -m 755 $(BINNAME)$(EXTENSION) "$(DESTDIR)$(PREFIX)/bin/$(BINNAME)$(EXTENSION)" @install -D -m 644 doc/$(NAME).6 "$(DESTDIR)$(MAN_PREFIX)/man/man6/$(NAME).6" +endif uninstall: @rm -f "$(DESTDIR)$(PREFIX)/bin/$(NAME)" @rm -f "$(DESTDIR)$(MAN_PREFIX)/man/man6/$(NAME).6" install_dumb: d$(NAME) +ifeq ($(INSTALL_NO_D_FLAG), true) + @install -d $(DESTDIR)$(PREFIX)/bin -m 755 d$(BINNAME)$(EXTENSION) "$(DESTDIR)$(PREFIX)/bin/d$(BINNAME)$(EXTENSION)" + @install -d $(DESTDIR)$(MAN_PREFIX)/man/man6 -m 644 doc/d$(NAME).6 "$(DESTDIR)$(MAN_PREFIX)/man/man6/d$(NAME).6" +else @install -D -m 755 d$(BINNAME)$(EXTENSION) "$(DESTDIR)$(PREFIX)/bin/d$(BINNAME)$(EXTENSION)" @install -D -m 644 doc/d$(NAME).6 "$(DESTDIR)$(MAN_PREFIX)/man/man6/d$(NAME).6" +endif uninstall_dumb: @rm -f "$(DESTDIR)$(PREFIX)/bin/d$(NAME)" -- 2.34.1