2 include $(TOP)/mk/boilerplate.mk
15 LIBRARY = libghccompat.a
17 # We don't want this installed
18 NO_INSTALL_LIBRARY = YES
20 # Needed so that the libraries can #include relative to this directory.
21 INCLUDE_DIRS=-I. -Iinclude
23 SRC_HC_OPTS += $(INCLUDE_DIRS)
24 SRC_CC_OPTS += $(INCLUDE_DIRS)
25 MKDEPENDC_OPTS += $(INCLUDE_DIRS)
27 # Just to silence warnings
28 MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
32 # This library is linked to the compiler, at least in stage1, so we
33 # better make sure it is built the same "way".
35 # BUT, if GhcHcOpts includes -DDEBUG we *don't* want to compile
36 # lib/compat with -DDEBUG, because the preprocessor symbols used
37 # by the compiler may be understood differently by library code.
38 # In this particular case, it turned out that -DDEBUG made Cabal
39 # import HUnit, which might not be installed for the compiler we are
40 # compiling with (e.g. 6.2.1). Hence the filter-out.
41 SRC_HC_OPTS += $(filter-out -D%, $(GhcHcOpts))
43 ifeq "$(ghc_ge_603)" "YES"
44 # These modules are all provided in GHC 6.3+
46 System/Directory/Internals.hs \
47 Distribution/Compat/FilePath.hs \
48 Distribution/Compat/ReadP.hs \
49 Distribution/GetOpt.hs \
50 Distribution/InstalledPackageInfo.hs \
51 Distribution/License.hs \
52 Distribution/Package.hs \
53 Distribution/ParseUtils.hs \
54 Distribution/Compiler.hs \
55 Distribution/Version.hs \
56 Language/Haskell/Extension.hs
58 SRC_MKDEPENDHS_OPTS += \
59 -optdep--exclude-module=System.Directory.Internals \
60 -optdep--exclude-module=Distribution.Compat.FilePath \
61 -optdep--exclude-module=Distribution.Compat.ReadP \
62 -optdep--exclude-module=Distribution.GetOpt \
63 -optdep--exclude-module=Distribution.InstalledPackageInfo \
64 -optdep--exclude-module=Distribution.License \
65 -optdep--exclude-module=Distribution.Package \
66 -optdep--exclude-module=Distribution.ParseUtils \
67 -optdep--exclude-module=Distribution.Compiler \
68 -optdep--exclude-module=Distribution.Version \
69 -optdep--exclude-module=Language.Haskell.Extension
72 # Some explicit dependencies
73 System/Directory/Internals.$(way_)o : $(FPTOOLS_TOP)/libraries/base/System/Directory/Internals.hs
74 Distribution/Compat/ReadP.$(way_) : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compat/ReadP.hs
75 Distribution/GetOpt.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/GetOpt.hs
76 Distribution/InstalledPackageInfo.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/InstalledPackageInfo.hs
77 Distribution/License.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/License.hs
78 Distribution/Package.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Package.hs
79 Distribution/ParseUtils.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/ParseUtils.hs
80 Distribution/Compiler.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compiler.hs
81 Distribution/Version.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Version.hs
82 Language/Haskell/Extension.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Language/Haskell/Extension.hs
84 # Make the #includes in the stubs independent of the current location
85 SRC_HC_OPTS += -I$(FPTOOLS_TOP)/libraries
87 SRC_HC_OPTS += -fglasgow-exts -no-recomp
89 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
90 Compat/Directory_HC_OPTS += -\#include shlobj.h
93 # libghccompat is needed to build ghc-pkg, which is built during 'make boot',
94 # so we must build this library during 'make boot' too.
95 # Do a recursive 'make all' after generating dependencies, because this
96 # will work with 'make -j'.
97 ifneq "$(BootingFromHc)" "YES"
102 # We don't ever want to build libghccompat as a shared library.
105 include $(TOP)/mk/target.mk