- (cd lib/$(platform); find . -type d -exec sh -c '$(INSTALL_DIR) $$0 $(libdir)/$$0' {} \; )
- (cd share; find . -type d -exec sh -c '$(INSTALL_DIR) $(datadir)/$$0' {} \; )
-
-install :: install-dirs install-driver install-utils install-libs install-datas install-docs postinstall denounce
-
-.PHONY: install-libs install-utils install-datas postinstall denounce
+ $(INSTALL_DIR) $(datadir)
+ echo "[]" > $(datadir)/package.conf
+
+install::
+ $(MAKE) -C includes install DOING_BIN_DIST=YES
+ $(MAKE) -C utils install DOING_BIN_DIST=YES
+ $(MAKE) -C rts install DOING_BIN_DIST=YES
+ $(MAKE) -C libraries install DOING_BIN_DIST=YES
+ $(MAKE) -C libffi install DOING_BIN_DIST=YES
+ $(MAKE) -C compiler install DOING_BIN_DIST=YES
+ $(MAKE) -C ghc install DOING_BIN_DIST=YES
+ $(MAKE) -C driver install DOING_BIN_DIST=YES
+ $(MAKE) -C gmp install DOING_BIN_DIST=YES
+ $(MAKE) -C docs install-docs DOING_BIN_DIST=YES
+ $(MAKE) -C libraries/Cabal/doc install-docs DOING_BIN_DIST=YES
+ $(INSTALL_DATA) $(INSTALL_OPTS) settings $(libdir)
+
+install :: postinstall denounce
+
+# Look to see if $(bindir) is in $(PATH). Assumes there are no funky
+# characters.
+GREPPED_PATH=$(shell echo ":$(PATH):" | grep ":$(bindir):")