--- Makefile.in.orig	2005-03-05 16:23:40 UTC
+++ Makefile.in
@@ -20,27 +20,39 @@ INSTALL_DATA = @INSTALL_DATA@
 SHELL = /bin/sh
 
 compile:
+	for F in psgml.el psgml.texi; do \
+		sed -e "s,@[p]refix@,${prefix}," < $$F > $$F.tmp; \
+		mv $$F.tmp $$F; \
+	done
 	$(EMACS) $(FLAGS) -f psgml-compile-files
 
-all: 
-	rm -f *.elc ; $(EMACS) $(FLAGS) -f psgml-compile-files
+info:
+	for p in psgml psgml-api; do \
+		$(EMACS) -batch -q -no-site-file -l texinfmt \
+		-f batch-texinfo-format $$p.texi; \
+	done
 
+all: 
+	rm -f *.elc
+	${MAKE} compile
+	${MAKE} info
 
-install: compile 
-	$(SHELL) mkinstalldirs $(lispdir)
+install:
+	$(SHELL) mkinstalldirs $(DESTDIR)$(lispdir)
 	for p in *.elc; do \
-	  echo " $(INSTALL_DATA) $$p $(lispdir)/$$p"; \
-	  $(INSTALL_DATA) $$p $(lispdir)/$$p; \
+	  echo " $(INSTALL_DATA) $$p $(DESTDIR)$(lispdir)/$$p"; \
+	  $(INSTALL_DATA) `echo $$p | sed 's/elc$$/el/'` $(DESTDIR)$(lispdir)/`echo $$p | sed 's/elc$$/el/'` ; \
+	  $(INSTALL_DATA) $$p $(DESTDIR)$(lispdir)/$$p; \
 	done
-	$(INSTALL_DATA) iso88591.map $(lispdir)
+	$(INSTALL_DATA) iso88591.map $(DESTDIR)$(lispdir)
 
 install-info:
-	$(INSTALL_DATA) psgml.info $(infodir)
-	$(INSTALL_DATA) psgml-api.info $(infodir)
+	$(INSTALL_DATA) psgml.info $(DESTDIR)$(infodir)
+	$(INSTALL_DATA) psgml-api.info $(DESTDIR)$(infodir)
 	if $(SHELL) -c 'install-info --version' \
 		>/dev/null 2>&1; then \
-		install-info --info-dir=$(infodir) psgml.info; \
-		install-info --info-dir=$(infodir) psgml-api.info; \
+		install-info $(DESTDIR)$(infodir)/psgml.info $(DESTDIR)$(infodir)/dir; \
+		install-info $(DESTDIR)$(infodir)/psgml-api.info $(DESTDIR)$(infodir)/dir; \
 	else true; fi
 
 
