[project @ 1996-11-21 16:45:53 by simonm]
[ghc-hetmet.git] / ghc / mk / ghcconfig.mk.in
1 # -----------------------------------------------------------------------------
2 # $Id: ghcconfig.mk.in,v 1.2 1996/11/21 16:48:02 simonm 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 SETUP_HC_OPTS           = $(__hsc_opt) -fpbu
41 else
42 ifeq ($(HaskellCompilerType), HC_GLASGOW_GHC)
43 SETUP_HC_OPTS           = $(__hsc_opt) -hi-diffs -link-chk
44 else
45 ifeq ($(HaskellCompilerType),HC_ROJEMO_NHC)
46 SETUP_HC_OPTS           =
47 else
48 SETUP_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              = mkdependHS
66 else
67 MKDEPENDHS              = $(MKDEPENDHSSRC)/mkdependHS
68 MKDEPENDHSSRC           = $(GHC_UTILSRC)/mkdependHS
69 endif
70
71 # Temp until we bootstrap to 2.01 properly
72 ifeq ($(Ghc2_0),YES)
73   MKDEPENDHS = mkdependHS
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         $(SETUP_HSTAGS_OPTS) \
103         $(HSTAGS_OPTS) \
104         $(EXTRA_HSTAGS_OPTS)
105
106 HSTAGSFLAGS        = $(GLUED_HSTAGS_OPTS)
107
108 #-----------------------------------------------------------------------------
109 # Ugen
110
111 ifdef UseInstalledUtils
112 UGEN            =  ugen
113 else
114 UGEN            = $(UGENSRC)/ugen
115 UGENSRC         = $(GHC_UTILSRC)/ugen
116 endif
117
118 #-----------------------------------------------------------------------------
119 # Extra things ``only for'' for the ghc project
120
121 PROJECTNAME             = The Glorious Glasgow Haskell Compilation System
122 PROJECTVERSION          = 2.01
123 PROJECTPATCHLEVEL       = patchlevel 0
124 GhcBuildeeVersion       = 201
125
126 GHC_DRIVERSRC           = $(TOP)/ghc/driver
127 GHC_COMPILERSRC         = $(TOP)/ghc/compiler
128 GHC_RUNTIMESRC          = $(TOP)/ghc/runtime
129 GHC_LIBSRC              = $(TOP)/ghc/lib
130 GHC_INCLUDESRC          = $(TOP)/ghc/includes
131 GHC_UTILSRC             = $(TOP)/ghc/utils
132 GHC_BOOKSRC             = $(TOP)/ghc/book
133
134 GHC_INCLUDES            = $(GHC_INCLUDESRC)
135
136 ifeq ($(HaskellCompilerType), HC_CHALMERS_HBC)
137 GHC_RTS_STYLE = 'hbc'
138 else
139 ifeq ($(HaskellCompilerType), HC_ROJEMO_NHC)
140 GHC_RTS_STYLE = 'ghc' /* wrong, but more likely to trigger something */
141 else
142 GHC_RTS_STYLE = 'ghc'
143 endif
144 endif
145
146 PROJECT_GHC_OPTS        = -hi-diffs -dcore-lint -link-chk
147
148 GLUED_GHC_OPTS = \
149         $(ALL_PROJECTS_GHC_OPTS) \
150         $(PLATFORM_GHC_OPTS) \
151         $(PROJECT_GHC_OPTS) \
152         $(SETUP_GHC_OPTS) \
153         $(GHC_OPTS) \
154         $(EXTRA_GHC_OPTS)
155
156 GHCFLAGS=$(GLUED_CPP_DEFINES) $(GLUED_GHC_OPTS)
157
158 #-----------------------------------------------------------------------------
159 # What to build
160
161 BuildYorkInterpreter    = NO
162 UseSemantiqueStrictnessAnalyser = NO
163
164 #-----------------------------------------------------------------------------
165 # Installation: whether to, where to, what to
166
167 AT_GLASGOW              = @AT_GLASGOW@
168
169 ifeq ($(AT_GLASGOW),1)
170 GHC_DRIVER_INST_NAME    = ghc-$(PROJECTVERSION)
171 else
172 GHC_DRIVER_INST_NAME    = ghc
173 endif
174
175 # Make sure we install things with group 'grasp' at Glasgow
176
177 ifeq ($(AT_GLASGOW),1)
178 INSTGROUP               = -g grasp
179 endif
180
181 # At Glasgow, we would rather the installed binaries were stripped.
182 # (Delete if you feel otherwise.)
183
184 INSTSTRIP               = -s
185
186 # Installation directories --------------------------------------------------
187
188 prefix_GHC              = @prefix@
189 exec_prefix_GHC         = @exec_prefix@
190
191 ifeq ($(AT_GLASGOW), 1)
192 INSTBINDIR_GHC          = $(exec_prefix_GHC)/bin/`/usr/local/gnu/bin/hw_os`
193 else
194 INSTBINDIR_GHC          = $(exec_prefix_GHC)/bin
195 endif
196
197 INSTSCRIPDIR_GHC   = $(exec_prefix_GHC)/bin
198 INSTLIBDIR_GHC     = $(prefix_GHC)/lib/ghc/$(PROJECTVERSION)/$(HOSTPLATFORM)
199 INSTDATADIR_GHC    = $(prefix_GHC)/lib/ghc/$(PROJECTVERSION)
200 INSTIMPORTSDIR_GHC = $(INSTDATADIR_GHC)/imports
201
202 # -----------------------------------------------------------------------------
203 # Where to find the programs for the various phases
204
205 GHC                     = $(GHC_DRIVERSRC)/ghc
206 GHC_HSCPP               = $(GHC_HSCPPSRC)/hscpp $(ALLPROJ_CPP_DEFINES)
207 GHC_HSCPPSRC            = $(GHC_UTILSRC)/hscpp
208 GHC_HSP                 = $(GHC_HSPSRC)/hsp
209 GHC_HSPSRC              = $(GHC_HSCSRC)
210 GHC_HSC                 = $(GHC_HSCSRC)/hsc
211 GHC_HSCSRC              = $(GHC_COMPILERSRC)
212 GHC_SYSMAN              = $(GHC_RUNTIMESRC)/gum/SysMan
213 GHC_SYSMANSRC           = $(GHC_RUNTIMESRC)
214
215 #-----------------------------------------------------------------------------
216 # Stuff for the C-compiling phase in particular...
217
218 # NON-OPTIMISING C COMPILATION: =================================
219
220 ifeq ($(HaveGcc), YES)
221 GhcUseGccForDebuggingAsm        = YES
222 GHC_DEBUG_HILEV_ASM             = $(WhatGccIsCalled)
223 else
224 GhcUseGccForDebuggingAsm        = NO
225 GHC_DEBUG_HILEV_ASM             = $(CC)
226 endif
227
228 # OPTIMISING C COMPILATION (regs, etc): ==========================
229
230 ifeq ($(HaveGcc), YES)
231 GhcUseGccForOptAsm              = YES
232 GHC_OPT_HILEV_ASM               = $(WhatGccIsCalled)
233 GHC_GCC_IS_AVAILABLE            = 1
234 else
235 GhcUseGccForOptAsm              = NO
236 GHC_OPT_HILEV_ASM               = $(CC)
237 GHC_GCC_IS_AVAILABLE            = 0
238 endif
239