--- Makefile	2021-05-17 13:17:24.010000000 +0200
+++ Makefile	2021-05-17 13:51:21.580000000 +0200
@@ -38,10 +38,11 @@
 install: install-bin install-doc
 
 install-bin:
+	mkdir -p $(DESTDIR)/$(gitexecdir_SQ)/
 	sed -e '1s|#!.*/bash|#!$(BASH_PATH_SQ)|' \
 	    -e 's|@GIT_LATEXDIFF_VERSION@|$(GIT_LATEXDIFF_VERSION)|' \
-	        $(SCRIPT) > '$(gitexecdir_SQ)/$(SCRIPT)'
-	chmod 755 '$(gitexecdir_SQ)/$(SCRIPT)'
+	        $(SCRIPT) > '$(DESTDIR)/$(gitexecdir_SQ)/$(SCRIPT)'
+	chmod 755 '$(DESTDIR)/$(gitexecdir_SQ)/$(SCRIPT)'
 
 git-latexdiff.txt: git-latexdiff git-latexdiff.txt.header
 	( cat git-latexdiff.txt.header ; \
@@ -73,8 +74,8 @@
 	}
 
 install-doc: git-latexdiff.1
-	mkdir -p $(gitmanpath_SQ)/man1/
-	cp $< $(gitmanpath_SQ)/man1/
+	mkdir -p $(DESTDIR)/$(gitmanpath_SQ)/man1/
+	cp $< $(DESTDIR)/$(gitmanpath_SQ)/man1/
 
 dist: dist/git-latexdiff.zip
 dist/git-latexdiff.zip: force
