--- Makefile.in.orig	2003-03-24 01:48:21.000000000 -0700
+++ Makefile.in	2009-05-19 01:38:55.000000000 -0600
@@ -1,21 +1,24 @@
+prefix=@prefix@
+
 all:
 	cd src && make
 	cd examples && make
 
 install:
-	install -m 644 -o root -g root --directory /usr/local/include/sgml	
-	install -m 644 -o root -g root include/DomComment.h /usr/local/include/sgml/DomComment.h
-	install -m 644 -o root -g root include/DomDocument.h /usr/local/include/sgml/DomDocument.h
-	install -m 644 -o root -g root include/DomElement.h /usr/local/include/sgml/DomElement.h
-	install -m 644 -o root -g root include/DomNode.h /usr/local/include/sgml/DomNode.h
-	install -m 644 -o root -g root include/DomNodeList.h /usr/local/include/sgml/DomNodeList.h
-	install -m 644 -o root -g root include/DomText.h /usr/local/include/sgml/DomText.h
-	install -m 644 -o root -g root include/SgmlParser.h /usr/local/include/sgml/SgmlParser.h
-	install -m 644 -o root -g root include/SgmlExtensionHtml.h /usr/local/include/sgml/SgmlExtensionHtml.h
-	install -m 644 -o root -g root include/SgmlExtensionXml.h /usr/local/include/sgml/SgmlExtensionXml.h
-	install -m 644 -o root -g root include/libsgml.h /usr/local/include/sgml/libsgml.h
-	install -m 644 -o root -g root libsgml.a /usr/local/lib/libsgml.a
-	install -m 644 -o root -g root libsgml.so /usr/local/lib/libsgml.so
+	install -d $(DESTDIR)$(prefix)/include/sgml
+	install include/DomComment.h $(DESTDIR)$(prefix)/include/sgml/DomComment.h
+	install include/DomDocument.h $(DESTDIR)$(prefix)/include/sgml/DomDocument.h
+	install include/DomElement.h $(DESTDIR)$(prefix)/include/sgml/DomElement.h
+	install include/DomNode.h $(DESTDIR)$(prefix)/include/sgml/DomNode.h
+	install include/DomNodeList.h $(DESTDIR)$(prefix)/include/sgml/DomNodeList.h
+	install include/DomText.h $(DESTDIR)$(prefix)/include/sgml/DomText.h
+	install include/SgmlParser.h $(DESTDIR)$(prefix)/include/sgml/SgmlParser.h
+	install include/SgmlExtensionHtml.h $(DESTDIR)$(prefix)/include/sgml/SgmlExtensionHtml.h
+	install include/SgmlExtensionXml.h $(DESTDIR)$(prefix)/include/sgml/SgmlExtensionXml.h
+	install include/Variant.h $(DESTDIR)$(prefix)/include/sgml/Variant.h
+	install include/libsgml.h $(DESTDIR)$(prefix)/include/sgml/libsgml.h
+	install libsgml.a $(DESTDIR)$(prefix)/lib/libsgml.a
+	install libsgml.dylib $(DESTDIR)$(prefix)/lib/libsgml.dylib
 
 uninstall:
 	rm -rf /usr/local/include/sgml /usr/local/lib/libsgml.a /usr/local/lib/libsgml.so