--- spim/Makefile.orig	2009-01-14 22:29:50.000000000 -0800
+++ spim/Makefile	2009-01-14 23:24:24.000000000 -0800
@@ -51,16 +51,16 @@
 # Path of directory that contains documentation:
 DOC_DIR = ../Documentation
 
-
+prefix = /usr/local
 
 # Full path for the directory that will hold the executable files:
-BIN_DIR = /usr/bin
+BIN_DIR = $(prefix)/bin
 
 # Full path for the directory that will hold the exception handler:
-EXCEPTION_DIR = /usr/lib/spim
+EXCEPTION_DIR = $(prefix)/share/spim
 
 # Full path for the directory that will hold the man files:
-MAN_DIR = /usr/share/man/en
+MAN_DIR = $(prefix)/share/man/man1
 
 
 # If you have flex, use it instead of lex.  If you use flex, define this
@@ -174,11 +174,14 @@
 	rm -f spim spim.exe *.o TAGS test.out lex.yy.c y.tab.c y.tab.h y.output
 
 install: spim
-	install -D spim $(BIN_DIR)/spim
-	install -D -m 0444 $(CPU_DIR)/exceptions.s $(EXCEPTION_DIR)/exceptions.s
+	install -d $(DESTDIR)$(BIN_DIR)
+	install -m 0755 spim $(DESTDIR)$(BIN_DIR)/spim
+	install -d $(DESTDIR)$(EXCEPTION_DIR)
+	install -m 0644 $(CPU_DIR)/exceptions.s $(DESTDIR)$(EXCEPTION_DIR)/exceptions.
 
 install-man:
-	install -D -m 0444 $(DOC_DIR)/spim.man $(MAN_DIR)
+	install -d $(DESTDIR)$(MAN_DIR)
+	install -m 0644 $(DOC_DIR)/spim.man $(DESTDIR)$(MAN_DIR)/spim.1
 
 very-clean: clean
 	rm -f configuration
