From 59212798f716f1057b088d5993d8a80106fab7d7 Mon Sep 17 00:00:00 2001 From: Sam Therapy Date: Thu, 20 Oct 2022 21:34:16 +0000 Subject: [PATCH] [SKIP CI] fix(make): Real actual macOS support (#148) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tested again on the lone Apple device I have. This time it does not break make on Linux 🌝 Reviewed-on: https://git.froth.zone/sam/awl/pulls/148 Reviewed-by: grumbulon --- 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