--- Makefile.in.orig	Thu Jul 15 19:59:50 2004
+++ Makefile.in	Sat Nov  6 20:06:29 2004
@@ -936,7 +936,7 @@
 	rm -f src/vhdl/*~ src/vhdl/"#"*"#"
 
 install: all
-	$(INSTALL) -d -m755 @bindir@ $(DESTDIR)@datadir@/electric/lib
+	$(INSTALL) -d -m755 $(DESTDIR)@bindir@ $(DESTDIR)@datadir@/electric/lib
 	$(INSTALL) -m755 $(PROGNAME) $(DESTDIR)@bindir@/$(PROGNAME)
 	$(INSTALL) -m644 lib/.cadrc $(DESTDIR)@datadir@/electric/lib
 	@(cd lib ; \
@@ -960,15 +960,15 @@
 	  done ) ; \
 	done ) ; 
 
-$(prefix)/$(PROGNAME):
-	mkdir $(prefix)/$(PROGNAME)
-$(prefix)/$(PROGNAME)/lib:
-	mkdir $(prefix)/$(PROGNAME)/lib
+$(DESTDIR)$(prefix)/$(PROGNAME):
+	mkdir $(DESTDIR)$(prefix)/$(PROGNAME)
+$(DESTDIR)$(prefix)/$(PROGNAME)/lib:
+	mkdir $(DESTDIR)$(prefix)/$(PROGNAME)/lib
 
 uninstall:
-	rm -f @bindir@/$(PROGNAME)
-	rm -rf @datadir@/electric/lib
-	rm -rf @datadir@/electric/doc
+	rm -f $(DESTDIR)@bindir@/$(PROGNAME)
+	rm -rf $(DESTDIR)@datadir@/electric/lib
+	rm -rf $(DESTDIR)@datadir@/electric/doc
 
 depend:
 	grep '^\#[ ]*include' `ls -1 src/*/*.c src/*/*.cpp` | \
