Fixed man installation on MacOs (#81)

This commit is contained in:
TheDarkBug 2021-06-07 00:37:35 +02:00
parent a518735cb8
commit dd97143aeb

View file

@ -5,9 +5,11 @@ CFLAGS_DEBUG = -Wall -Wextra
ifeq ($(shell uname), Linux) ifeq ($(shell uname), Linux)
PREFIX = /usr/bin PREFIX = /usr/bin
LIBDIR = /usr/lib LIBDIR = /usr/lib
MANDIR = /usr/share/man/man1
else ifeq ($(shell uname), Darwin) else ifeq ($(shell uname), Darwin)
PREFIX = /usr/local/bin PREFIX = /usr/local/bin
LIBDIR = /usr/local/lib LIBDIR = /usr/local/lib
MANDIR = /usr/local/share/man/man1
endif endif
CC = cc CC = cc
MAN_COMPILER = pandoc MAN_COMPILER = pandoc
@ -22,14 +24,14 @@ debug:
install: build man install: build man
cp $(NAME) $(DESTDIR)$(PREFIX)/$(NAME) cp $(NAME) $(DESTDIR)$(PREFIX)/$(NAME)
ls $(DESTDIR)/$(LIBDIR)/ 2> /dev/null || mkdir $(DESTDIR)/$(LIBDIR)/ ls $(DESTDIR)$(LIBDIR)/ > /dev/null || mkdir $(DESTDIR)$(LIBDIR)/
cp res/* $(DESTDIR)/$(LIBDIR)/ cp res/* $(DESTDIR)$(LIBDIR)/
cp ./$(NAME).1.gz $(DESTDIR)/usr/share/man/man1/ cp ./$(NAME).1.gz $(DESTDIR)$(MANDIR)/
uninstall: uninstall:
rm -f $(DESTDIR)$(PREFIX)/$(NAME) rm -f $(DESTDIR)$(PREFIX)/$(NAME)
rm -rf $(DESTDIR)/$(LIBDIR)/ rm -rf $(DESTDIR)/$(LIBDIR)/
rm -rf $(DESTDIR)/usr/share/man/man1/$(NAME).1.gz rm -rf $(DESTDIR)$(MANDIR)/$(NAME).1.gz
termux: build termux: build
cp $(NAME) $(DESTDIR)/data/data/com.termux/files$(PREFIX)/$(NAME) cp $(NAME) $(DESTDIR)/data/data/com.termux/files$(PREFIX)/$(NAME)