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 provided in GHC 6.3+
46 System/Directory/Internals.hs
48 SRC_MKDEPENDHS_OPTS += \
49 -optdep--exclude-module=System.Directory.Internals
51 # GHC 6.3+ has Cabal, but we're replacing it:
52 SRC_HC_OPTS += -ignore-package Cabal
55 # Some explicit dependencies, needed because ghc -M can't discover the
56 # true dependencies of these stub files.
57 System/Directory/Internals.$(way_)o : $(FPTOOLS_TOP)/libraries/base/System/Directory/Internals.hs
58 Distribution/Compat/FilePath.$(way_) : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compat/FilePath.hs
59 Distribution/Compat/ReadP.$(way_) : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compat/ReadP.hs
60 Distribution/GetOpt.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/GetOpt.hs
61 Distribution/InstalledPackageInfo.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/InstalledPackageInfo.hs
62 Distribution/License.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/License.hs
63 Distribution/Package.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Package.hs
64 Distribution/ParseUtils.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/ParseUtils.hs
65 Distribution/Compiler.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compiler.hs
66 Distribution/Version.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Version.hs
67 Language/Haskell/Extension.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Language/Haskell/Extension.hs
69 # Make the #includes in the stubs independent of the current location
70 SRC_HC_OPTS += -I$(FPTOOLS_TOP)/libraries
72 SRC_HC_OPTS += -fglasgow-exts -no-recomp
74 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
75 Compat/Directory_HC_OPTS += -\#include shlobj.h
78 # libghccompat is needed to build ghc-pkg, which is built during 'make boot',
79 # so we must build this library during 'make boot' too.
80 # Do a recursive 'make all' after generating dependencies, because this
81 # will work with 'make -j'.
82 ifneq "$(BootingFromHc)" "YES"
87 # We don't ever want to build libghccompat as a shared library.
90 include $(TOP)/mk/target.mk