[project @ 2005-01-31 14:53:13 by simonpj]
[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         System/Directory \
11         cbits
12
13 LIBRARY = libghccompat.a
14
15 # Just to silence warnings
16 MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR)
17
18 UseGhcForCc = YES
19
20 # This library is linked to the compiler, at least in stage1, so we
21 # better make sure it is built the same "way":
22 SRC_HC_OPTS += $(GhcHcOpts)
23
24 ifeq "$(ghc_ge_603)" "YES"
25 # These modules are all provided in GHC 6.3+
26 EXCLUDED_SRCS += \
27         System/Directory/Internals.hs \
28         Distribution/Compat/ReadP.hs \
29         Distribution/Extension.hs \
30         Distribution/GetOpt.hs \
31         Distribution/InstalledPackageInfo.hs \
32         Distribution/License.hs \
33         Distribution/Package.hs \
34         Distribution/ParseUtils.hs \
35         Distribution/Setup.hs \
36         Distribution/Version.hs
37 endif
38
39 # Some explicit dependencies
40 System/Directory/Internals.$(way_)o : $(FPTOOLS_TOP)/libraries/base/System/Directory/Internals.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/GetOpt.$(way_)o    : $(FPTOOLS_TOP)/libraries/Cabal/Distribution/GetOpt.hs
44 Distribution/InstalledPackageInfo.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/InstalledPackageInfo.hs
45 Distribution/License.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/License.hs
46 Distribution/Package.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Package.hs
47 Distribution/ParseUtils.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/ParseUtils.hs
48 Distribution/Setup.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Setup.hs
49 Distribution/Version.$(way_)o :  $(FPTOOLS_TOP)/libraries/Cabal/Distribution/Version.hs
50
51 # Make the #includes in the stubs independent of the current location
52 SRC_HC_OPTS += -I$(FPTOOLS_TOP)/libraries
53
54 SRC_HC_OPTS +=  -fglasgow-exts -no-recomp
55
56 ifeq "$(HOSTPLATFORM)" "i386-unknown-mingw32"
57 Compat/Directory_HC_OPTS += -\#include shlobj.h
58 endif
59
60 # libghccompat is needed to build ghc-pkg, which is built during 'make boot',
61 # so we must build this library during 'make boot' too.
62 # Do a recursive 'make all' after generating dependencies, because this
63 # will work with 'make -j'.
64 ifneq "$(BootingFromHc)" "YES"
65 boot :: depend
66         $(MAKE) all
67 endif
68
69 # We don't ever want to build libghccompat as a shared library.
70 GhcBuildDylibs=NO
71
72 include $(TOP)/mk/target.mk