081ea7828f6183be78495f62906d5eaeadbdc49d
[ghc-hetmet.git] / ghc / lib / compat / Makefile
1
2 # This library contains modules only available in versions of GHC
3 # newer than the current one.  They are implemented as stubs that
4 # #include the actual code from fptools/libraries.
5 #
6 # The idea is to ease the task of writing portable code in GHC and its
7 # tools: the client can link with libghccompat.a and assume that all
8 # the modules are available.  In this way we can add modules to the library
9 # and start using them right away in GHC, as long as the new library modules
10 # can be compiled using older versions of GHC.
11 #
12
13 TOP=../..
14 include $(TOP)/mk/boilerplate.mk
15
16 ALL_DIRS = \
17         Data \
18         Compat \
19         Distribution \
20         Distribution/Compat \
21         cbits
22
23 LIBRARY = libghccompat.a
24
25 # Just to silence warnings
26 MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
27
28 UseGhcForCc = YES
29
30 ghc_603_plus = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
31
32 ifeq "$(ghc_603_plus)" "YES"
33 # These modules are all provided in GHC 6.3+
34 EXCLUDED_SRCS += \
35         Data/Version.hs \
36         Distribution/Compat/Error.hs \
37         Distribution/Compat/ReadP.hs \
38         Distribution/Extension.hs \
39         Distribution/InstalledPackageInfo.hs \
40         Distribution/License.hs \
41         Distribution/Package.hs \
42         Distribution/ParseUtils.hs \
43         Distribution/Setup.hs \
44         Distribution/Version.hs
45 endif
46
47 # Make the #includes in the stubs independent of the current location
48 SRC_HC_OPTS += -I$(FPTOOLS_TOP)/libraries
49
50 SRC_HC_OPTS +=  -fglasgow-exts
51
52 include $(TOP)/mk/target.mk