[project @ 1997-03-14 05:31:07 by sof]
[ghc-hetmet.git] / ghc / mk / ghcconfig.mk.in
1 # -----------------------------------------------------------------------------
2 # $Id: ghcconfig.mk.in,v 1.4 1997/01/21 11:05:37 sof Exp $
3
4 # This stuff should be split into separate files: that which can be 
5 # messed with, and that which can't.
6
7 # =============================================================================
8 # Autoconf'ed stuff
9
10 WithGhcHc               = @WithGhcHc@
11 WithGhcHcType           = @WithGhcHcType@
12
13 # Override default haskell compiler if required
14 ifneq ($(WithGhcHcType),HC_UNSPECIFIED)
15 HC                      = $(WithGhcHc)
16 HaskellCompilerType     = $(WithGhcHcType)
17 endif
18
19 GhcWithHscBuiltViaC     = @GhcWithHscBuiltViaC@
20 GhcWithHscOptimised     = @GhcWithHscOptimised@
21 GhcWithHscDebug         = @GhcWithHscDebug@
22 GhcBuilderVersion       = @GhcBuilderVersion@
23 GhcWithRegisterised     = @GhcWithRegisterised@
24 GhcWithNativeCodeGen    = @GhcWithNativeCodeGen@
25
26 GhcWithDeforester       = @GhcWithDeforester@
27 GhcWithReadline         = @GhcWithReadline@
28 GhcWithSockets          = @GhcWithSockets@
29
30 # =====================================================================
31 # Utilties for ghc project
32
33 ifeq ($(GhcWithHscOptimised), YES)
34 __hsc_opt               = -O
35 else
36 __hsc_opt               =
37 endif
38
39 ifeq ($(HaskellCompilerType), HC_CHALMERS_HBC)
40 PROJECT_HC_OPTS         = $(__hsc_opt) -fpbu
41 else
42 ifeq ($(HaskellCompilerType), HC_GLASGOW_GHC)
43 PROJECT_HC_OPTS         = $(__hsc_opt) -hi-diffs -link-chk
44 else
45 ifeq ($(HaskellCompilerType),HC_ROJEMO_NHC)
46 PROJECT_HC_OPTS         =
47 else
48 PROJECT_HC_OPTS         =
49 endif
50 endif
51 endif
52
53 ifeq ($(HaveGcc), YES)
54 ifeq ($(UseGcc),  YES)
55 PROJECT_CC_OPTS         = -O
56 endif
57 endif
58
59 PROJECT_MSUB_OPTS       = -f $(TOP)/ghc/mk/ghcconfig.mk -f $(TOP)/ghc/mk/buildinfo.mk -f $(TOP)/ghc/mk/site-ghc.mk
60
61 #-----------------------------------------------------------------------------
62 # MkDependHS
63
64 ifdef UseInstalledUtils
65 MKDEPENDHS              = $(GHC_DRIVER_INST_NAME) -M
66 else
67 MKDEPENDHS              = $(GHC_DRIVERSRC)/ghc -M
68 MKDEPENDHSSRC           = $(GHC_UTILSRC)/mkdependHS
69 endif
70
71 # Temp until we bootstrap to 2.01 properly
72 ifeq ($(Ghc2_0),YES)
73   MKDEPENDHS = $(GHC_DRIVERSRC)/ghc -M
74 else
75   MKDEPENDHS = mkdependHS-1.2
76 endif
77
78 #-----------------------------------------------------------------------------
79 # Unlit
80
81 UNLIT                   = $(GHC_UNLITSRC)/unlit
82
83 #ToDo: unlitNeededHere
84
85 GHC_UNLIT               = $(UNLIT)
86 GHC_UNLITSRC            = $(GHC_UTILSRC)/unlit
87
88 #-----------------------------------------------------------------------------
89 # HsTags
90
91 ifdef UseInstalledUtils
92 HSTAGS                  = hstags
93 else
94 HSTAGS                  = $(HSTAGSSRC)/hstags
95 HSTAGSSRC               = $(GHC_UTILSRC)/hstags
96 endif
97
98 GLUED_HSTAGS_OPTS = \
99         $(ALL_PROJECTS_HSTAGS_OPTS) \
100         $(PLATFORM_HSTAGS_OPTS) \
101         $(PROJECT_HSTAGS_OPTS) \
102         $(HSTAGS_OPTS) \
103         $(EXTRA_HSTAGS_OPTS)
104
105 HSTAGSFLAGS        = $(GLUED_HSTAGS_OPTS)
106
107 #-----------------------------------------------------------------------------
108 # Ugen
109
110 ifdef UseInstalledUtils
111 UGEN            =  ugen
112 else
113 UGEN            = $(UGENSRC)/ugen
114 UGENSRC         = $(GHC_UTILSRC)/ugen
115 endif
116
117 #-----------------------------------------------------------------------------
118 # Extra things ``only for'' for the ghc project
119
120 PROJECTNAME             = The Glorious Glasgow Haskell Compilation System
121 PROJECTVERSION          = 2.01
122 PROJECTPATCHLEVEL       = patchlevel 0
123 GhcBuildeeVersion       = 201
124
125 GHC_DRIVERSRC           = $(TOP)/ghc/driver
126 GHC_COMPILERSRC         = $(TOP)/ghc/compiler
127 GHC_RUNTIMESRC          = $(TOP)/ghc/runtime
128 GHC_LIBSRC              = $(TOP)/ghc/lib
129 GHC_INCLUDESRC          = $(TOP)/ghc/includes
130 GHC_UTILSRC             = $(TOP)/ghc/utils
131 GHC_BOOKSRC             = $(TOP)/ghc/book
132
133 GHC_INCLUDES            = $(GHC_INCLUDESRC)
134
135 ifeq ($(HaskellCompilerType), HC_CHALMERS_HBC)
136 GHC_RTS_STYLE = 'hbc'
137 else
138 ifeq ($(HaskellCompilerType), HC_ROJEMO_NHC)
139 GHC_RTS_STYLE = 'ghc' /* wrong, but more likely to trigger something */
140 else
141 GHC_RTS_STYLE = 'ghc'
142 endif
143 endif
144
145 PROJECT_GHC_OPTS        = -hi-diffs -dcore-lint -link-chk
146
147 GLUED_GHC_OPTS = \
148         $(ALL_PROJECTS_GHC_OPTS) \
149         $(PLATFORM_GHC_OPTS) \
150         $(PROJECT_GHC_OPTS) \
151         $(GHC_OPTS) \
152         $(EXTRA_GHC_OPTS)
153
154 GHCFLAGS=$(GLUED_CPP_DEFINES) $(GLUED_GHC_OPTS)
155
156 #-----------------------------------------------------------------------------
157 # What to build
158
159 BuildYorkInterpreter    = NO
160 UseSemantiqueStrictnessAnalyser = NO
161
162 #-----------------------------------------------------------------------------
163 # Installation: whether to, where to, what to
164
165 AT_GLASGOW              = @AT_GLASGOW@
166
167 ifeq ($(AT_GLASGOW),1)
168 GHC_DRIVER_INST_NAME    = ghc-$(PROJECTVERSION)
169 else
170 GHC_DRIVER_INST_NAME    = ghc
171 endif
172
173 # Make sure we install things with group 'grasp' at Glasgow
174
175 ifeq ($(AT_GLASGOW),1)
176 INSTGROUP               = -g grasp
177 endif
178
179 # At Glasgow, we would rather the installed binaries were stripped.
180 # (Delete if you feel otherwise.)
181
182 INSTSTRIP               = -s
183
184 # Installation directories --------------------------------------------------
185
186 prefix_GHC              = @prefix@
187 exec_prefix_GHC         = @exec_prefix@
188
189 ifeq ($(AT_GLASGOW), 1)
190 INSTBINDIR_GHC          = $(exec_prefix_GHC)/bin/`/usr/local/gnu/bin/hw_os`
191 else
192 INSTBINDIR_GHC          = $(exec_prefix_GHC)/bin
193 endif
194
195 INSTSCRIPDIR_GHC   = $(exec_prefix_GHC)/bin
196 INSTLIBDIR_GHC     = $(prefix_GHC)/lib/ghc/$(PROJECTVERSION)/$(HOSTPLATFORM)
197 INSTDATADIR_GHC    = $(prefix_GHC)/lib/ghc/$(PROJECTVERSION)
198 INSTIMPORTSDIR_GHC = $(INSTDATADIR_GHC)/imports
199
200 # -----------------------------------------------------------------------------
201 # Where to find the programs for the various phases
202
203 GHC                     = $(GHC_DRIVERSRC)/ghc
204 GHC_HSCPP               = $(GHC_HSCPPSRC)/hscpp $(ALLPROJ_CPP_DEFINES)
205 GHC_HSCPPSRC            = $(GHC_UTILSRC)/hscpp
206 GHC_HSP                 = $(GHC_HSPSRC)/hsp
207 GHC_HSPSRC              = $(GHC_HSCSRC)
208 GHC_HSC                 = $(GHC_HSCSRC)/hsc
209 GHC_HSCSRC              = $(GHC_COMPILERSRC)
210 GHC_SYSMAN              = $(GHC_RUNTIMESRC)/gum/SysMan
211 GHC_SYSMANSRC           = $(GHC_RUNTIMESRC)
212
213 #-----------------------------------------------------------------------------
214 # Stuff for the C-compiling phase in particular...
215
216 # NON-OPTIMISING C COMPILATION: =================================
217
218 ifeq ($(HaveGcc), YES)
219 GhcUseGccForDebuggingAsm        = YES
220 GHC_DEBUG_HILEV_ASM             = $(WhatGccIsCalled)
221 else
222 GhcUseGccForDebuggingAsm        = NO
223 GHC_DEBUG_HILEV_ASM             = $(CC)
224 endif
225
226 # OPTIMISING C COMPILATION (regs, etc): ==========================
227
228 ifeq ($(HaveGcc), YES)
229 GhcUseGccForOptAsm              = YES
230 GHC_OPT_HILEV_ASM               = $(WhatGccIsCalled)
231 GHC_GCC_IS_AVAILABLE            = 1
232 else
233 GhcUseGccForOptAsm              = NO
234 GHC_OPT_HILEV_ASM               = $(CC)
235 GHC_GCC_IS_AVAILABLE            = 0
236 endif
237