[project @ 2005-03-01 16:20:27 by simonmar]
[ghc-hetmet.git] / ghc / utils / hsc2hs / Makefile
index dee4085..4716d9a 100644 (file)
@@ -13,6 +13,11 @@ INSTALLING=1
 SRC_HC_OPTS += -i$(GHC_LIB_COMPAT_DIR)
 SRC_LD_OPTS += -L$(GHC_LIB_COMPAT_DIR) -lghccompat
 
+# This is required because libghccompat.a must be built with
+# $(GhcHcOpts) because it is linked to the compiler, and hence
+# we must also build with $(GhcHcOpts) here:
+SRC_HC_OPTS += $(GhcHcOpts)
+
 HS_PROG           = hsc2hs-bin
 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
 HS_PROG           = hsc2hs$(exeext)
@@ -21,8 +26,6 @@ ifeq "$(HOSTPLATFORM)" "i386-unknown-cygwinw32"
 HS_PROG           = hsc2hs$(exeext)
 endif
 
-ghc_ge_504 = $(shell if (test $(GhcCanonVersion) -ge 504); then echo YES; else echo NO; fi)
-
 ifeq "$(ghc_ge_504)" "NO"
 SRC_HC_OPTS +=  -package util
 endif
@@ -31,9 +34,6 @@ endif
 # for calling the C preprocessor via GHC has changed a few times, making a
 # clean solution impossible. So we revert to a hack in Main.hs...
 SRC_HC_OPTS      += -Wall
-ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
-SRC_HC_OPTS      += -Dmingw32_HOST_OS=1
-endif
 
 ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
 INSTALLED_SCRIPT_PROG  = hsc2hs
@@ -87,6 +87,22 @@ endif
 override datadir=$(libdir)
 INSTALL_DATAS += template-hsc.h
 
+# This is horrible.  We ought to be able to omit the entire directory
+# from mkDependHS.
+SRC_MKDEPENDHS_OPTS += \
+       -optdep--exclude-module=Compat.RawSystem \
+       -optdep--exclude-module=Compat.Directory \
+       -optdep--exclude-module=Distribution.Compat.ReadP \
+       -optdep--exclude-module=Distribution.Extension \
+       -optdep--exclude-module=Distribution.GetOpt \
+       -optdep--exclude-module=Distribution.InstalledPackageInfo \
+       -optdep--exclude-module=Distribution.License \
+       -optdep--exclude-module=Distribution.Package \
+       -optdep--exclude-module=Distribution.ParseUtils \
+       -optdep--exclude-module=Distribution.Setup \
+       -optdep--exclude-module=Distribution.Version \
+       -optdep--exclude-module=System.Directory.Internals
+
 # -----------------------------------------------------------------------------
 # don't recurse on 'make install'
 #