bump version to 2.0
[ghc.git] / libraries / base / Makefile
1 TOP=..
2 include $(TOP)/mk/boilerplate.mk
3
4 # -----------------------------------------------------------------------------
5
6 SUBDIRS = cbits include
7
8 ALL_DIRS = \
9 Control \
10 Control/Concurrent \
11 Control/Parallel \
12 Control/Monad \
13 Control/Monad/ST \
14 Data \
15 Data/ByteString \
16 Data/ByteString/Lazy \
17 Data/Generics \
18 Data/Array \
19 Data/Array/IO \
20 Data/STRef \
21 Debug \
22 Foreign \
23 Foreign/C \
24 Foreign/Marshal \
25 GHC \
26 System \
27 System/Console \
28 System/Mem \
29 System/IO \
30 System/Posix \
31 System/Process \
32 System/Directory \
33 Text \
34 Text/Html \
35 Text/PrettyPrint \
36 Text/ParserCombinators \
37 Text/Regex \
38 Text/Show \
39 Text/Read
40
41 PACKAGE = base
42 VERSION = 2.0
43
44 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -"\#include" HsBase.h
45 SRC_HSC2HS_OPTS += -Iinclude -I$(GHC_INCLUDE_DIR)
46
47 # -----------------------------------------------------------------------------
48 # Per-module flags
49
50 # ESSENTIAL, for getting reasonable performance from the I/O library:
51 SRC_HC_OPTS += -funbox-strict-fields
52
53 # -----------------------------------------------------------------------------
54 # PrimOpWrappers
55
56 # These two lines are required for pre-processing compiler/prelude/primops.txt
57 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
58 SRC_CPP_OPTS += ${GhcCppOpts}
59
60 ifeq "$(BootingFromHc)" "YES"
61 GHC/PrimopWrappers.hs: GHC/Prim.hs
62 touch GHC/PrimopWrappers.hs
63 else
64 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt GHC/Prim.hs
65 @$(RM) $@
66 $(GENPRIMOP) --make-haskell-wrappers < $< > $@
67 endif
68
69 GHC/Prim.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
70 @$(RM) $@
71 $(GENPRIMOP) --make-haskell-source < $< > $@
72
73 EXCLUDED_SRCS = GHC/Prim.hs
74 EXTRA_HADDOCK_SRCS = GHC/Prim.hs
75
76 boot :: GHC/PrimopWrappers.hs
77
78 EXTRA_SRCS += GHC/PrimopWrappers.hs
79 CLEAN_FILES += GHC/PrimopWrappers.hs
80
81 # -----------------------------------------------------------------------------
82 ifneq "$(BootingFromHc)" "YES"
83 STUBOBJS += \
84 Control/Concurrent_stub.$(way_)o
85
86 CLEAN_FILES += $(STUBOBJS) \
87 Control/Concurrent_stub.[ch]
88 endif
89
90 #-----------------------------------------------------------------------------
91 # Building the library for GHCi
92 #
93 # The procedure differs from that in fptools/mk/target.mk in one way:
94 # (*) on Win32 we must split it into two, because a single .o file can't
95 # have more than 65536 relocations in it [due to a bug in the GNU
96 # linker.]
97
98 OBJECT_FILEFORMAT=unknown
99 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
100 OBJECT_FILEFORMAT=PEi
101 endif
102 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
103 OBJECT_FILEFORMAT=PEi
104 endif
105
106 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
107
108 # Turn off standard rule which creates HSbase.o from LIBOBJS.
109 #DONT_WANT_STD_GHCI_LIB_RULE=YES
110
111 GHCI_LIBOBJS = $(HS_OBJS)
112
113 INSTALL_LIBS += HSbase.o
114
115 endif # OBJECT_FILEFORMAT = PEi
116
117
118 # -----------------------------------------------------------------------------
119 # Doc building with Haddock
120
121 EXCLUDED_HADDOCK_SRCS = \
122 GHC/PrimopWrappers.hs \
123 GHC/PArr.hs
124
125 SRC_HADDOCK_OPTS += -t "Haskell Hierarchical Libraries ($(PACKAGE) package)" \
126 --no-implicit-prelude
127
128 # -----------------------------------------------------------------------------
129
130 GHC/ForeignPtr.o Data/Array/IO/Internals.o Data/Array/Base.o \
131 Data/Generics/Instances.o Data/Complex.o Data/Array.o Data/STRef.o \
132 Data/Dynamic.o Data/Typeable.o Data/PackedString.o System/Mem/Weak.o \
133 System/Mem/StableName.o System/Posix/Types.o Control/Monad/ST.o \
134 Control/Exception.o Foreign/C/Types.o Foreign/ForeignPtr.o: include/Typeable.h
135
136 System/Posix/Types.o Foreign/C/Types.o: include/CTypes.h
137
138 # -----------------------------------------------------------------------------
139
140 DIST_CLEAN_FILES += base.buildinfo config.cache config.status config.mk
141
142 include $(TOP)/mk/target.mk