diff --git a/Makefile.in b/Makefile.in
index 981739178f4f598338fcc7e0fbd2d67aa144a353..38d53644f3b1148f860db31c9a46f03ab2ca2282 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -14,7 +14,9 @@ include config.make
 # FIXME: Really need -I$(srcdir) ???
 INCLUDES = -I. -I$(srcdir)
 
-TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) shadata$(EXEEXT) libnettle.a $(SHLIBTARGET)
+TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) shadata$(EXEEXT) \
+	  libnettle.a $(SHLIBTARGET) \
+	  nettle.info nettle.html
 
 all check install uninstall:
 	$(MAKE) $@-here
@@ -27,6 +29,11 @@ clean distclean mostlyclean maintainer-clean:
 check-here:
 	true
 
+# These targets aren't supported, but they are expected by the
+# automake generated Makefiles in the lsh build.
+dvi installcheck uninstallcheck:
+	true
+
 .SUFFIXES:
 .SUFFIXES: .asm .html .c .dvi .info .$(OBJEXT) .p$(OBJEXT) .exe .pdf .ps .texinfo
 
@@ -92,11 +99,11 @@ SOURCES = $(nettle_SOURCES) aesdata.c desdata.c shadata.c
 DISTFILES = $(SOURCES) $(HEADERS) .bootstrap aclocal.m4 configure.ac configure \
 	config.guess config.sub install-sh texinfo.tex \
 	config.h.in config.m4.in config.make.in	Makefile.in \
-	README AUTHORS COPYING INSTALL NEWS TODO \
+	README AUTHORS COPYING INSTALL NEWS TODO ChangeLog \
 	memxor.c $(des_headers) descore.README \
 	aes-internal.h cast128_sboxes.h desinfo.h desCode.h \
 	serpent_sboxes.h nettle-internal.h \
-	nettle.texinfo nettle.info sha-example.c
+	nettle.texinfo nettle.info nettle.html sha-example.c
 
 # Rules building libnettle.a
 # FIXME: Do we really need to delete the archive first?
@@ -170,6 +177,15 @@ des.o: des.c des.h $(des_headers)
 @IF_ENABLE_ASM@	$(CC) $(CFLAGS) $(CCPIC) -c $*.s -o $@
 @IF_ENABLE_ASM@	echo >$*.d 
 
+# Texinfo rules
+.texinfo.info:
+	cd $(srcdir) && $(MAKEINFO) --output $@T `basename $<` \
+	&& test -s $@T && mv -f $@T $@
+
+.texinfo.html:
+	cd $(srcdir) && $(MAKEINFO) --html --no-split --output $@T `basename $<` \
+	&& test -s $@T && mv -f $@T $@
+
 # Configure-related rules
 
 .PRECIOUS: Makefile
@@ -203,29 +219,49 @@ $(srcdir)/config.h.in: $(srcdir)/configure.ac
 	touch $@
 
 # Installation
-install-here: install-info install-headers libnettle.a $(SHLIBTARGET) $(SHLIBINSTALL)
-	$(INSTALL) -d $(libdir)
-	$(INSTALL_DATA) libnettle.a $(libdir)
+install-here: install-info install-headers libnettle.a $(SHLIBINSTALL)
+	$(INSTALL) -d $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) libnettle.a $(DESTDIR)$(libdir)
 
 install-shared: $(SHLIBFORLINK)
-	$(INSTALL) -d $(libdir)
-	$(INSTALL_DATA) $(SHLIBFORLINK) $(libdir)/$(SHLIBFILE)
+	$(INSTALL) -d $(DESTDIR)$(libdir)
+	$(INSTALL_DATA) $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE)
 	[ -z "$(SHLIBSONAME)" ] \
