Makefile: use DESTDIR, make directories if they do not exist

Signed-off-by: Christoph Lohmann <20h@r-36.net>
This commit is contained in:
Hiltjo Posthuma 2020-04-29 18:20:10 +02:00 committed by Christoph Lohmann
parent 30eef86b7a
commit 09e08cd095

View File

@ -17,16 +17,18 @@ bin/md2point: md2point.o
${CC} -c ${CFLAGS} $< ${CC} -c ${CFLAGS} $<
install: install:
install -m755 bin/dir2point $(PREFIX)/bin/dir2point mkdir -p $(DESTDIR)$(PREFIX)/bin
install -m755 bin/md2point $(PREFIX)/bin/md2point install -m 755 bin/dir2point $(DESTDIR)$(PREFIX)/bin/dir2point
install -m755 bin/point2pdf $(PREFIX)/bin/point2pdf install -m 755 bin/md2point $(DESTDIR)$(PREFIX)/bin/md2point
install -m644 md2point.1 $(MANPREFIX)/man1/md2point.1 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: uninstall:
rm -f $(PREFIX)/bin/dir2point rm -f $(DESTDIR)$(PREFIX)/bin/dir2point
rm -f $(PREFIX)/bin/md2point rm -f $(DESTDIR)$(PREFIX)/bin/md2point
rm -f $(PREFIX)/bin/point2pdf rm -f $(DESTDIR)$(PREFIX)/bin/point2pdf
rm -f $(MANPREFIX)/man1/md2point.1 rm -f $(DESTDIR)$(MANPREFIX)/man1/md2point.1
clean: clean:
rm -f bin/md2point rm -f bin/md2point