Reinstate the driver/ghc directory, to create a versioned GHC program
[ghc-hetmet.git] / driver / Makefile
index 3a87ab4..0eb10c6 100644 (file)
@@ -9,20 +9,28 @@ include $(TOP)/mk/boilerplate.mk
 
 SUBDIRS = mangler split ghc ghci
 
-boot all :: package.conf.inplace package.conf
+INPLACE_PKG_CONF = $(INPLACE_DATA_DIR)/package.conf
+# Used to signal that we are inplace, as opposed to installed:
+INPLACE_FILE     = $(INPLACE_DATA_DIR)/inplace
 
-package.conf.inplace :
-       echo "[]" > $@
+boot all ::
+       $(MKDIRHIER) $(INPLACE_DATA_DIR)
+       test -f $(INPLACE_PKG_CONF) || echo "[]" > $(INPLACE_PKG_CONF)
+       touch $(INPLACE_FILE)
 
-package.conf :
-       echo "[]" > $@
-
-override datadir = $(libdir)
-INSTALL_DATAS += package.conf ghc-usage.txt ghci-usage.txt
+INSTALL_DATAS += ghc-usage.txt ghci-usage.txt
 
 # Since cleaning effectively uninstalls all the packages, we must 
 # remove the stamp files that the build system uses to avoid unnecessarily
-# re-installing packages.
-CLEAN_FILES += package.conf* stamp-pkg-conf*
+# re-installing the RTS
+CLEAN_FILES += stamp-pkg-conf-rts
+
+binary-dist:
+ifeq "$(WHERE_AM_I)" ""
+       echo "I don't know where I am" >&2
+       exit 1
+endif
+       for FILE in Makefile $(INSTALL_DATAS); do echo $(WHERE_AM_I)/$$FILE >> $(BIN_DIST_LIST); done
+       set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d binary-dist WHERE_AM_I=$(WHERE_AM_I)/$$d; done
 
 include $(TOP)/mk/target.mk