From 09e08cd095c441d08225aa95fa594bfe0b5b3a71 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 29 Apr 2020 18:20:10 +0200 Subject: [PATCH] Makefile: use DESTDIR, make directories if they do not exist Signed-off-by: Christoph Lohmann <20h@r-36.net> --- Makefile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 7c5acb0..424b340 100644 --- a/Makefile +++ b/Makefile @@ -17,16 +17,18 @@ bin/md2point: md2point.o ${CC} -c ${CFLAGS} $< install: - install -m755 bin/dir2point $(PREFIX)/bin/dir2point - install -m755 bin/md2point $(PREFIX)/bin/md2point - install -m755 bin/point2pdf $(PREFIX)/bin/point2pdf - install -m644 md2point.1 $(MANPREFIX)/man1/md2point.1 + mkdir -p $(DESTDIR)$(PREFIX)/bin + install -m 755 bin/dir2point $(DESTDIR)$(PREFIX)/bin/dir2point + install -m 755 bin/md2point $(DESTDIR)$(PREFIX)/bin/md2point + install -m 755 bin/point2pdf $(DESTDIR)$(PREFIX)/bin/point2pdf + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + install -m 644 md2point.1 $(DESTDIR)$(MANPREFIX)/man1/md2point.1 uninstall: - rm -f $(PREFIX)/bin/dir2point - rm -f $(PREFIX)/bin/md2point - rm -f $(PREFIX)/bin/point2pdf - rm -f $(MANPREFIX)/man1/md2point.1 + rm -f $(DESTDIR)$(PREFIX)/bin/dir2point + rm -f $(DESTDIR)$(PREFIX)/bin/md2point + rm -f $(DESTDIR)$(PREFIX)/bin/point2pdf + rm -f $(DESTDIR)$(MANPREFIX)/man1/md2point.1 clean: rm -f bin/md2point