From 39038ced2e2bfa617988773506a90e52fcc6dc1b Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Thu, 20 Oct 2022 23:14:43 +0200 Subject: [PATCH] fix(make): Real actual macOS support this time without breaking everything else :) Signed-off-by: Sam Therapy --- GNUmakefile | 17 +++++++++++------ Makefile | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index e9fbf99..47310bf 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -7,6 +7,11 @@ ifeq ($(OS),Windows_NT) EXE := $(PROG).exe else EXE := $(PROG) +ifeq ($(shell uname), Darwin) + INSTALLFLAGS := +else + INSTALLFLAGS := D +endif endif ## install: installs awl @@ -16,11 +21,11 @@ install: $(GO) install $(GOFLAGS) . else install: all - install -Dm755 $(PROG) $(DESTDIR)$(PREFIX)/$(BIN)/$(PROG) - install -Dm644 doc/$(PROG).1 $(DESTDIR)$(MAN)/man1/$(PROG).1 - gzip -9 $(DESTDIR)$(MAN)/man1/$(PROG).1 + install -$(INSTALLFLAGS)m755 $(PROG) $(DESTDIR)$(PREFIX)/$(BIN)/$(PROG) + install -$(INSTALLFLAGS)m644 doc/$(PROG).1 $(DESTDIR)$(MAN)/man1/$(PROG).1 + gzip -9f $(DESTDIR)$(MAN)/man1/$(PROG).1 # completions need to go in one specific place :) - install -Dm644 completions/bash.bash $(DESTDIR)$(PREFIX)/$(SHARE)/bash-completion/completions/$(PROG) - install -Dm644 completions/fish.fish $(DESTDIR)$(PREFIX)/$(SHARE)/fish/vendor_completions.d/$(PROG).fish - install -Dm644 completions/zsh.zsh $(DESTDIR)$(PREFIX)/$(SHARE)/zsh/site-functions/_$(PROG) + install -$(INSTALLFLAGS)m644 completions/bash.bash $(DESTDIR)$(PREFIX)/$(SHARE)/bash-completion/completions/$(PROG) + install -$(INSTALLFLAGS)m644 completions/fish.fish $(DESTDIR)$(PREFIX)/$(SHARE)/fish/vendor_completions.d/$(PROG).fish + install -$(INSTALLFLAGS)m644 completions/zsh.zsh $(DESTDIR)$(PREFIX)/$(SHARE)/zsh/site-functions/_$(PROG) endif diff --git a/Makefile b/Makefile index 31c1c9e..ea8632f 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ EXE := $(PROG) install: all install -Dm755 $(PROG) $(DESTDIR)$(PREFIX)/$(BIN)/$(PROG) install -Dm644 doc/$(PROG).1 $(DESTDIR)$(MAN)/man1/$(PROG).1 - gzip -9 $(DESTDIR)$(MAN)/man1/$(PROG).1 + gzip -9f $(DESTDIR)$(MAN)/man1/$(PROG).1 # completions need to go in one specific place :) install -Dm644 completions/bash.bash $(DESTDIR)$(PREFIX)$(SHARE)/bash-completion/completions/$(PROG) install -Dm644 completions/fish.fish $(DESTDIR)$(PREFIX)$(SHARE)/fish/vendor_completions.d/$(PROG).fish -- 2.45.2