62d172663d3e55101f16798c1082dc4c3271167d
[ghc-hetmet.git] / ghc / lib / compat / Makefile
1 TOP=../..
2 include $(TOP)/mk/boilerplate.mk
3
4 ALL_DIRS = \
5         Data \
6         Compat \
7         Distribution \
8         Distribution/Compat \
9         cbits
10
11 LIBRARY = libghccompat.a
12
13 # Just to silence warnings
14 MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
15
16 UseGhcForCc = YES
17
18 ghc_603_plus = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
19
20 ifeq "$(ghc_603_plus)" "YES"
21 # These modules are all provided in GHC 6.3+
22 EXCLUDED_SRCS += \
23         Data/Version.hs \
24         Distribution/Compat/Error.hs \
25         Distribution/Compat/ReadP.hs \
26         Distribution/Extension.hs \
27         Distribution/InstalledPackageInfo.hs \
28         Distribution/License.hs \
29         Distribution/Package.hs \
30         Distribution/ParseUtils.hs \
31         Distribution/Setup.hs \
32         Distribution/Version.hs
33 endif
34
35 # Make the #includes in the stubs independent of the current location
36 SRC_HC_OPTS += -I$(FPTOOLS_TOP)/libraries
37
38 SRC_HC_OPTS +=  -fglasgow-exts
39
40 # libghccompat is needed to build ghc-pkg, which is built during 'make boot',
41 # so we must build this library during 'make boot' too.
42 # Do a recursive 'make all' after generating dependencies, because this
43 # will work with 'make -j'.
44 ifneq "$(BootingFromHc)" "YES"
45 boot :: depend
46         $(MAKE) all
47 endif
48
49 include $(TOP)/mk/target.mk