--- Makefile.in.orig	2022-01-22 06:01:09.000000000 +0800
+++ Makefile.in	2022-05-22 12:09:17.000000000 +0800
@@ -292,19 +292,19 @@
 
 # Install after building
 install:: force
-	for d in $(DIRS); do $(INSTALL) -d $$d; done
-	for f in $(BIN); do $(INSTALL_PROG) $$f $(bindir); done
-	for f in $(LIBSRC); do $(INSTALL_DATA) $$f $(libdir)/obc; done
-	for f in $(LIB); do $(INSTALL_DATA) $$f $(libdir)/obc; done
-	for f in $(LIBX); do $(INSTALL_PROG) $$f $(libdir)/obc; done
-	for f in $(RES); do $(INSTALL_DATA) $$f $(libdir)/obc/resources; done
+	for d in $(DIRS); do $(INSTALL) -d $(DESTDIR)$$d; done
+	for f in $(BIN); do $(INSTALL_PROG) $$f $(DESTDIR)$(bindir); done
+	for f in $(LIBSRC); do $(INSTALL_DATA) $$f $(DESTDIR)$(libdir)/obc; done
+	for f in $(LIB); do $(INSTALL_DATA) $$f $(DESTDIR)$(libdir)/obc; done
+	for f in $(LIBX); do $(INSTALL_PROG) $$f $(DESTDIR)$(libdir)/obc; done
+	for f in $(RES); do $(INSTALL_DATA) $$f $(DESTDIR)$(libdir)/obc/resources; done
 	for f in $(MAN); do \
-		$(INSTALL_DATA) $(top_srcdir)/man/$$f $(mandir)/man1; done
+		$(INSTALL_DATA) $(top_srcdir)/man/$$f $(DESTDIR)$(mandir)/man1; done
 
 ifdef ENABLE_DEBUGGER
   ifdef MACOS
     install:: force
-	cp -R macport/Obdb.app $(libdir)/obc
+	cp -R macport/Obdb.app $(DESTDIR)$(libdir)/obc
   endif
 endif
 
