[project @ 1996-06-27 16:55:06 by partain]
[ghc-hetmet.git] / ghc / lib / Jmakefile
1 /* This is the Jmakefile for the library stuff.
2    This stuff is all written in (Glasgow-extended) Haskell.
3
4 Everything here *must* be compiled w/ the Glasgow Haskell compiler.
5 (Hence the use of $(GHC), rather than $(HC) [the latter is your "standard"
6 Haskell compiler -- whatever you've configured]).
7
8 If you use EXTRA_HC_OPTS on the command line (which you shouldn't,
9 strictly speaking), it will probably work -- it is pinned onto
10 GHC_OPTS, just for fun.
11 */
12
13 /****************************************************************
14 *                                                               *
15 * Jmakefile preamble-y things                                   *
16 *                                                               *
17 ****************************************************************/
18
19
20 #if IncludeTestDirsInBuild == YES
21 #define IHaveSubdirs
22 #define __ghc_lib_tests_dir tests
23 #else
24 #define __ghc_lib_tests_dir /* nothing */
25 #endif
26
27 SUBDIRS = __ghc_lib_tests_dir
28
29 /* only subdir is the (empty :-() test suite */
30 #define NoAllTargetForSubdirs
31 #define NoDocsTargetForSubdirs
32 #define NoInstallTargetForSubdirs
33 #define NoInstallDocsTargetForSubdirs
34 #define NoDependTargetForSubdirs
35 #define NoTagTargetForSubdirs
36
37 GhcDriverNeededHere(depend all)
38 EtagsNeededHere(tags)
39
40 /****************************************************************
41 *                                                               *
42 * options used for compiling/etc. things                        *
43 *                                                               *
44 ****************************************************************/
45
46 /* The driver will give warnings if -split-objs, but that's cool... */
47 GHC_OPTS=-short -cpp            \
48          -dcore-lint            \
49          -irequired             \
50          -fusing-ghc-internals  \
51          HcMaxHeapFlag $(EXTRA_HC_OPTS)
52
53 PREL_OPTS=/*???-fcompiling-ghc-internals -fno-implicit-prelude*/
54
55 /* per-build options: shared with RTS */
56 #define rts_or_lib(r,l) l
57 /*later: #include "../mkworld/GHC_OPTS" */
58
59 /* this is just friendliness to "hstags" */
60 HSTAGS_OPTS=-fglasgow-exts
61
62 /***************************************************************/
63
64 #define SrcThingVars(blob)                              @@\
65 CAT2(blob,_HC_norm) = $(CAT2(blob,_HS):.hs=.hc)         @@\
66 CAT2(blob,_HC_p)    = $(CAT2(blob,_HS):.hs=.p_hc)       @@\
67 CAT2(blob,_HC_t)    = $(CAT2(blob,_HS):.hs=.t_hc)       @@\
68 CAT2(blob,_HC_u)    = $(CAT2(blob,_HS):.hs=.u_hc)       @@\
69 CAT2(blob,_HC_mc)   = $(CAT2(blob,_HS):.hs=.mc_hc)      @@\
70 CAT2(blob,_HC_mr)   = $(CAT2(blob,_HS):.hs=.mr_hc)      @@\
71 CAT2(blob,_HC_mt)   = $(CAT2(blob,_HS):.hs=.mt_hc)      @@\
72 CAT2(blob,_HC_mp)   = $(CAT2(blob,_HS):.hs=.mp_hc)      @@\
73 CAT2(blob,_HC_mg)   = $(CAT2(blob,_HS):.hs=.mg_hc)      @@\
74 CAT2(blob,_HC_2s)   = $(CAT2(blob,_HS):.hs=.2s_hc)      @@\
75 CAT2(blob,_HC_1s)   = $(CAT2(blob,_HS):.hs=.1s_hc)      @@\
76 CAT2(blob,_HC_du)   = $(CAT2(blob,_HS):.hs=.du_hc)      @@\
77 CAT2(blob,_HC_a)    = $(CAT2(blob,_HS):.hs=.a_hc)       @@\
78 CAT2(blob,_HC_b)    = $(CAT2(blob,_HS):.hs=.b_hc)       @@\
79 CAT2(blob,_HC_c)    = $(CAT2(blob,_HS):.hs=.c_hc)       @@\
80 CAT2(blob,_HC_d)    = $(CAT2(blob,_HS):.hs=.d_hc)       @@\
81 CAT2(blob,_HC_e)    = $(CAT2(blob,_HS):.hs=.e_hc)       @@\
82 CAT2(blob,_HC_f)    = $(CAT2(blob,_HS):.hs=.f_hc)       @@\
83 CAT2(blob,_HC_g)    = $(CAT2(blob,_HS):.hs=.g_hc)       @@\
84 CAT2(blob,_HC_h)    = $(CAT2(blob,_HS):.hs=.h_hc)       @@\
85 CAT2(blob,_HC_i)    = $(CAT2(blob,_HS):.hs=.i_hc)       @@\
86 CAT2(blob,_HC_j)    = $(CAT2(blob,_HS):.hs=.j_hc)       @@\
87 CAT2(blob,_HC_k)    = $(CAT2(blob,_HS):.hs=.k_hc)       @@\
88 CAT2(blob,_HC_l)    = $(CAT2(blob,_HS):.hs=.l_hc)       @@\
89 CAT2(blob,_HC_m)    = $(CAT2(blob,_HS):.hs=.m_hc)       @@\
90 CAT2(blob,_HC_n)    = $(CAT2(blob,_HS):.hs=.n_hc)       @@\
91 CAT2(blob,_HC_o)    = $(CAT2(blob,_HS):.hs=.o_hc)       @@\
92 CAT2(blob,_HC_A)    = $(CAT2(blob,_HS):.hs=.A_hc)       @@\
93 CAT2(blob,_HC_B)    = $(CAT2(blob,_HS):.hs=.B_hc)       @@\
94                                                         @@\
95 CAT2(blob,_DEP_norm) = $(CAT2(blob,_HC_norm):.hc=.o)    @@\
96 CAT2(blob,_DEP_p)   = $(CAT2(blob,_HC_p):.p_hc=.p_o)    @@\
97 CAT2(blob,_DEP_t)   = $(CAT2(blob,_HC_t):.t_hc=.t_o)    @@\
98 CAT2(blob,_DEP_u)   = $(CAT2(blob,_HC_u):.u_hc=.u_o)    @@\
99 CAT2(blob,_DEP_a)   = $(CAT2(blob,_HC_a):.a_hc=.a_o)    @@\
100 CAT2(blob,_DEP_b)   = $(CAT2(blob,_HC_b):.b_hc=.b_o)    @@\
101 CAT2(blob,_DEP_c)   = $(CAT2(blob,_HC_c):.c_hc=.c_o)    @@\
102 CAT2(blob,_DEP_d)   = $(CAT2(blob,_HC_d):.d_hc=.d_o)    @@\
103 CAT2(blob,_DEP_e)   = $(CAT2(blob,_HC_e):.e_hc=.e_o)    @@\
104 CAT2(blob,_DEP_f)   = $(CAT2(blob,_HC_f):.f_hc=.f_o)    @@\
105 CAT2(blob,_DEP_g)   = $(CAT2(blob,_HC_g):.g_hc=.g_o)    @@\
106 CAT2(blob,_DEP_h)   = $(CAT2(blob,_HC_h):.h_hc=.h_o)    @@\
107 CAT2(blob,_DEP_i)   = $(CAT2(blob,_HC_i):.i_hc=.i_o)    @@\
108 CAT2(blob,_DEP_j)   = $(CAT2(blob,_HC_j):.j_hc=.j_o)    @@\
109 CAT2(blob,_DEP_k)   = $(CAT2(blob,_HC_k):.k_hc=.k_o)    @@\
110 CAT2(blob,_DEP_l)   = $(CAT2(blob,_HC_l):.l_hc=.l_o)    @@\
111 CAT2(blob,_DEP_m)   = $(CAT2(blob,_HC_m):.m_hc=.m_o)    @@\
112 CAT2(blob,_DEP_n)   = $(CAT2(blob,_HC_n):.n_hc=.n_o)    @@\
113 CAT2(blob,_DEP_o)   = $(CAT2(blob,_HC_o):.o_hc=.o_o)    @@\
114 CAT2(blob,_DEP_A)   = $(CAT2(blob,_HC_A):.A_hc=.A_o)    @@\
115 CAT2(blob,_DEP_B)   = $(CAT2(blob,_HC_B):.B_hc=.B_o)    @@\
116 CAT2(blob,_DEP_mc)  = $(CAT2(blob,_HC_mc):.mc_hc=.mc_o) @@\
117 CAT2(blob,_DEP_mr)  = $(CAT2(blob,_HC_mr):.mr_hc=.mr_o) @@\
118 CAT2(blob,_DEP_mt)  = $(CAT2(blob,_HC_mt):.mt_hc=.mt_o) @@\
119 CAT2(blob,_DEP_mp)  = $(CAT2(blob,_HC_mp):.mp_hc=.mp_o) @@\
120 CAT2(blob,_DEP_mg)  = $(CAT2(blob,_HC_mg):.mg_hc=.mg_o) @@\
121 CAT2(blob,_DEP_2s)  = $(CAT2(blob,_HC_2s):.2s_hc=.2s_o) @@\
122 CAT2(blob,_DEP_1s)  = $(CAT2(blob,_HC_1s):.1s_hc=.1s_o) @@\
123 CAT2(blob,_DEP_du)  = $(CAT2(blob,_HC_du):.du_hc=.du_o) @@\
124                                                         @@\
125 CAT2(blob,_HIs_p)   = $(CAT2(blob,_HIs):.hi=.p_hi)      @@\
126 CAT2(blob,_HIs_t)   = $(CAT2(blob,_HIs):.hi=.t_hi)      @@\
127 CAT2(blob,_HIs_u)   = $(CAT2(blob,_HIs):.hi=.u_hi)      @@\
128 CAT2(blob,_HIs_a)   = $(CAT2(blob,_HIs):.hi=.a_hi)      @@\
129 CAT2(blob,_HIs_b)   = $(CAT2(blob,_HIs):.hi=.b_hi)      @@\
130 CAT2(blob,_HIs_c)   = $(CAT2(blob,_HIs):.hi=.c_hi)      @@\
131 CAT2(blob,_HIs_d)   = $(CAT2(blob,_HIs):.hi=.d_hi)      @@\
132 CAT2(blob,_HIs_e)   = $(CAT2(blob,_HIs):.hi=.e_hi)      @@\
133 CAT2(blob,_HIs_f)   = $(CAT2(blob,_HIs):.hi=.f_hi)      @@\
134 CAT2(blob,_HIs_g)   = $(CAT2(blob,_HIs):.hi=.g_hi)      @@\
135 CAT2(blob,_HIs_h)   = $(CAT2(blob,_HIs):.hi=.h_hi)      @@\
136 CAT2(blob,_HIs_i)   = $(CAT2(blob,_HIs):.hi=.i_hi)      @@\
137 CAT2(blob,_HIs_j)   = $(CAT2(blob,_HIs):.hi=.j_hi)      @@\
138 CAT2(blob,_HIs_k)   = $(CAT2(blob,_HIs):.hi=.k_hi)      @@\
139 CAT2(blob,_HIs_l)   = $(CAT2(blob,_HIs):.hi=.l_hi)      @@\
140 CAT2(blob,_HIs_m)   = $(CAT2(blob,_HIs):.hi=.m_hi)      @@\
141 CAT2(blob,_HIs_n)   = $(CAT2(blob,_HIs):.hi=.n_hi)      @@\
142 CAT2(blob,_HIs_o)   = $(CAT2(blob,_HIs):.hi=.o_hi)      @@\
143 CAT2(blob,_HIs_A)   = $(CAT2(blob,_HIs):.hi=.A_hi)      @@\
144 CAT2(blob,_HIs_B)   = $(CAT2(blob,_HIs):.hi=.B_hi)      @@\
145 CAT2(blob,_HIs_mc)  = $(CAT2(blob,_HIs):.hi=.mc_hi)     @@\
146 CAT2(blob,_HIs_mr)  = $(CAT2(blob,_HIs):.hi=.mr_hi)     @@\
147 CAT2(blob,_HIs_mt)  = $(CAT2(blob,_HIs):.hi=.mt_hi)     @@\
148 CAT2(blob,_HIs_mp)  = $(CAT2(blob,_HIs):.hi=.mp_hi)     @@\
149 CAT2(blob,_HIs_mg)  = $(CAT2(blob,_HIs):.hi=.mg_hi)     @@\
150 CAT2(blob,_HIs_2s)  = $(CAT2(blob,_HIs):.hi=.2s_hi)     @@\
151 CAT2(blob,_HIs_1s)  = $(CAT2(blob,_HIs):.hi=.1s_hi)     @@\
152 CAT2(blob,_HIs_du)  = $(CAT2(blob,_HIs):.hi=.du_hi)
153
154 /****************************************************************
155 *                                                               *
156 * what it is we are compiling;                                  *
157 *   these are long and tedious lists, but c'est la guerre       *
158 *                                                               *
159 ****************************************************************/
160
161 BASIC_HS =                      \
162 prelude/Prelude.hs              \
163 prelude/GHCbase.hs              \
164 prelude/GHCps.hs                \
165 prelude/GHCio.hs                \
166 prelude/GHCmain.hs              \
167 prelude/PreludeGlaST.hs         \
168                                 \
169 required/Array.hs               \
170 required/Char.hs                \
171 required/Complex.hs             \
172 required/Directory.hs           \
173 required/IO.hs                  \
174 required/Ix.hs                  \
175 required/List.hs                \
176 required/Maybe.hs               \
177 required/Monad.hs               \
178 required/Ratio.hs               \
179 required/System.hs              \
180 \
181 concurrent/Channel.hs           \
182 concurrent/ChannelVar.hs        \
183 concurrent/Merge.hs             \
184 concurrent/Parallel.hs          \
185 concurrent/SampleVar.hs         \
186 concurrent/Semaphore.hs         \
187 concurrent/Concurrent.hs
188
189
190 BASIC_OBJS_DIRS = $(BASIC_HS:.hs=)
191
192 SrcThingVars(BASIC)
193
194 /************************************************************************
195 *                                                                       *
196 * Macros for creating and installing libHS<x>.a (in its many flavors).  *
197 *                                                                       *
198 *************************************************************************/
199
200 #ifndef SpecialGhcLibraryTarget
201 #define SpecialGhcLibraryTarget(lib,tag,objs_DEP,objs_DIR,find_pat) @@\
202 AllTarget(CAT3(lib,tag,.a))                                     @@\
203 CAT3(lib,tag,.a):: objs_DEP                                     @@\
204         $(RM) $@                                                @@\
205         TMPDIR=$(TMPDIR); export TMPDIR;                        \
206         find objs_DIR -name find_pat -print | xargs ar q $@     @@\
207         $(RANLIB) CAT3(lib,tag,.a)                              @@\
208 clean  ::                                                       @@\
209         $(RM) CAT3(lib,tag,.a)
210 #endif /* SpecialGhcLibraryTarget */
211
212 #ifndef SpecialGhcLibInstallTarget
213 #if DoInstallGHCSystem == YES
214 #define SpecialGhcLibInstallTarget(lib,tag)                     @@\
215 install :: CAT3(lib,tag,.a)                                     @@\
216         $(INSTALL) $(INSTLIBFLAGS) CAT3(lib,tag,.a)             \
217                 $(INSTLIBDIR_GHC)/CAT3(lib,tag,.a)              @@\
218         $(RANLIB) $(INSTLIBDIR_GHC)/CAT3(lib,tag,.a)
219 #else  /* ! DoInstallGhc... */
220 #define SpecialGhcLibInstallTarget(lib,tag) /*nothing*/
221 #endif /* ! DoInstallGhc... */
222 #endif /* SpecialGhcLibInstallTarget */
223
224 /* build/install all the diff libs for a particular build */
225
226 #define BigHisTarget(targeti,basei)                             @@\
227 targeti ::                                                      @@\
228 InstallTarget(targeti)                                          @@\
229 InstallMultNonExecTargets(targeti,basei,$(INSTDATADIR_GHC)/imports)
230
231 #define BigLibsTarget(tag,glob,base)                            @@\
232 SpecialGhcLibraryTarget(libHS,tag,base,$(BASIC_OBJS_DIRS),glob) @@\
233 SpecialGhcLibInstallTarget(libHS,tag)
234
235 /* build *everything* -- monster macro from hell */
236 #define BigBuildTarget(tag,glob,targeti,base,basei)             \
237 BigLibsTarget(tag,glob,base)                                    @@\
238 BigHisTarget(targeti,basei)
239
240 /****************************************************************
241 *                                                               *
242 * Creating and installing...                                    *
243 *       libHS_<tag>.a           standard Prelude library        *
244 *                                                               *
245 ****************************************************************/
246
247 /* make sure install's target dir is there */
248 #if DoInstallGHCSystem == YES
249 MakeDirectories(install, $(INSTLIBDIR_GHC)              \
250                          $(INSTDATADIR_GHC)/imports)
251
252 basic_his :: /* nothing */
253 InstallTarget(basic_his)
254 InstallMultNonExecTargets(basic_his, $(BASIC_HIs),  $(INSTDATADIR_GHC)/imports)
255 #endif /* installing */
256
257 IfGhcBuild_normal(BigBuildTarget(,'*.o',basic_his \
258 , $(BASIC_DEP_norm),  $(BASIC_HIs)              \
259 ))
260
261 IfGhcBuild_p(BigBuildTarget(_p,'*.p_o',his_p    \
262 , $(BASIC_DEP_p),  $(BASIC_HIs_p)               \
263 ))
264
265 IfGhcBuild_t(BigBuildTarget(_t,'*.t_o',his_t    \
266 , $(BASIC_DEP_t),  $(BASIC_HIs_t)               \
267 ))
268
269 IfGhcBuild_u(BigBuildTarget(,'*.u_o',his_u      \
270 , $(BASIC_DEP_u),  $(BASIC_HIs_u)               \
271 ))
272
273 IfGhcBuild_mc(BigBuildTarget(_mc,'*.mc_o',his_mc \
274 , $(BASIC_DEP_mc),  $(BASIC_HIs_mc)             \
275 ))
276
277 IfGhcBuild_mr(BigBuildTarget(_mr,'*.mr_o',his_mr \
278 , $(BASIC_DEP_mr),  $(BASIC_HIs_mr)             \
279 ))
280
281 IfGhcBuild_mt(BigBuildTarget(_mr,'*.mt_o',his_mt \
282 , $(BASIC_DEP_mt),  $(BASIC_HIs_mt)             \
283 ))
284
285 IfGhcBuild_mp(BigBuildTarget(_mp,'*.mp_o',his_mp \
286 , $(BASIC_DEP_mp),  $(BASIC_HIs_mp)             \
287 ))
288
289 IfGhcBuild_mg(BigBuildTarget(_mg,'*.mg_o',his_mg \
290 , $(BASIC_DEP_mg),  $(BASIC_HIs_mg)             \
291 ))
292
293 /* these GC ones do not *really* need separate .hi files,
294    but it really makes life easier to do it this way
295 */
296 IfGhcBuild_2s(BigBuildTarget(_2s,'*.2s_o',his_2s \
297 , $(BASIC_DEP_2s),  $(BASIC_HIs_2s)             \
298 ))
299
300 IfGhcBuild_1s(BigBuildTarget(_1s,'*.1s_o',his_1s \
301 , $(BASIC_DEP_1s),  $(BASIC_HIs_1s)             \
302 ))
303
304 IfGhcBuild_du(BigBuildTarget(_du,'*.du_o',his_du \
305 , $(BASIC_DEP_du),  $(BASIC_HIs_du)             \
306 ))
307
308 /* user ways -- yeeps! */
309
310 IfGhcBuild_a(BigBuildTarget(_a,'*.a_o',his_a    \
311 , $(BASIC_DEP_a),  $(BASIC_HIs_a)               \
312 ))
313
314 IfGhcBuild_b(BigBuildTarget(_b,'*.b_o',his_b    \
315 , $(BASIC_DEP_b),  $(BASIC_HIs_b)               \
316 ))
317
318 IfGhcBuild_c(BigBuildTarget(_c,'*.c_o',his_c    \
319 , $(BASIC_DEP_c),  $(BASIC_HIs_c)               \
320 ))
321
322 IfGhcBuild_d(BigBuildTarget(_d,'*.d_o',his_d    \
323 , $(BASIC_DEP_d),  $(BASIC_HIs_d)               \
324 ))
325
326 IfGhcBuild_e(BigBuildTarget(_e,'*.e_o',his_e    \
327 , $(BASIC_DEP_e),  $(BASIC_HIs_e)               \
328 ))
329
330 IfGhcBuild_f(BigBuildTarget(_f,'*.f_o',his_f    \
331 , $(BASIC_DEP_f),  $(BASIC_HIs_f)               \
332 ))
333
334 IfGhcBuild_g(BigBuildTarget(_g,'*.g_o',his_g    \
335 , $(BASIC_DEP_g),  $(BASIC_HIs_g)               \
336 ))
337
338 IfGhcBuild_h(BigBuildTarget(_h,'*.h_o',his_h    \
339 , $(BASIC_DEP_h),  $(BASIC_HIs_h)               \
340 ))
341
342 IfGhcBuild_i(BigBuildTarget(_i,'*.i_o',his_i    \
343 , $(BASIC_DEP_i),  $(BASIC_HIs_i)               \
344 ))
345
346 IfGhcBuild_j(BigBuildTarget(_j,'*.j_o',his_j    \
347 , $(BASIC_DEP_j),  $(BASIC_HIs_j)               \
348 ))
349
350 IfGhcBuild_k(BigBuildTarget(_k,'*.k_o',his_k    \
351 , $(BASIC_DEP_k),  $(BASIC_HIs_k)               \
352 ))
353
354 IfGhcBuild_l(BigBuildTarget(_l,'*.l_o',his_l    \
355 , $(BASIC_DEP_l),  $(BASIC_HIs_l)               \
356 ))
357
358 IfGhcBuild_m(BigBuildTarget(_m,'*.m_o',his_m    \
359 , $(BASIC_DEP_m),  $(BASIC_HIs_m)               \
360 ))
361
362 IfGhcBuild_n(BigBuildTarget(_n,'*.n_o',his_n    \
363 , $(BASIC_DEP_n),  $(BASIC_HIs_n)               \
364 ))
365
366 IfGhcBuild_o(BigBuildTarget(_o,'*.o_o',his_o    \
367 , $(BASIC_DEP_o),  $(BASIC_HIs_o)               \
368 ))
369
370 IfGhcBuild_A(BigBuildTarget(_A,'*.A_o',his_A    \
371 , $(BASIC_DEP_A),  $(BASIC_HIs_A)               \
372 ))
373
374 IfGhcBuild_B(BigBuildTarget(_B,'*.B_o',his_B    \
375 , $(BASIC_DEP_B),  $(BASIC_HIs_B)               \
376 ))
377
378 /****************************************************************
379 *                                                               *
380 * Creating the individual .hc files:                            *
381 *                                                               *
382 *   For the just-vary-the-GC-thanks flavors, we only need to    *
383 *   compile .hs->.hc once; then re-use the .hc file each time.  *
384 *                                                               *
385 *   For the profiling one (_p) and all the user-specified       *
386 *   ones, we recompile the Haskell each time.                   *
387 *                                                               *
388 *  NB: old (WDP 95/06)                                          *
389 ****************************************************************/
390
391 /* some "helpful" internal macros first... */
392
393 #if GhcWithHscBuiltViaC == YES && HaskellCompilerType == HC_USE_HC_FILES
394 #define CompilePreludishly__(file,isuf,way,flags)               @@\
395 clean  ::                                                       @@\
396         $(RM) CAT3(file,way,.hc)
397
398 #else /* normal case */
399 #define CompilePreludishly__(file,isuf,way,flags)               @@\
400 CAT3(file,way,.hc) : file.isuf                                  @@\
401         : do not $(RM) CAT3(file,way,.hc)                       @@\
402         $(GHC) -C $(GHCFLAGS) flags file.isuf -o CAT3(file,way,.hc) @@\
403 clean ::                                                        @@\
404         $(RM) CAT3(file,way,.hc)
405 #endif
406
407 #define ObjectifyPreludishly__(file,way,flags,osuff,find_pat)   @@\
408 CAT3(file,way,.o) : CAT3(file,way,.hc)                          @@\
409         $(RM) CAT3(file,way,.o)                                 @@\
410         @if [ ! -d file ] ; then mkdir file ; else exit 0 ; fi  @@\
411         @find file -name find_pat -print | xargs $(RM) __rm_food @@\
412         $(GHC) -c $(GHCFLAGS) flags CAT3(file,way,.hc) -odir file -osuf osuff @@\
413         touch CAT3(file,way,.o)                                 @@\
414 clean ::                                                        @@\
415         $(RM) CAT3(file,way,.o)                                 @@\
416         find file -name find_pat -print | xargs $(RM) __rm_food
417
418 #define DoHs(file,isuf,way,flags,osuf,find_pat)                 \
419 CompilePreludishly__(file,isuf,way,flags)                       @@\
420 ObjectifyPreludishly__(file,way,flags,osuf,find_pat)
421
422 /* here we go: (NB: do not make .hc files for _u [unregisterized]) */
423
424 #define CompilePreludishly(file,isuf,flags)                     @@\
425 IfGhcBuild_normal(DoHs(file,isuf,,flags $(GHC_OPTS_norm),'o',   '*.o')) \
426 IfGhcBuild_p(DoHs(file,isuf,_p,   flags $(GHC_OPTS_p),   'p_o',  '*.p_o'))      \
427 IfGhcBuild_t(DoHs(file,isuf,_t,   flags $(GHC_OPTS_t),   't_o',  '*.t_o'))      \
428 IfGhcBuild_mc(DoHs(file,isuf,_mc, flags $(GHC_OPTS_mc),  'mc_o', '*.mc_o'))     \
429 IfGhcBuild_mr(DoHs(file,isuf,_mr, flags $(GHC_OPTS_mr),  'mr_o', '*.mr_o'))     \
430 IfGhcBuild_mt(DoHs(file,isuf,_mt, flags $(GHC_OPTS_mt),  'mt_o', '*.mt_o'))     \
431 IfGhcBuild_mp(DoHs(file,isuf,_mp, flags $(GHC_OPTS_mp),  'mp_o', '*.mp_o'))     \
432 IfGhcBuild_mg(DoHs(file,isuf,_mg, flags $(GHC_OPTS_mg),  'mg_o', '*.mg_o'))     \
433 IfGhcBuild_2s(DoHs(file,isuf,_2s, flags $(GHC_OPTS_2s),  '2s_o', '*.2s_o'))     \
434 IfGhcBuild_1s(DoHs(file,isuf,_1s, flags $(GHC_OPTS_1s),  '1s_o', '*.1s_o'))     \
435 IfGhcBuild_du(DoHs(file,isuf,_du, flags $(GHC_OPTS_du),  'du_o', '*.du_o'))     \
436 IfGhcBuild_a(DoHs(file,isuf,_a,   flags $(GHC_OPTS_a),   'a_o',  '*.a_o'))      \
437 IfGhcBuild_b(DoHs(file,isuf,_b,   flags $(GHC_OPTS_b),   'b_o',  '*.b_o'))      \
438 IfGhcBuild_c(DoHs(file,isuf,_c,   flags $(GHC_OPTS_c),   'c_o',  '*.c_o'))      \
439 IfGhcBuild_d(DoHs(file,isuf,_d,   flags $(GHC_OPTS_d),   'd_o',  '*.d_o'))      \
440 IfGhcBuild_e(DoHs(file,isuf,_e,   flags $(GHC_OPTS_e),   'e_o',  '*.e_o'))      \
441 IfGhcBuild_f(DoHs(file,isuf,_f,   flags $(GHC_OPTS_f),   'f_o',  '*.f_o'))      \
442 IfGhcBuild_g(DoHs(file,isuf,_g,   flags $(GHC_OPTS_g),   'g_o',  '*.g_o'))      \
443 IfGhcBuild_h(DoHs(file,isuf,_h,   flags $(GHC_OPTS_h),   'h_o',  '*.h_o'))      \
444 IfGhcBuild_i(DoHs(file,isuf,_i,   flags $(GHC_OPTS_i),   'i_o',  '*.i_o'))      \
445 IfGhcBuild_j(DoHs(file,isuf,_j,   flags $(GHC_OPTS_j),   'j_o',  '*.j_o'))      \
446 IfGhcBuild_k(DoHs(file,isuf,_k,   flags $(GHC_OPTS_k),   'k_o',  '*.k_o'))      \
447 IfGhcBuild_l(DoHs(file,isuf,_l,   flags $(GHC_OPTS_l),   'l_o',  '*.l_o'))      \
448 IfGhcBuild_m(DoHs(file,isuf,_m,   flags $(GHC_OPTS_m),   'm_o',  '*.m_o'))      \
449 IfGhcBuild_n(DoHs(file,isuf,_n,   flags $(GHC_OPTS_n),   'n_o',  '*.n_o'))      \
450 IfGhcBuild_o(DoHs(file,isuf,_o,   flags $(GHC_OPTS_o),   'o_o',  '*.o_o'))      \
451 IfGhcBuild_A(DoHs(file,isuf,_A,   flags $(GHC_OPTS_A),   'A_o',  '*.A_o'))      \
452 IfGhcBuild_B(DoHs(file,isuf,_B,   flags $(GHC_OPTS_B),   'B_o',  '*.B_o'))
453
454 /* now use the macro: */
455
456 CompilePreludishly(prelude/Prelude,hs,-iprelude -fglasgow-exts -fcompiling-ghc-internals Prelude -fno-implicit-prelude)
457 CompilePreludishly(prelude/GHCbase,hs,-iprelude -fglasgow-exts -fcompiling-ghc-internals GHCbase)
458 CompilePreludishly(prelude/GHCbase2,hs,-iprelude -fglasgow-exts -fcompiling-ghc-internals GHCbase2)
459 CompilePreludishly(prelude/GHCps,hs,  -iprelude -fglasgow-exts)
460 CompilePreludishly(prelude/GHCio,hs,  -iprelude -fglasgow-exts)
461 CompilePreludishly(prelude/GHCmain,hs,-iprelude -fglasgow-exts)
462 CompilePreludishly(prelude/PreludeGlaST,hs,-iprelude -fglasgow-exts)
463
464 CompilePreludishly(required/Array,hs,-fglasgow-exts -iprelude)
465 CompilePreludishly(required/Char,hs,)
466 CompilePreludishly(required/Complex,hs,)
467 CompilePreludishly(required/Directory,hs,-fglasgow-exts)
468 CompilePreludishly(required/IO,hs,-fglasgow-exts)
469 CompilePreludishly(required/Ix,hs,-fglasgow-exts)
470 CompilePreludishly(required/List,hs,)
471 CompilePreludishly(required/Maybe,hs,)
472 CompilePreludishly(required/Monad,hs,)
473 CompilePreludishly(required/Ratio,hs,)
474 CompilePreludishly(required/System,hs,-fglasgow-exts)
475
476 CompilePreludishly(concurrent/Channel,hs,)
477 CompilePreludishly(concurrent/ChannelVar,hs,)
478 CompilePreludishly(concurrent/Merge,hs,-iconcurrent)
479 CompilePreludishly(concurrent/Parallel,hs,)
480 CompilePreludishly(concurrent/SampleVar,hs,)
481 CompilePreludishly(concurrent/Semaphore,hs,)
482 CompilePreludishly(concurrent/Concurrent,hs,-iconcurrent)
483
484 /****************************************************************
485 *                                                               *
486 * misc "make" targets -- depend, clean, tags                    *
487 *                                                               *
488 ****************************************************************/
489
490 /* this is a BAD idea!
491 ExtraStuffToClean( $(SRCS_C) )
492    without the .hc files, the distrib cannot boot itself
493 */
494 ExtraStuffToBeVeryClean( $(SRCS_C) )
495 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
496
497 ClearTagsFile()
498 /* Ugly but OK? [WDP 94/09] */
499 HsTagsTarget( */[A-Z]*.*hs )
500 HSTAGS_OPTS=-cpp -fglasgow-exts
501
502 /* should be *LAST* */
503 #if HaskellCompilerType != HC_USE_HC_FILES
504     /* otherwise, the dependencies jeopardize our .hc files --
505         which are all we have! */
506 MAIN_INCLUDE_DIR = $(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
507 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) 
508
509 HaskellDependTarget( $(BASIC_HS_PREL) )
510 #endif