+DerivedConstants.h :
+ @echo "*** Cross-compiling: please copy DerivedConstants.h from the target system"
+ @exit 1
+
+else
+
+mkDerivedConstants.c : $(H_CONFIG)
+
+mkDerivedConstantsHdr : mkDerivedConstants.o
+ $(CC) -o $@ $(CC_OPTS) $(LD_OPTS) mkDerivedConstants.o
+
+DerivedConstants.h : mkDerivedConstantsHdr
+ ./mkDerivedConstantsHdr >$@
+
+endif
+
+CLEAN_FILES += mkDerivedConstantsHdr$(exeext) DerivedConstants.h
+
+# -----------------------------------------------------------------------------
+#
+
+all :: GHCConstants.h
+
+ifneq "$(TARGETPLATFORM)" "$(HOSTPLATFORM)"
+
+GHCConstants.h :
+ @echo "*** Cross-compiling: please copy DerivedConstants.h from the target system"
+ @exit 1
+
+else
+
+mkGHCConstants : mkGHCConstants.o
+ $(CC) -o $@ $(CC_OPTS) $(LD_OPTS) mkGHCConstants.o
+
+mkGHCConstants.o : mkDerivedConstants.c
+ $(CC) -o $@ $(CC_OPTS) -c $< -DGEN_HASKELL
+
+GHCConstants.h : mkGHCConstants
+ ./mkGHCConstants >$@
+
+endif