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