-                || (cd $(libdir) \
+                || (cd $(DESTDIR)$(libdir) \
 		&& ln -sf $(SHLIBFILE) $(SHLIBSONAME) \
 		&& ln -sf $(SHLIBFILE) $(SHLIBFORLINK) )
 
 install-info: nettle.info
-	$(INSTALL) -d $(infodir)
-	$(INSTALL_DATA) $< $(infodir) ; \
+	$(INSTALL) -d $(DESTDIR)$(infodir)
+	$(INSTALL_DATA) $< $(DESTDIR)$(infodir)
 	if (install-info --version && \
 	    install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
-	  install-info --info-dir="$(infodir)" $< ; \
+	  install-info --info-dir="$(DESTDIR)$(infodir)" $< ; \
 	else : ; fi
 
 install-headers: $(INSTALL_HEADERS)
-	$(INSTALL) -d $(includedir)/nettle
-	$(INSTALL_DATA) $^ $(includedir)/nettle
+	$(INSTALL) -d $(DESTDIR)$(includedir)/nettle
+	$(INSTALL_DATA) $^ $(DESTDIR)$(includedir)/nettle
+
+# Uninstall
+uninstall-here: uninstall-info uninstall-headers uninstall-shared
+	rm -f $(DESTDIR)$(libdir)/libnettle.a
+
+uninstall-headers:
+	for f in $(INSTALL_HEADERS) ; do \
+	  rm -f $(DESTDIR)$(includedir)/nettle/$$f ; \
+	done
+
+uninstall-info:
+	if (install-info --version && \
+	    install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
+	  install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)"/nettle.info ; \
+	else : ; fi
+	-rm -f $(DESTDIR)$(infodir)/nettle.info
+
+# FIXME: Leaves the links around
+uninstall-shared:
+	test -z "$(SHLIBINSTALL)" || rm -f $(DESTDIR)$(libdir)/$(SHLIBFILE)
 
 # Distribution
 distdir = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
@@ -260,17 +296,34 @@ distcheck: dist
 	  | { cd distcheck-tmp && tar xf - && chmod -R a-w $(distdir) ; }
 	mkdir distcheck-tmp/build
 	mkdir distcheck-tmp/install
-	cd distcheck-tmp/build && ../$(distdir)/configure --prefix=`cd ../install && pwd`
+	cd distcheck-tmp/build && ../$(distdir)/configure --prefix="`cd ../install && pwd`"
 	cd distcheck-tmp/build && $(MAKE)
 	cd distcheck-tmp/build && $(MAKE) check
 	cd distcheck-tmp/build && $(MAKE) install
+	cd distcheck-tmp/build && $(MAKE) uninstall
+	cd distcheck-tmp && find install -type f -print > leftover-install-files
+	@test `cat distcheck-tmp/leftover-install-files | wc -l` -le 1  \
+	  || { echo "ERROR: files left after uninstall:" ; \
+	       cat distcheck-tmp/leftover-install-files ; \
+	       exit 1; }
+	chmod -R a-w distcheck-tmp/install
+	mkdir distcheck-tmp/destdir
+	destdir="`cd distcheck-tmp/destdir && pwd`" \
+	  && cd distcheck-tmp/build \
+	  && $(MAKE) install DESTDIR="$$destdir" \
+	  && $(MAKE) uninstall DESTDIR="$$destdir"
+	cd distcheck-tmp && find destdir -type f -print > leftover-destdir-files
+	@test `cat distcheck-tmp/leftover-destdir-files | wc -l` -le 1  \
+	  || { echo "ERROR: destdir files left after uninstall:" ; \
+	       cat distcheck-tmp/leftover-destdir-files ; \
+	       exit 1; }	
 	cd distcheck-tmp/build && $(MAKE) dist
 	cd distcheck-tmp/build && rm *.gz
 	cd distcheck-tmp/build && $(MAKE) distclean
-	cd distcheck-tmp && find build -type f -print > leftover-files
-	@test `cat distcheck-tmp/leftover-files | wc -l` -eq 0  \
+	cd distcheck-tmp && find build -type f -print > leftover-build-files
+	@test `cat distcheck-tmp/leftover-build-files | wc -l` -eq 0  \
 	  || { echo "ERROR: files left in build directory after distclean:" ; \
-	       cat distcheck-tmp/leftover-files ; \
+	       cat distcheck-tmp/leftover-build-files ; \
 	       exit 1; }
 	$(rm_distcheck)