[project @ 2004-11-26 16:19:45 by simonmar]
[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         System \
10         cbits
11
12 LIBRARY = libghccompat.a
13
14 # Just to silence warnings
15 MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
16
17 UseGhcForCc = YES
18
19 ghc_603_plus = $(shell if (test $(GhcCanonVersion) -ge 603); then echo YES; else echo NO; fi)
20
21 ifeq "$(ghc_603_plus)" "YES"
22 # These modules are all provided in GHC 6.3+
23 EXCLUDED_SRCS += \
24         Data/Version.hs \
25         System/FilePath.hs \
26         Distribution/Compat/Error.hs \
27         Distribution/Compat/ReadP.hs \
28         Distribution/Extension.hs \
29         Distribution/InstalledPackageInfo.hs \
30         Distribution/License.hs \
31         Distribution/Package.hs \
32         Distribution/ParseUtils.hs \
33         Distribution/Setup.hs \
34         Distribution/Version.hs
35 endif
36
37 # Some explicit dependencies
38 Data/Version.$(way_)o :  $(FPTOOLS_TOP)/libraries/base/Data/Version.hs
39 System/FilePath.$(way_)o : $(FPTOOLS_TOP)/libraries/base/System/FilePath.hs
40 Distribution/Compat/Error.$(way_)o : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compat/Error.hs
41 Distribution/Compat/ReadP.$(way_) : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Compat/ReadP.hs
42 Distribution/Extension.$(way_)o    : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Extension.hs
43 Distribution/InstalledPackageInfo.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/InstalledPackageInfo.hs
44 Distribution/License.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/License.hs
45 Distribution/Package.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Package.hs
46 Distribution/ParseUtils.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/ParseUtils.hs
47 Distribution/Setup.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Setup.hs
48 Distribution/Version.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Version.hs
49
50 # Make the #includes in the stubs independent of the current location
51 SRC_HC_OPTS += -I$(FPTOOLS_TOP)/libraries
52
53 SRC_HC_OPTS +=  -fglasgow-exts -no-recomp
54
55 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
56 Compat/Directory_HC_OPTS += -\#include shlobj.h
57 endif
58
59 # libghccompat is needed to build ghc-pkg, which is built during 'make boot',
60 # so we must build this library during 'make boot' too.
61 # Do a recursive 'make all' after generating dependencies, because this
62 # will work with 'make -j'.
63 ifneq "$(BootingFromHc)" "YES"
64 boot :: depend
65         $(MAKE) all
66 endif
67
68 include $(TOP)/mk/target.mk