[project @ 2002-03-04 17:02:43 by simonmar]
[haskell-directory.git] / Makefile
1 # -----------------------------------------------------------------------------
2 # $Id: Makefile,v 1.19 2002/03/04 17:02:43 simonmar Exp $
3
4 TOP=..
5 include $(TOP)/mk/boilerplate.mk
6
7 # -----------------------------------------------------------------------------
8
9 SUBDIRS = cbits include
10
11 ALL_DIRS = \
12         Control \
13         Control/Concurrent \
14         Control/Monad \
15         Control/Monad/ST \
16         Data \
17         Data/Array \
18         Database \
19         Debug \
20         Debug/QuickCheck \
21         FileFormat \
22         Foreign \
23         Foreign/C \
24         Foreign/Marshal \
25         GHC \
26         Hugs \
27         Language \
28         Network \
29         NHC \
30         System \
31         System/Console \
32         System/Mem \
33         System/IO \
34         Text \
35         Text/Html \
36         Text/PrettyPrint \
37         Text/Regex \
38         Text/Show
39
40 PACKAGE = base
41
42 SRC_HC_OPTS += -fglasgow-exts -cpp -Iinclude
43 SRC_HSC2HS_OPTS += -Iinclude
44
45 # Make sure we can get hold of regex.h
46 ifneq "$(HavePosixRegex)" "YES"
47 SRC_HC_OPTS     += -Icbits/regex
48 SRC_HSC2HS_OPTS += -Icbits/regex
49 endif
50
51 # -----------------------------------------------------------------------------
52 # Per-module flags
53
54 # ESSENTIAL, for getting reasonable performance from the I/O library:
55 SRC_HC_OPTS += -funbox-strict-fields
56
57 # -----------------------------------------------------------------------------
58 # PrimOpWrappers
59
60 GHC/PrimopWrappers.hs: $(GHC_COMPILER_DIR)/prelude/primops.txt
61         rm -f $@
62         $(GHC_GENPRIMOP) --make-haskell-wrappers < $< > $@
63
64 boot :: GHC/PrimopWrappers.hs
65
66 CLEAN_FILES += GHC/PrimopWrappers.hs
67
68 # -----------------------------------------------------------------------------
69 # GHC/Prim.hi-boot
70
71 GHC/Prim.$(way_)hi      : GHC/Prim.hi-boot
72         -$(GHC_INPLACE) --compile-iface $<
73
74 ALL_PRIMS = GHC/Prim.hi $(foreach way, $(WAYS), GHC/Prim.$(way)_hi)
75 INSTALL_DATAS_WITH_DIRS += GHC/Prim.$(way_)hi
76
77 lib  : $(ALL_PRIMS)
78
79 boot :: $(ALL_PRIMS)
80
81 CLEAN_FILES += $(ALL_PRIMS)
82
83 SRC_CPP_OPTS += -I$(GHC_INCLUDE_DIR) -traditional
84
85 #-----------------------------------------------------------------------------
86 #       Building the library for GHCi
87 #
88 # The procedure differs from that in fptools/mk/target.mk in one way:
89 #  (*) on Win32 we must split it into two, because a single .o file can't
90 #      have more than 65536 relocations in it.
91
92 ifeq "$(TARGETPLATFORM)" "i386-unknown-mingw32"
93
94 # Turn off standard rule which creates HSbase.o from LIBOBJS.
95 DONT_WANT_BASE_GHCI_LIB_RULE=YES
96
97 GHCI_LIBOBJS = $(HS_OBJS)
98
99 HSbase.o : $(GHCI_LIBOBJS)
100         $(LD) -r $(LD_X) -o HSbase1.o $(filter     GHC/%, $(GHCI_LIBOBJS))
101         $(LD) -r $(LD_X) -o HSbase2.o $(filter-out GHC/%, $(GHCI_LIBOBJS))
102         @touch HSbase.o
103
104 INSTALL_LIBS += HSbase1.o HSbase2.o
105
106 endif # TARGETPLATFORM = i386-unknown-mingw32
107
108
109 # -----------------------------------------------------------------------------
110
111 include $(TOP)/mk/target.mk
112