--- Makefile.orig 2024-04-04 08:13:06 UTC +++ Makefile @@ -1,5 +1,5 @@ -PREFIX=/usr/local -PREFIX_MAN=$(PREFIX)/man +PREFIX:=$(PREFIX) +PREFIX_MAN=$(PREFIX)/share/man CFLAGS?=-g -Wall -Wextra all: snac @@ -18,14 +18,14 @@ install: $(CC) -I/usr/local/include -MM *.c > makefile.depend install: - mkdir -p -m 755 $(PREFIX)/bin - install -m 755 snac $(PREFIX)/bin/snac - mkdir -p -m 755 $(PREFIX_MAN)/man1 - install -m 644 doc/snac.1 $(PREFIX_MAN)/man1/snac.1 - mkdir -p -m 755 $(PREFIX_MAN)/man5 - install -m 644 doc/snac.5 $(PREFIX_MAN)/man5/snac.5 - mkdir -p -m 755 $(PREFIX_MAN)/man8 - install -m 644 doc/snac.8 $(PREFIX_MAN)/man8/snac.8 + mkdir -p -m 755 $(DESTDIR)$(PREFIX)/bin + install -m 755 snac $(DESTDIR)$(PREFIX)/bin/snac + mkdir -p -m 755 $(DESTDIR)$(PREFIX_MAN)/man1 + install -m 644 doc/snac.1 $(DESTDIR)$(PREFIX_MAN)/man1/snac.1 + mkdir -p -m 755 $(DESTDIR)$(PREFIX_MAN)/man5 + install -m 644 doc/snac.5 $(DESTDIR)$(PREFIX_MAN)/man5/snac.5 + mkdir -p -m 755 $(DESTDIR)$(PREFIX_MAN)/man8 + install -m 644 doc/snac.8 $(DESTDIR)$(PREFIX_MAN)/man8/snac.8 uninstall: rm $(PREFIX)/bin/snac