-#-----------------------------------------------------------------------------
-# FPtools Utility locations
-
-# By default, the various utils needed to be build ghc and chums
-# is set up to point to the utils/ directory. Define here the
-# path prefix for the utilities. Notice that it's a prefix with
-# a trailing slash, so that it can be concatenated directly on
-# front of a program name; if it's not set then we just look
-# along the shell's $(PATH)
-#
-# If instead you want to use installed or your own versions of these,
-# override the various *_PREFIX in build.mk, i.e., having the following
-# in build.mk:
-#
-# MKDEPENDC_PREFIX=
-#
-# will force `make' to rummage around in your PATH to find `mkdependC' (not
-# sure it would need it in the first place, but still).
-#
-GLAFP_UTILS = $(FPTOOLS_TOP)/glafp-utils
-
-SCRIPT_PREFIX = $(GLAFP_UTILS)/scripts/
-MKDEPENDC_PREFIX = $(GLAFP_UTILS)/mkdependC/
-LTX_PREFIX = $(GLAFP_UTILS)/ltx/
-RUNTEST_PREFIX = $(GLAFP_UTILS)/runstdtest/
-VERBATIM_PREFIX = $(GLAFP_UTILS)/verbatim/
-SGMLVERB_PREFIX = $(GLAFP_UTILS)/sgmlverb/
-ETAGS_PREFIX = $(GLAFP_UTILS)/etags/
-MSUB_PREFIX = $(GLAFP_UTILS)/msub/
-LNDIR_PREFIX = $(GLAFP_UTILS)/lndir/
-MKDIRHIER_PREFIX = $(GLAFP_UTILS)/mkdirhier/
-DOCBOOK_PREFIX = $(GLAFP_UTILS)/docbook/
-
-LITERATE_PREFIX = $(FPTOOLS_TOP)/literate/
+# Here we provide defines for the various directories in the source tree,
+# so we can move things around more easily. A define $(GHC_FOO_DIR_REL)
+# indicates a directory relative to the top of the source tree, whereas
+# $(GHC_FOO_DIR) is a directory relative to the current directory.
+# $(GHC_FOO_DIR_ABS) is the absolute path to the directory.
+
+GHC_UTILS_DIR_REL = utils
+GHC_INCLUDE_DIR_REL = includes
+GHC_COMPILER_DIR_REL = compiler
+GHC_RTS_DIR_REL = rts
+GHC_UTILS_DIR_REL = utils
+GHC_DRIVER_DIR_REL = driver
+GHC_COMPAT_DIR_REL = compat
+
+GHC_MKDEPENDC_DIR_REL = $(GHC_UTILS_DIR_REL)/mkdependC
+GHC_LTX_DIR_REL = $(GHC_UTILS_DIR_REL)/ltx
+GHC_RUNTEST_DIR_REL = $(GHC_UTILS_DIR_REL)/runstdtest
+GHC_LNDIR_DIR_REL = $(GHC_UTILS_DIR_REL)/lndir
+GHC_MKDIRHIER_DIR_REL = $(GHC_UTILS_DIR_REL)/mkdirhier
+GHC_DOCBOOK_DIR_REL = $(GHC_UTILS_DIR_REL)/docbook
+GHC_UNLIT_DIR_REL = $(GHC_UTILS_DIR_REL)/unlit
+GHC_HP2PS_DIR_REL = $(GHC_UTILS_DIR_REL)/hp2ps
+GHC_HSTAGS_DIR_REL = $(GHC_UTILS_DIR_REL)/hasktags
+GHC_HSC2HS_DIR_REL = $(GHC_UTILS_DIR_REL)/hsc2hs
+GHC_TOUCHY_DIR_REL = $(GHC_UTILS_DIR_REL)/touchy
+GHC_PKG_DIR_REL = $(GHC_UTILS_DIR_REL)/ghc-pkg
+GHC_GENPRIMOP_DIR_REL = $(GHC_UTILS_DIR_REL)/genprimopcode
+GHC_GENAPPLY_DIR_REL = $(GHC_UTILS_DIR_REL)/genapply
+
+GHC_MANGLER_DIR_REL = $(GHC_DRIVER_DIR_REL)/mangler
+GHC_SPLIT_DIR_REL = $(GHC_DRIVER_DIR_REL)/split
+GHC_SYSMAN_DIR_REL = $(GHC_RTS_DIR_REL)/parallel
+
+GHC_UTILS_DIR = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
+GHC_INCLUDE_DIR = $(FPTOOLS_TOP)/$(GHC_INCLUDE_DIR_REL)
+GHC_COMPILER_DIR = $(FPTOOLS_TOP)/$(GHC_COMPILER_DIR_REL)
+GHC_RTS_DIR = $(FPTOOLS_TOP)/$(GHC_RTS_DIR_REL)
+GHC_UTILS_DIR = $(FPTOOLS_TOP)/$(GHC_UTILS_DIR_REL)
+GHC_DRIVER_DIR = $(FPTOOLS_TOP)/$(GHC_DRIVER_DIR_REL)
+GHC_COMPAT_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IR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_GENPRIMOP_DIR_REL)
+GHC_GENAPPLY_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_GENAPPLY_DIR_REL)
+
+GHC_MANGLER_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_MANGLER_DIR_REL)
+GHC_SYSMAN_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_SYSMAN_DIR_REL)
+GHC_SPLIT_DIR_ABS = $(FPTOOLS_TOP_ABS)/$(GHC_SPLIT_DIR_REL)
+
+# -----------------------------------------------------------------------------
+# Names of programs in the GHC tree
+#
+# xxx_PGM the name of an executable, without the path
+# xxx the executable relative to the current dir
+
+GHC_UNLIT_PGM = unlit$(exeext)
+GHC_HP2PS_PGM = hp2ps
+GHC_HSTAGS_PGM = hasktags
+GHC_HSC2HS_INPLACE_PGM = hsc2hs-inplace
+GHC_TOUCHY_PGM = touchy$(exeext)
+GHC_MANGLER_PGM = ghc-asm
+GHC_SPLIT_PGM = ghc-split
+GHC_SYSMAN_PGM = SysMan
+GHC_PKG_INPLACE_PGM = ghc-pkg-inplace
+GHC_GENPRIMOP_PGM = genprimopcode
+GHC_GENAPPLY_PGM = genapply
+GHC_MKDEPENDC_PGM = mkdependC
+GHC_LTX_PGM = ltx
+GHC_MKDIRHIER_PGM = mkdirhier
+GHC_LNDIR_PGM = lndir
+GHC_RUNTEST_PGM = runstdtest