[project @ 2003-11-11 11:50:52 by simonmar]
[packages/old-time.git] / 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/Generics \
16 Data/Array \
17 Data/Array/IO \
18 Data/STRef \
19 Debug \
20 Foreign \
21 Foreign/C \
22 Foreign/Marshal \
23 GHC \
24 System \
25 System/Console \
26 System/Mem \
27 System/IO \
28 System/Posix \
29 Text \
30 Text/Html \
31 Text/PrettyPrint \
32 Text/ParserCombinators \
33 Text/Regex \
34 Text/Show \
35 Text/Read
36
37 PACKAGE = base
38
39 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude -\#include HsBase.h
40 SRC_HSC2HS_OPTS += -Iinclude -I$(FPTOOLS_TOP)/ghc/includes
41
42 # If there is no system-supplied POSIX regex library, use our own
43 ifneq "$(HavePosixRegex)" "YES"
44 # Make sure we can get hold of regex.h
45 SRC_HC_OPTS += -Icbits/regex
46 SRC_HSC2HS_OPTS += -Icbits/regex
47 endif
48
49 # -----------------------------------------------------------------------------
50 # Per-module flags
51
52 # ESSENTIAL, for getting reasonable performance from the I/O library:
53 SRC_HC_OPTS += -funbox-strict-fields
54
55 # -----------------------------------------------------------------------------
56 # PrimOpWrappers
57
58 # These two lines are required for pre-processing ghc/compiler/prelude/primops.txt
59 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
60 SRC_CPP_OPTS += ${GhcCppOpts}
61
62 ifeq "$(BootingFromHc)" "YES"
63 GHC/PrimopWrappers.hs:
64 touch GHC/PrimopWrappers.hs
65 else
66 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
67 @$(RM) $@
68 $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
69 endif
70
71 boot :: GHC/PrimopWrappers.hs
72
73 EXTRA_SRCS += GHC/PrimopWrappers.hs
74 CLEAN_FILES += GHC/PrimopWrappers.hs
75
76 # -----------------------------------------------------------------------------
77
78 STUBOBJS += \
79 Control/Concurrent_stub.$(way_)o
80
81 CLEAN_FILES += $(STUBOBJS) \
82 Control/Concurrent_stub.[ch]
83
84 #-----------------------------------------------------------------------------
85 # Building the library for GHCi
86 #
87 # The procedure differs from that in fptools/mk/target.mk in one way:
88 # (*) on Win32 we must split it into two, because a single .o file can't
89 # have more than 65536 relocations in it [due to a bug in the GNU
90 # linker.]
91
92 OBJECT_FILEFORMAT=unknown
93 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
94 OBJECT_FILEFORMAT=PEi
95 endif
96 ifeq "$(TARGETPLATFORM)" "i386-unknown-cygwin32"
97 OBJECT_FILEFORMAT=PEi
98 endif
99
100 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
101
102 # Turn off standard rule which creates HSbase.o from LIBOBJS.
103 DONT_WANT_STD_GHCI_LIB_RULE=YES
104
105 GHCI_LIBOBJS = $(HS_OBJS)
106
107 INSTALL_LIBS += HSbase1.o HSbase2.o HSbase3.o
108
109 endif # OBJECT_FILEFORMAT = PEi
110
111
112 # -----------------------------------------------------------------------------
113 # Doc building with Haddock
114
115 EXCLUDED_HADDOCK_SRCS = \
116 GHC/PrimopWrappers.hs \
117 GHC/PArr.hs
118
119 SRC_HADDOCK_OPTS += -t "Haskell Hierarchical Libraries ($(PACKAGE) package)" \
120 --no-implicit-prelude
121
122 # -----------------------------------------------------------------------------
123
124 include $(TOP)/mk/target.mk
125
126 ifeq "$(OBJECT_FILEFORMAT)" "PEi"
127 HSbase.o : $(GHCI_LIBOBJS)
128 $(LD) -r $(LD_X) -o HSbase1.o $(filter GHC/%, $(GHCI_LIBOBJS))
129 $(LD) -r $(LD_X) -o HSbase2.o $(filter Text/%, $(GHCI_LIBOBJS))
130 $(LD) -r $(LD_X) -o HSbase3.o $(filter-out GHC/% Text/%, $(GHCI_LIBOBJS))
131 @touch HSbase.o
132 endif # OBJECT_FILEFORMAT = PEi
133