2 include $(TOP)/mk/boilerplate.mk
13 LIBRARY = libghccompat.a
15 # Just to silence warnings
16 MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
20 # This library is linked to the compiler, at least in stage1, so we
21 # better make sure it is built the same "way".
23 # BUT, if GhcHcOpts includes -DDEBUG we *don't* want to compile
24 # lib/compat with -DDEBUG, because the preprocessor symbols used
25 # by the compiler may be understood differently by library code.
26 # In this particular case, it turned out that -DDEBUG made Cabal
27 # import HUnit, which might not be installed for the compiler we are
28 # compiling with (e.g. 6.2.1). Hence the filter-out.
29 SRC_HC_OPTS += $(filter-out -D%, $(GhcHcOpts))
31 ifeq "$(ghc_ge_603)" "YES"
32 # These modules are all provided in GHC 6.3+
34 System/Directory/Internals.hs \
35 Distribution/Compat/ReadP.hs \
36 Distribution/Extension.hs \
37 Distribution/GetOpt.hs \
38 Distribution/InstalledPackageInfo.hs \
39 Distribution/License.hs \
40 Distribution/Package.hs \
41 Distribution/ParseUtils.hs \
42 Distribution/Setup.hs \
43 Distribution/Version.hs
46 # Some explicit dependencies
47 System/Directory/Internals.$(way_)o : $(FPTOOLS_TOP)/libraries/base/System/Directory/Internals.hs
48 Distribution/Compat/ReadP.$(way_) : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compat/ReadP.hs
49 Distribution/Extension.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Extension.hs
50 Distribution/GetOpt.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/GetOpt.hs
51 Distribution/InstalledPackageInfo.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/InstalledPackageInfo.hs
52 Distribution/License.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/License.hs
53 Distribution/Package.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Package.hs
54 Distribution/ParseUtils.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/ParseUtils.hs
55 Distribution/Setup.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Setup.hs
56 Distribution/Version.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Version.hs
58 # Make the #includes in the stubs independent of the current location
59 SRC_HC_OPTS += -I$(FPTOOLS_TOP)/libraries
61 SRC_HC_OPTS += -fglasgow-exts -no-recomp
63 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
64 Compat/Directory_HC_OPTS += -\#include shlobj.h
67 # libghccompat is needed to build ghc-pkg, which is built during 'make boot',
68 # so we must build this library during 'make boot' too.
69 # Do a recursive 'make all' after generating dependencies, because this
70 # will work with 'make -j'.
71 ifneq "$(BootingFromHc)" "YES"
76 # We don't ever want to build libghccompat as a shared library.
79 include $(TOP)/mk/target.mk