[project @ 1996-01-22 18:37:39 by partain]
[ghc-hetmet.git] / ghc / compiler / Jmakefile
1 /* preliminaries */
2
3 /* (only subdir is the test suite) */
4
5 #if IncludeTestDirsInBuild == YES
6 # define IHaveSubdirs
7
8 # define __ghc_compiler_tests_dir tests
9 #else
10 # define __ghc_compiler_tests_dir /* nothing */
11 #endif
12 SUBDIRS = __ghc_compiler_tests_dir
13 #undef __ghc_compiler_tests_dir
14 /* ?????? ToDo: something about test dirs underneath yaccParser ????? */
15
16 #if BuildDataParallelHaskell != YES
17     /* DPH likes to play around in subdirs */
18 # define NoAllTargetForSubdirs
19 # define NoDocsTargetForSubdirs
20 # define NoInstallDocsTargetForSubdirs
21 # define NoDependTargetForSubdirs
22 #endif
23     /* these always apply */
24 # define NoInstallTargetForSubdirs
25 #define NoTagTargetForSubdirs
26
27 /* Suffix rules: we do not use them much at all in GHC.
28    We need some magic stuff (from suffixes-GEN.ljm) for
29    the parser files.
30 */
31 SuffixRules_flexish()
32 SuffixRule_c_o()
33 LitSuffixRule(.lprl,.prl) /* for makeSymbolList.prl */
34
35 /* assume ALL source is in subdirectories one level below
36    they don't have Jmakefiles; this Jmakefile controls everything
37 */
38
39 SUBDIR_LIST = \ /* here they are, colon separated (for mkdependHS) */
40 utils:basicTypes:uniType:abstractSyn:prelude:envs:rename:typecheck:deSugar:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen:nativeGen:absCSyn:main:reader:profiling:deforest:podizeCore:yaccParser:nhcParser:interpreter
41
42 DASH_I_SUBDIR_LIST = \ /* same thing, in -I<dir> format */
43 -Iutils -IbasicTypes -IuniType -IabstractSyn -Iprelude -Ienvs -Irename -Itypecheck -IdeSugar -IcoreSyn -Ispecialise -IsimplCore -Istranal -IstgSyn -IsimplStg -IcodeGen -InativeGen -IabsCSyn -Imain -Ireader -Iprofiling -Ideforest -IpodizeCore -IyaccParser -InhcParser -Iinterpreter
44
45 #ifdef MainIncludeDir
46 MAIN_INCLUDE_DIR=MainIncludeDir
47 #else
48 MAIN_INCLUDE_DIR=$(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
49 #endif
50
51 /* helps to find GhcConstants.h in codeGen/CgCompInfo.lhs */
52 #ifdef CompInfoDir
53 COMPINFO_DIR=CompInfoDir
54 #else
55 COMPINFO_DIR=$(TOP_PWD)/$(CURRENT_DIR)/codeGen
56 #endif
57 /* nativeGen, elsewhere */
58 #ifdef NativeGenDir
59 NATIVEGEN_DIR=NativeGenDir
60 #else
61 NATIVEGEN_DIR=$(TOP_PWD)/$(CURRENT_DIR)/nativeGen
62 #endif
63
64 /* in order-of-passes order, utility modules at the end */
65
66 #if GhcBuilderVersion >= 23 && GhcBuildeeVersion >= 23
67 # define USE_NEW_READER YES
68 # define __new_reader_flag -DUSE_NEW_READER=1
69 #else
70 # define __new_reader_flag /*none*/
71 #endif
72 #if USE_NEW_READER == YES
73 # define READERSRCS_HS  \
74 yaccParser/U_atype.hs   \
75 yaccParser/U_binding.hs \
76 yaccParser/U_coresyn.hs \
77 yaccParser/U_entidt.hs  \
78 yaccParser/U_finfot.hs  \
79 yaccParser/U_hpragma.hs \
80 yaccParser/U_list.hs    \
81 yaccParser/U_literal.hs \
82 yaccParser/U_pbinding.hs \
83 yaccParser/U_treeHACK.hs \
84 yaccParser/U_ttype.hs
85 #define READERSRCS_LHS  \
86 yaccParser/UgenUtil.lhs \
87 yaccParser/UgenAll.lhs  \
88 reader/ReadPrefix2.lhs  \
89 reader/ReadPragmas2.lhs
90 #define hsp_library libhsp.a
91 #else
92 #define READERSRCS_HS   /* none */
93 #define READERSRCS_LHS  \
94 reader/ReadPrefix.lhs   \
95 reader/ReadPragmas.lhs
96 #define hsp_library /*none*/
97 #endif
98
99 #define FRONTSRCS_LHS   \
100 reader/PrefixSyn.lhs    \
101 reader/PrefixToHs.lhs   \
102 \
103 basicTypes/Unique.lhs   \
104 basicTypes/SplitUniq.lhs \
105 basicTypes/ProtoName.lhs \
106 basicTypes/NameTypes.lhs \
107 basicTypes/SrcLoc.lhs   \
108 basicTypes/Id.lhs       \
109 basicTypes/IdInfo.lhs   \
110 basicTypes/Inst.lhs     \
111 basicTypes/BasicLit.lhs \
112 basicTypes/CLabelInfo.lhs \
113 basicTypes/OrdList.lhs \
114 \
115 uniType/TyVar.lhs       \
116 uniType/TyCon.lhs       \
117 uniType/Class.lhs       \
118 uniType/UniType.lhs     \
119 uniType/UniTyFuns.lhs   \
120 uniType/AbsUniType.lhs  \
121 \
122 abstractSyn/Name.lhs /* abstract Haskell syntax */ \
123 abstractSyn/HsCore.lhs \
124 abstractSyn/HsPragmas.lhs \
125 abstractSyn/HsImpExp.lhs \
126 abstractSyn/HsDecls.lhs \
127 abstractSyn/HsBinds.lhs \
128 abstractSyn/HsMatches.lhs \
129 abstractSyn/HsLit.lhs \
130 abstractSyn/HsExpr.lhs \
131 abstractSyn/HsPat.lhs \
132 abstractSyn/HsTypes.lhs \
133 abstractSyn/AbsSyn.lhs \
134 abstractSyn/AbsSynFuns.lhs \
135 \
136 rename/Rename.lhs \
137 rename/Rename1.lhs \
138 rename/Rename2.lhs \
139 rename/Rename3.lhs \
140 rename/Rename4.lhs \
141 rename/RenameAuxFuns.lhs \
142 rename/RenameMonad12.lhs \
143 rename/RenameMonad3.lhs \
144 rename/RenameMonad4.lhs \
145 rename/RenameBinds4.lhs \
146 rename/RenameExpr4.lhs
147
148 #define TCSRCS_LHS \
149 prelude/PrelFuns.lhs \
150 prelude/PrimKind.lhs \
151 prelude/PrimOps.lhs \
152 prelude/TysPrim.lhs \
153 prelude/TysWiredIn.lhs \
154 prelude/PrelVals.lhs \
155 prelude/AbsPrel.lhs \
156 \
157 envs/IdEnv.lhs \
158 envs/TyVarEnv.lhs \
159 envs/LIE.lhs \
160 envs/CE.lhs \
161 envs/E.lhs \
162 envs/InstEnv.lhs \
163 envs/TCE.lhs \
164 envs/TVE.lhs \
165 \
166 typecheck/BackSubst.lhs \
167 typecheck/Disambig.lhs \
168 typecheck/GenSpecEtc.lhs \
169 typecheck/Spec.lhs \
170 typecheck/Subst.lhs     \
171 typecheck/TcBinds.lhs \
172 typecheck/TcClassDcl.lhs \
173 typecheck/TcClassSig.lhs \
174 typecheck/TcConDecls.lhs \
175 typecheck/TcContext.lhs \
176 typecheck/TcDefaults.lhs \
177 typecheck/TcDeriv.lhs \
178 typecheck/TcExpr.lhs \
179 typecheck/TcGRHSs.lhs \
180 typecheck/TcGenDeriv.lhs \
181 typecheck/TcIfaceSig.lhs \
182 typecheck/TcInstDcls.lhs \
183 typecheck/TcMatches.lhs \
184 typecheck/TcModule.lhs \
185 typecheck/TcMonad.lhs \
186 typecheck/TcMonadFns.lhs \
187 typecheck/TcMonoBnds.lhs \
188 typecheck/TcMonoType.lhs \
189 typecheck/TcPat.lhs \
190 typecheck/TcPolyType.lhs \
191 typecheck/TcPragmas.lhs \
192 typecheck/TcQuals.lhs \
193 typecheck/TcSimplify.lhs \
194 typecheck/TcTyDecls.lhs \
195 typecheck/Typecheck.lhs \
196 typecheck/Unify.lhs
197
198 #define DSSRCS_LHS \
199 coreSyn/AnnCoreSyn.lhs \
200 coreSyn/CoreSyn.lhs \
201 coreSyn/PlainCore.lhs \
202 coreSyn/TaggedCore.lhs \
203 coreSyn/CoreFuns.lhs \
204 coreSyn/CoreUnfold.lhs \
205 coreSyn/FreeVars.lhs \
206 coreSyn/CoreLift.lhs \
207 coreSyn/CoreLint.lhs \
208 \
209 deSugar/Desugar.lhs \
210 deSugar/Match.lhs \
211 deSugar/MatchCon.lhs \
212 deSugar/MatchLit.lhs \
213 deSugar/DsBinds.lhs \
214 deSugar/DsCCall.lhs \
215 deSugar/DsExpr.lhs \
216 deSugar/DsGRHSs.lhs \
217 deSugar/DsListComp.lhs \
218 deSugar/DsMonad.lhs \
219 deSugar/DsUtils.lhs \
220 \
221 specialise/Specialise.lhs \
222 specialise/SpecTyFuns.lhs \
223 \
224 simplCore/SimplCase.lhs \
225 simplCore/SimplEnv.lhs \
226 simplCore/SimplMonad.lhs \
227 simplCore/SimplPgm.lhs \
228 simplCore/SimplUtils.lhs \
229 simplCore/SimplVar.lhs \
230 simplCore/Simplify.lhs \
231 \
232 simplCore/LiberateCase.lhs \
233 \
234 simplCore/BinderInfo.lhs \
235 simplCore/ConFold.lhs \
236 simplCore/FloatIn.lhs \
237 simplCore/FloatOut.lhs \
238 simplCore/MagicUFs.lhs \
239 simplCore/SAT.lhs \
240 simplCore/SATMonad.lhs \
241 simplCore/SetLevels.lhs \
242 simplCore/SimplCore.lhs \
243 simplCore/OccurAnal.lhs \
244 simplCore/NewOccurAnal.lhs \
245 simplCore/FoldrBuildWW.lhs \
246 simplCore/AnalFBWW.lhs \
247 \
248 stranal/StrictAnal.lhs \
249 stranal/SaLib.lhs \
250 stranal/SaAbsInt.lhs \
251 stranal/WwLib.lhs \
252 stranal/WorkWrap.lhs \
253 \
254 profiling/SCCauto.lhs \
255 profiling/SCCfinal.lhs \
256 profiling/CostCentre.lhs
257
258 #if UseSemantiqueStrictnessAnalyser != YES
259 #define SEM_STRANAL_SRCS_LHS /* omit */
260 #else
261 #define SEM_STRANAL_SRCS_LHS \
262 stranal-sem/AFE.lhs \
263 stranal-sem/AbsVal.lhs \
264 stranal-sem/AssocPair.lhs \
265 stranal-sem/BuildAFE.lhs \
266 stranal-sem/ConstrEnv.lhs \
267 stranal-sem/Cycles.lhs \
268 stranal-sem/FG.lhs \
269 stranal-sem/FourProj.lhs \
270 stranal-sem/OAL.lhs \
271 stranal-sem/OAT.lhs \
272 stranal-sem/OL.lhs \
273 stranal-sem/ProgEnv.lhs \
274 stranal-sem/ProjBasic.lhs \
275 stranal-sem/ProjFactor.lhs  \
276 stranal-sem/ProjFolds.lhs  \
277 stranal-sem/ProjGets.lhs  \
278 stranal-sem/ProjLubAnd.lhs \
279 stranal-sem/REL.lhs \
280 stranal-sem/StrAnal.lhs \
281 stranal-sem/StrAnn.lhs \
282 stranal-sem/StrAnnCore.lhs \
283 stranal-sem/StrAnnUtil.lhs \
284 stranal-sem/StrTypeEnv.lhs \
285 stranal-sem/Transformer.lhs \
286 stranal-sem/Tree.lhs
287 #endif /* UseSemantiqueStrictnessAnalyser */
288
289 #if GhcWithDeforester != YES
290 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
291 #define DEFORESTER_SRCS_LHS /*none*/
292 #else
293 #define __omit_deforester_flag /*nope*/
294 #define DEFORESTER_SRCS_LHS \
295 deforest/DefSyn.lhs \
296 deforest/Core2Def.lhs \
297 deforest/Def2Core.lhs \
298 deforest/Deforest.lhs \
299 deforest/DefUtils.lhs \
300 deforest/DefExpr.lhs \
301 deforest/Cyclic.lhs \
302 deforest/TreelessForm.lhs
303 #endif /* GhcWithDeforester */
304
305 #if BuildGHCI != YES
306 #define __build_ghci_flag /*nope*/
307 #define NHCSRCS_LHS /* omit */
308 #define GHCISRCS_LHS /* omit */
309 #else
310 #define __build_ghci_flag -DBUILD_GHCI=1
311 #define NHCSRCS_LHS \
312 nhcParser/Parse.lhs      \
313 nhcParser/ParseCore.lhs  \
314 nhcParser/ParseLib.lhs   \
315 nhcParser/ParseLex.lhs   \
316 nhcParser/PPSyntax.lhs   \
317 nhcParser/PPLib.lhs      \
318 nhcParser/Lexical.lhs    \
319 nhcParser/Lex.lhs        \
320 nhcParser/LexPre.lhs     \
321 nhcParser/LexStr.lhs     \
322 nhcParser/HS.lhs         \
323 nhcParser/MkSyntax.lhs   \
324 nhcParser/SyntaxPos.lhs  \
325 nhcParser/Syntax.lhs     \
326 nhcParser/Extra.lhs      \
327 nhcParser/ScopeLib.lhs   \
328 nhcParser/Import.lhs     \
329 nhcParser/AttrLib.lhs    \
330 nhcParser/Attr.lhs       \
331 nhcParser/NHCName.lhs    \
332 nhcParser/NameLow.lhs    \
333 nhcParser/ParseI.lhs     \
334 nhcParser/Tree234.lhs    \
335 nhcParser/MergeSort.lhs  \
336 nhcParser/StrName.lhs    \
337 nhcParser/NameLib.lhs    \
338 nhcParser/OsOnly.lhs     \
339 nhcParser/Flags.lhs      \
340 nhcParser/Fixity.lhs     \
341 nhcParser/StrSyntax.lhs  \
342 nhcParser/Either.lhs     \
343 nhcParser/ListUtil.lhs   \
344 nhcParser/NHCPackedString.lhs \
345 nhcParser/HbcOnly.lhs    \
346 nhcParser/LexLow.lhs     
347
348 /* Bits we don't need after all.  ToDo: delete their source...
349 nhcParser/IName.lhs      \
350 nhcParser/IExtract.lhs   \
351 nhcParser/Error.lhs      \
352 nhcParser/BindLib.lhs    \
353 nhcParser/BindI.lhs      
354 */
355
356 #define GHCISRCS_LHS \
357 interpreter/ToPrefix.lhs   \
358 interpreter/UnsafeCoerce.lhs \
359 interpreter/Dynamic.lhs \
360 interpreter/Interpreter.lhs \
361 interpreter/MkInterface.lhs \
362 interpreter/GHCIMonad.lhs  \
363 interpreter/FullEnv.lhs  \
364 interpreter/Command.lhs    \
365 interpreter/GHCIFlags.lhs        \
366 interpreter/GHCInterface.lhs \
367 interpreter/GHCI.lhs \
368 interpreter/GHCICore.lhs \
369 interpreter/Dld.lhs
370
371 /* ToDo: mkworld-ify */
372 DLD_DIR         = ./dld
373 DLD_LIB         = $(DLD_DIR)/libdld.a
374 DLD_INCLUDE     = $(DLD_DIR)/dld.h
375
376 DLD_OBJS_O =                    \
377         dld/dld.o               \
378         dld/find_exec.o         \
379         dld/define.o            \
380         dld/get_func.o          \
381         dld/get_symbol.o        \
382         dld/list_undef.o        \
383         dld/mk_dummy.o          \
384         dld/ref.o               \
385         dld/ul_file.o           \
386         dld/ul_symbol.o         \
387         dld/remove.o            \
388         dld/error.o
389
390 #endif /* BuildGHCI */
391
392 #define BACKSRCS_LHS \
393 stgSyn/CoreToStg.lhs \
394 stgSyn/StgSyn.lhs \
395 stgSyn/StgFuns.lhs \
396 stgSyn/StgLint.lhs \
397 \
398 simplStg/SatStgRhs.lhs \
399 simplStg/LambdaLift.lhs \
400 simplStg/StgVarInfo.lhs \
401 simplStg/UpdAnal.lhs \
402 simplStg/StgStats.lhs \
403 simplStg/StgSATMonad.lhs \
404 simplStg/StgSAT.lhs \
405 simplStg/SimplStg.lhs \
406 \
407 absCSyn/AbsCSyn.lhs \
408 absCSyn/Costs.lhs \
409 absCSyn/HeapOffs.lhs \
410 absCSyn/AbsCFuns.lhs \
411 absCSyn/PprAbsC.lhs \
412 \
413 codeGen/CodeGen.lhs \
414 codeGen/ClosureInfo.lhs \
415 codeGen/SMRep.lhs \
416 codeGen/CgConTbls.lhs \
417 codeGen/CgCompInfo.lhs \
418 codeGen/CgMonad.lhs \
419 codeGen/CgUsages.lhs \
420 codeGen/CgHeapery.lhs \
421 codeGen/CgStackery.lhs \
422 codeGen/CgExpr.lhs \
423 codeGen/CgCase.lhs \
424 codeGen/CgLetNoEscape.lhs \
425 codeGen/CgTailCall.lhs \
426 codeGen/CgClosure.lhs \
427 codeGen/CgCon.lhs \
428 codeGen/CgRetConv.lhs \
429 codeGen/CgBindery.lhs \
430 codeGen/CgUpdate.lhs
431
432 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
433     /* if building via C, we *assume* that it is the
434        distributed C files, which do not have a native-code
435        generator in them
436     */
437 #define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
438 #define NATIVEGEN_SRCS_LHS /*none*/
439 #else
440 #define __omit_ncg_maybe /*none*/
441 #if i386_TARGET_ARCH
442 #define __machdep_nativegen_lhs \
443 nativeGen/I386Desc.lhs \
444 nativeGen/I386Code.lhs \
445 nativeGen/I386Gen.lhs
446 #define __ghci_machdep_nativegen_lhs \
447 nativeGen/I386Code.lhs
448 #endif
449 #if sparc_TARGET_ARCH
450 #define __machdep_nativegen_lhs \
451 nativeGen/SparcDesc.lhs \
452 nativeGen/SparcCode.lhs \
453 nativeGen/SparcGen.lhs
454 #define __ghci_machdep_nativegen_lhs \
455 nativeGen/SparcCode.lhs
456 #endif
457 #if alpha_TARGET_ARCH
458 #define __machdep_nativegen_lhs \
459 nativeGen/AlphaDesc.lhs \
460 nativeGen/AlphaCode.lhs \
461 nativeGen/AlphaGen.lhs
462 #define __ghci_machdep_nativegen_lhs \
463 nativeGen/AlphaCode.lhs
464 #endif
465
466 #define NATIVEGEN_SRCS_LHS \
467 nativeGen/AbsCStixGen.lhs \
468 nativeGen/AsmCodeGen.lhs \
469 nativeGen/AsmRegAlloc.lhs \
470 nativeGen/MachDesc.lhs \
471 nativeGen/Stix.lhs \
472 nativeGen/StixInfo.lhs \
473 nativeGen/StixInteger.lhs \
474 nativeGen/StixPrim.lhs \
475 nativeGen/StixMacro.lhs \
476 __machdep_nativegen_lhs /*arch-specific ones */
477 #endif
478
479 #define UTILSRCS_LHS \
480 utils/CharSeq.lhs \
481 utils/Bag.lhs \
482 utils/Pretty.lhs \
483 utils/Unpretty.lhs \
484 utils/Maybes.lhs \
485 utils/Digraph.lhs \
486 utils/BitSet.lhs \
487 utils/LiftMonad.lhs \
488 utils/ListSetOps.lhs \
489 utils/Outputable.lhs \
490 utils/FiniteMap.lhs \
491 utils/UniqFM.lhs \
492 utils/UniqSet.lhs \
493 utils/Util.lhs
494
495 #if BuildDataParallelHaskell != YES
496 #define DPH_SRCS_LHS /*none*/
497 #else
498 #define DPH_SRCS_LHS \
499 \
500 typecheck/TcParQuals.lhs \
501 deSugar/DsParZF.lhs \
502 deSugar/MatchProc.lhs \
503 prelude/ClsPid.lhs \
504 prelude/ClsProc.lhs \
505 prelude/TyPod.lhs \
506 prelude/TyProcs.lhs \
507 \
508 podizeCore/PodInfoTree.lhs \
509 podizeCore/PodInfoMonad.lhs \
510 podizeCore/PodInfo1.lhs \
511 podizeCore/PodInfo2.lhs \
512 podizeCore/PodizeMonad.lhs \
513 podizeCore/PodizePass0.lhs \
514 podizeCore/PodizePass1.lhs \
515 podizeCore/PodizePass2.lhs \
516 podizeCore/PodizeCore.lhs
517 #endif /* DPH */
518
519 #define MAIN_SRCS_LHS \
520 main/MkIface.lhs \
521 main/ErrUtils.lhs \
522 main/ErrsRn.lhs \
523 main/ErrsTc.lhs \
524 main/Errors.lhs \
525 main/MainMonad.lhs \
526 main/CmdLineOpts.lhs \
527 main/Main.lhs
528
529 ALLSRCS_HS = READERSRCS_HS
530 ALLSRCS_LHS = /* all pieces of the compiler */ \
531 READERSRCS_LHS \
532 FRONTSRCS_LHS \
533 TCSRCS_LHS \
534 DSSRCS_LHS \
535 BACKSRCS_LHS \
536 MAIN_SRCS_LHS \
537 UTILSRCS_LHS NATIVEGEN_SRCS_LHS DEFORESTER_SRCS_LHS SEM_STRANAL_SRCS_LHS DPH_SRCS_LHS NHCSRCS_LHS GHCISRCS_LHS
538 /* NB: all the ones that may be empty (e.g., DPH_SRCS_LHS)
539         need to be on the last line.
540 */
541
542 HSCSRCS_HS = READERSRCS_HS
543 HSCSRCS_LHS = /* all pieces of the compiler */ \
544 READERSRCS_LHS \
545 FRONTSRCS_LHS \
546 TCSRCS_LHS \
547 DSSRCS_LHS \
548 BACKSRCS_LHS \
549 MAIN_SRCS_LHS \
550 UTILSRCS_LHS NATIVEGEN_SRCS_LHS DEFORESTER_SRCS_LHS SEM_STRANAL_SRCS_LHS DPH_SRCS_LHS
551
552 /* 
553 As well as the obvious inclusions, there are a few non-obvious ones
554 obtained from the transitive closure:
555
556 * main/Errors.lhs andmain/CmdLineOpts.lhs are actually used.
557
558 * most of the rest trickles in through the prelude.
559
560 ToDo: hack around in the prelude to avoid all this...
561
562 */
563
564 GHCISRCS = /* all pieces of the interpreter */ \
565 FRONTSRCS_LHS \
566 TCSRCS_LHS \
567 DSSRCS_LHS \
568 main/Errors.lhs \
569 main/ErrUtils.lhs \
570 main/ErrsRn.lhs \
571 main/ErrsTc.lhs \
572 main/CmdLineOpts.lhs \
573 main/MainMonad.lhs \
574 absCSyn/HeapOffs.lhs \
575 codeGen/SMRep.lhs \
576 codeGen/CgCompInfo.lhs \
577 codeGen/ClosureInfo.lhs \
578 codeGen/CgRetConv.lhs \
579 absCSyn/AbsCSyn.lhs \
580 codeGen/CgMonad.lhs \
581 absCSyn/AbsCFuns.lhs \
582 codeGen/CgBindery.lhs \
583 codeGen/CgUsages.lhs \
584 absCSyn/Costs.lhs \
585 absCSyn/PprAbsC.lhs \
586 stgSyn/StgSyn.lhs \
587 nativeGen/AsmRegAlloc.lhs __ghci_machdep_nativegen_lhs \
588 UTILSRCS_LHS SEM_STRANAL_SRCS_LHS DEFORESTER_SRCS_LHS NHCSRCS_LHS GHCISRCS_LHS
589
590
591 /* should't use these fancy `make' things, really */
592 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o)  $(ALLSRCS_HS:.hs=.o)
593 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
594
595 HSCOBJS=$(HSCSRCS_LHS:.lhs=.o)  $(HSCSRCS_HS:.hs=.o)
596 HSCINTS=$(HSCSRCS_LHS:.lhs=.hi) $(HSCSRCS_HS:.hs=.hi)
597
598 GHCIOBJS=$(GHCISRCS:.lhs=.o) interpreter/DldHacks.o interpreter/DldC.o interpreter/prelude.o interpreter/runtime.o
599 GHCIINTS=$(GHCISRCS:.lhs=.hi) interpreter/Dldhacks.hi
600
601 .PRECIOUS: $(ALLINTS)
602
603 #if GhcWithHscDebug == YES
604 # define use_DDEBUG -DDEBUG
605 #else
606 # define use_DDEBUG /*nothing*/
607 #endif
608
609 #if HaskellCompilerType == HC_CHALMERS_HBC
610
611 HC_OPTS = -D__HASKELL1__=2 -M -H12m -DCOMPILING_GHC use_DDEBUG -I. -i$(SUBDIR_LIST)
612
613 /* ToDo: else something for Niklas Rojemo's NHC (not yet) */
614
615 #else /* assume we either have GlasgowHaskell or are booting from .hc C files */
616
617 #if GhcWithHscOptimised == YES
618 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
619 #else
620 #define __version_sensitive_flags -fomit-reexported-instances
621 #endif
622
623 #if GhcWithRegisterised == NO
624     /* doing a raw boot from .hc files, presumably */
625 #define __unreg_opts_maybe -O -unregisterised
626 #else
627 #define __unreg_opts_maybe /*none*/
628 #endif
629
630 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
631 #undef  AllProjectsHcOpts
632 #define AllProjectsHcOpts /**/
633
634 HC_OPTS = -cpp -H12m HcMaxHeapFlag -fglasgow-exts -DCOMPILING_GHC \
635         -fomit-derived-read \
636         -I. -i$(SUBDIR_LIST) \
637         use_DDEBUG __version_sensitive_flags __unreg_opts_maybe __omit_ncg_maybe __new_reader_flag __build_ghci_flag __omit_deforester_flag
638
639 #undef __version_sensitive_flags
640 #undef __unreg_opts_maybe
641 #undef __omit_ncg_maybe
642 #undef __new_reader_flag
643 #undef __build_ghci_flag
644 #undef __omit_deforester_flag
645
646 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
647
648 HSCHCS=$(HSCSRCS_LHS:.lhs=.hc) $(HSCSRCS_HS:.hs=.hc)
649 hcs:: $(HSCHCS)
650
651 #if HaskellCompilerType == HC_USE_HC_FILES
652 HC = $(GHC) /* uses the driver herein */
653 #endif
654
655 #endif /* using .hc files */
656 #endif /* not using HBC */
657
658 /*
659     -DCOMPILING_GHC
660         we're compiling the compiler with itself; clear enough?
661         Only used at present to ask for SPECIALIZEd functions
662         in modules that are allegedly "generic" (e.g., FiniteMap).
663
664     -DUSE_SEMANTIQUE_STRANAL
665         to include the Semantique strictness analyser into the compiler
666         [probably quite moth-eaten by now 94/05 (WDP)]
667
668     -DDPH       compiling Jon Hill's "data parallel Haskell"
669
670     (there are more, as yet unlisted WDP 94/12)
671 */
672 #if UseSemantiqueStrictnessAnalyser == YES
673 STRANAL_SEM_P = -DUSE_SEMANTIQUE_STRANAL
674 #endif
675
676 #if BuildDataParallelHaskell == YES
677 DPH_P = -DDPH
678 #endif
679
680 #if GhcUseSplittableUniqueSupply == YES
681 /* ToDo: delete? */
682 SPLIT_P = -DUSE_SPLITTABLE_UNIQUESUPPLY
683 #endif
684
685 GHC_EXTRA_DEFINES = $(STRANAL_SEM_P) $(DPH_P) $(SPLIT_P)
686
687 #if USE_NEW_READER == YES
688 BuildPgmFromHaskellModules(hsc,$(HSCOBJS) yaccParser/hsclink.o yaccParser/hschooks.o,,libhsp.a)
689 #else
690 BuildPgmFromHaskellModules(hsc,$(HSCOBJS),,)
691 #endif
692
693 /* ghci::       hsc */
694 /* Hack to let me bootstrap (needed for error handlers) */
695 /* Comment out if building boot copy of hsc */
696 /*HC = ../driver/ghc*/
697 #if BuildGHCI == YES
698 BuildPgmFromHaskellModules(ghci,$(GHCIOBJS),,$(DLD_LIB))
699 #endif
700
701 #if DoInstallGHCSystem == YES
702 MakeDirectories(install, $(INSTLIBDIR_GHC))
703 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
704 #endif
705
706 /* set up for going either to .hc or to .o files */
707 #if GhcWithHscBuiltViaC == YES
708
709 /*OLD:SuffixRule_hc_o() */
710
711 # if HaskellCompilerType == HC_USE_HC_FILES
712     /* if we do not, we never try to compile .lhs files;
713         we *blast* the macro we would normally use (HACK) (WDP 94/12)
714      */
715
716 #  undef HaskellCompileWithSpecifiedFlags
717 #  define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags)      @@\
718 module.osuf : module.isuf                                               \
719 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
720
721 #  define compile(module,isuf,extra_flags) \
722 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
723
724 #  define compile_rec(module,isuf,extra_flags) \
725 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
726
727 # else /* we do! */
728
729 #  define compile(module,isuf,extra_flags) \
730 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
731
732 #  define compile_rec(module,isuf,extra_flags) \
733 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
734
735 # endif /* ... == HC_USE_HC_FILES */
736
737 #else /* ! booting from C */
738
739 # define compile(module,isuf,extra_flags) \
740 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
741
742 # define compile_rec(module,isuf,extra_flags) \
743 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
744
745 #endif /* ! booting from C */
746
747 #if HaskellCompilerType == HC_CHALMERS_HBC
748 # define if_ghc(x)   /*nothing*/
749 # define if_ghc26(x) /*nothing*/
750 #else /* hope for GHC-ish */
751 # define if_ghc(x) x
752 # if GhcBuilderVersion >= 26
753 #  define if_ghc26(x) x
754 # else
755 #  define if_ghc26(x) /*nothing*/
756 # endif
757 #endif
758
759 /* OK, here we go: */
760
761 compile(absCSyn/AbsCFuns,lhs,)
762 compile_rec(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
763 compile(absCSyn/Costs,lhs,)              /* HWL */
764 compile_rec(absCSyn/HeapOffs,lhs,)
765 compile(absCSyn/PprAbsC,lhs,-H20m)
766
767 compile_rec(abstractSyn/AbsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
768 compile_rec(abstractSyn/AbsSynFuns,lhs,)
769 compile_rec(abstractSyn/HsBinds,lhs,)
770 compile_rec(abstractSyn/HsCore,lhs,)
771 compile(abstractSyn/HsDecls,lhs,)
772 compile_rec(abstractSyn/HsExpr,lhs,-H14m)
773 compile(abstractSyn/HsImpExp,lhs,)
774 compile(abstractSyn/HsLit,lhs,)
775 compile(abstractSyn/HsMatches,lhs,)
776 compile(abstractSyn/HsPat,lhs,)
777 compile_rec(abstractSyn/HsPragmas,lhs,)
778 compile(abstractSyn/HsTypes,lhs,)
779 compile_rec(abstractSyn/Name,lhs,)
780
781 compile(basicTypes/BasicLit,lhs,)
782 compile(basicTypes/OrdList,lhs,)
783 compile_rec(basicTypes/CLabelInfo,lhs,)
784 compile_rec(basicTypes/Id,lhs,-H20m)
785 compile_rec(basicTypes/IdInfo,lhs,-H20m -K2m)
786 compile(basicTypes/Inst,lhs,)
787 compile(basicTypes/NameTypes,lhs,)
788 compile(basicTypes/ProtoName,lhs,)
789 compile(basicTypes/SrcLoc,lhs,)
790 compile(basicTypes/Unique,lhs,)
791 compile_rec(basicTypes/SplitUniq,lhs,)
792
793 compile(codeGen/CgBindery,lhs,)
794 compile(codeGen/CgCase,lhs,-H16m)
795 compile(codeGen/CgClosure,lhs,-H16m)
796 compile_rec(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
797 compile(codeGen/CgCon,lhs,)
798 compile(codeGen/CgConTbls,lhs,)
799 compile_rec(codeGen/CgExpr,lhs,)
800 compile(codeGen/CgHeapery,lhs,)
801 compile(codeGen/CgLetNoEscape,lhs,)
802 compile_rec(codeGen/CgMonad,lhs,if_ghc(-fno-omit-reexported-instances))
803 compile_rec(codeGen/CgRetConv,lhs,)
804 compile(codeGen/CgStackery,lhs,)
805 compile(codeGen/CgTailCall,lhs,)
806 compile(codeGen/CgUpdate,lhs,)
807 compile(codeGen/CgUsages,lhs,)
808 compile_rec(codeGen/ClosureInfo,lhs,)
809 compile(codeGen/CodeGen,lhs,)
810 compile(codeGen/SMRep,lhs,)
811
812 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
813 compile(coreSyn/CoreFuns,lhs,-H16m)
814 compile(coreSyn/CoreLift,lhs,)
815 compile(coreSyn/CoreLint,lhs,)
816 compile(coreSyn/CoreSyn,lhs,)
817 compile(coreSyn/CoreUnfold,lhs,)
818 compile(coreSyn/FreeVars,lhs,)
819 compile_rec(coreSyn/PlainCore,lhs,if_ghc(-fno-omit-reexported-instances))
820 compile(coreSyn/TaggedCore,lhs,if_ghc(-fno-omit-reexported-instances))
821
822 compile(deSugar/Desugar,lhs,)
823 compile_rec(deSugar/DsBinds,lhs,-H16m)
824 compile(deSugar/DsCCall,lhs,)
825 compile_rec(deSugar/DsExpr,lhs,-H16m)
826 compile(deSugar/DsGRHSs,lhs,)
827 compile(deSugar/DsListComp,lhs,)
828 compile(deSugar/DsMonad,lhs,)
829 compile_rec(deSugar/DsUtils,lhs,)
830 compile_rec(deSugar/Match,lhs,)
831 compile(deSugar/MatchCon,lhs,)
832 compile(deSugar/MatchLit,lhs,)
833
834 compile(envs/CE,lhs,)
835 compile(envs/E,lhs,)
836 compile(envs/IdEnv,lhs,)
837 compile_rec(envs/InstEnv,lhs,)
838 compile(envs/LIE,lhs,)
839 compile(envs/TCE,lhs,)
840 compile(envs/TVE,lhs,)
841 compile_rec(envs/TyVarEnv,lhs,)
842
843 compile(main/CmdLineOpts,lhs,-K2m if_ghc(-fvia-C))
844 compile_rec(main/Errors,lhs,)
845 compile_rec(main/ErrsTc,lhs,-H20m if_ghc26(-monly-4-regs))
846 compile_rec(main/ErrsRn,lhs,)
847 compile_rec(main/ErrUtils,lhs,)
848 compile(main/Main,lhs,-H16m if_ghc(-fvia-C -fno-update-analysis)) /* ToDo: update */
849 compile(main/MainMonad,lhs,if_ghc(-fno-omit-reexported-instances))
850 compile(main/MkIface,lhs,)
851
852 #if GhcWithNativeCodeGen == YES
853 compile(nativeGen/AbsCStixGen,lhs,)
854 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
855 compile_rec(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR) -H20m)
856 compile(nativeGen/MachDesc,lhs,)
857 compile(nativeGen/Stix,lhs,)
858 compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
859 compile(nativeGen/StixInteger,lhs,-H20m)
860 compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
861 compile(nativeGen/StixPrim,lhs,-H16m)
862 # if i386_TARGET_ARCH
863 compile_rec(nativeGen/I386Desc,lhs,)
864 compile(nativeGen/I386Code,lhs,-H20m -I$(NATIVEGEN_DIR) if_ghc(-monly-4-regs))
865 compile(nativeGen/I386Gen,lhs,-H20m)
866 # endif
867 # if sparc_TARGET_ARCH
868 compile_rec(nativeGen/SparcDesc,lhs,)
869 compile(nativeGen/SparcCode,lhs,-H20m -I$(NATIVEGEN_DIR))
870 compile(nativeGen/SparcGen,lhs,-H20m)
871 # endif
872 # if alpha_TARGET_ARCH
873 compile_rec(nativeGen/AlphaDesc,lhs,)
874 compile(nativeGen/AlphaCode,lhs,-H24m -K2m -I$(NATIVEGEN_DIR))
875 compile(nativeGen/AlphaGen,lhs,-H24m -K2m)
876 # endif
877 #endif
878
879 compile_rec(prelude/AbsPrel,lhs,-H16m -K2m if_ghc(-fno-omit-reexported-instances -fno-update-analysis))
880 compile_rec(prelude/PrelFuns,lhs,)
881 compile(prelude/PrelVals,lhs,)
882 compile_rec(prelude/PrimKind,lhs,-I$(COMPINFO_DIR))
883 compile_rec(prelude/PrimOps,lhs,-H16m -K3m)
884 compile(prelude/TysPrim,lhs,)
885 compile(prelude/TysWiredIn,lhs,)
886
887 compile(profiling/SCCauto,lhs,)
888 compile(profiling/SCCfinal,lhs,)
889 compile(profiling/CostCentre,lhs,)
890
891 compile(reader/PrefixSyn,lhs,)
892 compile(reader/PrefixToHs,lhs,-H16m)
893 compile(reader/ReadPragmas,lhs,)
894 compile_rec(reader/ReadPrefix,lhs,)
895 compile_rec(reader/ReadPrefix2,lhs,-H20m if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
896 compile(reader/ReadPragmas2,lhs,-H20m)
897
898 compile(rename/Rename,lhs,)
899 compile(rename/Rename1,lhs,)
900 compile(rename/Rename2,lhs,)
901 compile(rename/Rename3,lhs,)
902 compile(rename/Rename4,lhs,-H20m)
903 compile(rename/RenameAuxFuns,lhs,)
904 compile_rec(rename/RenameBinds4,lhs,)
905 compile_rec(rename/RenameExpr4,lhs,)
906 compile(rename/RenameMonad12,lhs,)
907 compile(rename/RenameMonad3,lhs,)
908 compile(rename/RenameMonad4,lhs,)
909
910 compile(simplCore/BinderInfo,lhs,)
911 compile(simplCore/ConFold,lhs,)
912 compile(simplCore/FloatIn,lhs,)
913 compile(simplCore/FloatOut,lhs,)
914 compile(simplCore/LiberateCase,lhs,)
915 compile(simplCore/MagicUFs,lhs,)
916 compile(simplCore/OccurAnal,lhs,)
917
918 compile(simplCore/NewOccurAnal,lhs,)
919 compile(simplCore/AnalFBWW,lhs,)
920 compile(simplCore/FoldrBuildWW,lhs,)
921 /* ANDY: compile(simplCore/SimplHaskell,lhs,) */
922
923 compile(simplCore/SAT,lhs,)
924 compile(simplCore/SATMonad,lhs,)
925 compile(simplCore/SetLevels,lhs,)
926 compile_rec(simplCore/SimplCase,lhs,-H20m)
927 compile(simplCore/SimplCore,lhs,)
928 compile_rec(simplCore/SimplEnv,lhs,)
929 compile(simplCore/SimplMonad,lhs,)
930 compile(simplCore/SimplPgm,lhs,)
931 compile(simplCore/SimplUtils,lhs,)
932 compile_rec(simplCore/SimplVar,lhs,)
933 compile(simplCore/Simplify,lhs,)
934
935 compile(simplStg/SatStgRhs,lhs,)
936 compile(simplStg/LambdaLift,lhs,)
937 compile(simplStg/StgVarInfo,lhs,)
938 compile(simplStg/UpdAnal,lhs,)
939 compile(simplStg/StgStats,lhs,)
940 compile(simplStg/StgSATMonad,lhs,)
941 compile(simplStg/StgSAT,lhs,)
942 compile(simplStg/SimplStg,lhs,)
943
944 #if GhcWithDeforester == YES
945 compile(deforest/Core2Def,lhs,)
946 compile(deforest/Cyclic,lhs,)
947 compile_rec(deforest/Def2Core,lhs,)
948 compile(deforest/DefExpr,lhs,-H20m)
949 compile(deforest/DefSyn,lhs,)
950 compile(deforest/DefUtils,lhs,-H16m)
951 compile(deforest/Deforest,lhs,)
952 compile(deforest/TreelessForm,lhs,)
953 #endif
954
955 compile(specialise/Specialise,lhs,-H32m) /* sigh */
956 compile(specialise/SpecTyFuns,lhs,)
957
958 compile(stgSyn/CoreToStg,lhs,)
959 compile(stgSyn/StgFuns,lhs,)
960 compile(stgSyn/StgLint,lhs,)
961 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances) -H16m)
962
963 compile(stranal/SaAbsInt,lhs,)
964 compile(stranal/SaLib,lhs,)
965 compile(stranal/StrictAnal,lhs,)
966 compile(stranal/WorkWrap,lhs,)
967 compile(stranal/WwLib,lhs,)
968
969 compile(typecheck/BackSubst,lhs,)
970 compile_rec(typecheck/Disambig,lhs,)
971 compile(typecheck/GenSpecEtc,lhs,)
972 compile(typecheck/Spec,lhs,)
973 compile(typecheck/Subst,lhs,if_ghc(-fvia-C) if_ghc26(-monly-4-regs))
974 compile(typecheck/TcBinds,lhs,)
975 compile(typecheck/TcClassDcl,lhs,-H14m)
976 compile(typecheck/TcClassSig,lhs,)
977 compile(typecheck/TcConDecls,lhs,)
978 compile(typecheck/TcContext,lhs,)
979 compile(typecheck/TcDefaults,lhs,)
980 compile_rec(typecheck/TcDeriv,lhs,-H20m)
981 compile_rec(typecheck/TcExpr,lhs,-H20m)
982 compile_rec(typecheck/TcGRHSs,lhs,)
983 compile(typecheck/TcGenDeriv,lhs,-H20m)
984 compile(typecheck/TcIfaceSig,lhs,)
985 compile(typecheck/TcInstDcls,lhs,-H20m)
986 compile(typecheck/TcMatches,lhs,)
987 compile(typecheck/TcModule,lhs,)
988 compile_rec(typecheck/TcMonad,lhs,)
989 compile(typecheck/TcMonadFns,lhs,)
990 compile(typecheck/TcMonoBnds,lhs,)
991 compile(typecheck/TcMonoType,lhs,)
992 compile(typecheck/TcPat,lhs,-H14m)
993 compile_rec(typecheck/TcPolyType,lhs,)
994 compile(typecheck/TcPragmas,lhs,-H20m)
995 compile(typecheck/TcQuals,lhs,)
996 compile(typecheck/TcSimplify,lhs,)
997 compile(typecheck/TcTyDecls,lhs,)
998 compile(typecheck/Typecheck,lhs,)
999 compile(typecheck/Unify,lhs,)
1000
1001 compile_rec(uniType/AbsUniType,lhs,if_ghc(-fno-omit-reexported-instances))
1002 compile_rec(uniType/Class,lhs,)
1003 compile_rec(uniType/TyCon,lhs,)
1004 compile_rec(uniType/TyVar,lhs,)
1005 compile(uniType/UniTyFuns,lhs,-H20m)
1006 compile_rec(uniType/UniType,lhs,)
1007
1008 compile(utils/Bag,lhs,)
1009 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
1010 compile(utils/Digraph,lhs,)
1011 compile(utils/FiniteMap,lhs,-H20m)
1012 compile(utils/LiftMonad,lhs,)
1013 compile(utils/ListSetOps,lhs,)
1014 compile(utils/Maybes,lhs,)
1015 compile_rec(utils/Outputable,lhs,)
1016 compile_rec(utils/Pretty,lhs,)
1017 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
1018 compile_rec(utils/UniqFM,lhs,)
1019 compile(utils/UniqSet,lhs,)
1020 compile(utils/Unpretty,lhs,)
1021 compile_rec(utils/Util,lhs,)
1022
1023 /* Some of these sizes have been boosted a little to fit the alpha */
1024 #if BuildGHCI == YES
1025 compile(nhcParser/Attr,lhs,)
1026 compile(nhcParser/AttrLib,lhs,if_ghc(-fhaskell-1.3))
1027 compile(nhcParser/Either,lhs,if_ghc(-fhaskell-1.3))
1028 compile(nhcParser/Extra,lhs,if_ghc(-fhaskell-1.3))
1029 compile(nhcParser/Fixity,lhs,if_ghc(-fhaskell-1.3))
1030 compile(nhcParser/Flags,lhs,if_ghc(-fhaskell-1.3))
1031 compile(nhcParser/HS,lhs,if_ghc(-fhaskell-1.3))
1032 compile(nhcParser/HbcOnly,lhs,if_ghc(-fhaskell-1.3))
1033 compile(nhcParser/Import,lhs,)
1034 compile(nhcParser/Lex,lhs,)
1035 compile(nhcParser/LexLow,lhs,)
1036 compile(nhcParser/LexPre,lhs,)
1037 compile(nhcParser/LexStr,lhs,)
1038 compile(nhcParser/Lexical,lhs,if_ghc(-fhaskell-1.3))
1039 compile(nhcParser/ListUtil,lhs,)
1040 compile(nhcParser/MergeSort,lhs,)
1041 compile(nhcParser/MkSyntax,lhs,if_ghc(-fhaskell-1.3))
1042 compile(nhcParser/NHCName,lhs,)
1043 compile(nhcParser/NHCPackedString,lhs,)
1044 compile(nhcParser/NameLib,lhs,if_ghc(-fhaskell-1.3))
1045 compile(nhcParser/NameLow,lhs,if_ghc(-fhaskell-1.3))
1046 compile(nhcParser/OsOnly,lhs,)
1047 compile(nhcParser/PPLib,lhs,)
1048 compile(nhcParser/PPSyntax,lhs,)
1049 compile(nhcParser/Parse,lhs,-H30m if_ghc(-fhaskell-1.3))
1050 compile(nhcParser/ParseCore,lhs,if_ghc(-fhaskell-1.3))
1051 compile(nhcParser/ParseI,lhs,if_ghc(-fhaskell-1.3))
1052 compile(nhcParser/ParseLex,lhs,if_ghc(-fhaskell-1.3))
1053 compile(nhcParser/ParseLib,lhs,if_ghc(-fhaskell-1.3))
1054 compile(nhcParser/ScopeLib,lhs,)
1055 compile(nhcParser/StrName,lhs,)
1056 compile(nhcParser/StrSyntax,lhs,)
1057 compile(nhcParser/Syntax,lhs,)
1058 compile(nhcParser/SyntaxPos,lhs,)
1059 compile(nhcParser/Tree234,lhs,)
1060
1061 compile(interpreter/ToPrefix,lhs,if_ghc(-fhaskell-1.3))
1062 compile(interpreter/UnsafeCoerce,lhs,if_ghc(-nohi)) /* NB: no interface file, please! */
1063 compile(interpreter/Dynamic,lhs,)
1064 compile(interpreter/Interpreter,lhs,if_ghc(-fvia-C -fhaskell-1.3))
1065 compile(interpreter/MkInterface,lhs,)
1066 compile(interpreter/GHCIMonad,lhs,if_ghc(-fvia-C -fhaskell-1.3))
1067 compile(interpreter/FullEnv,lhs,if_ghc(-fhaskell-1.3))
1068 compile(interpreter/Command,lhs,)
1069 compile(interpreter/GHCIFlags,lhs,)
1070 compile(interpreter/GHCInterface,lhs,-H40m if_ghc(-fhaskell-1.3))
1071 compile(interpreter/GHCI,lhs,if_ghc(-fhaskell-1.3))
1072 compile(interpreter/GHCICore,lhs,if_ghc(-fhaskell-1.3))
1073
1074 # Just using standard macro doesn't use the #include then compiling the
1075 # .hc file.
1076
1077 HaskellCompileWithExtraFlags(interpreter/Dld,lhs,hc,-fvia-C -C -fhaskell-1.3,)
1078 HaskellCompileWithExtraFlags_Recursive(interpreter/Dld,hc,o,-c,'-#include"$(DLD_INCLUDE)"')
1079
1080 # (There's gotta be a cleaner way of doing this but only one person in
1081 #  the entire world understands Jmakefiles well enough to use them
1082 #  effectively.)
1083
1084 # some c-as-asm level hacks
1085 # also needs a hand-hacked interface file
1086 interpreter/DldHacks.o: interpreter/DldHacks.lhc
1087         $(RM) interpreter/DldHacks.hc interpreter/DldHacks.o
1088         lit2pgm interpreter/DldHacks.lhc
1089         $(GHC) -c $(GHC_FLAGS) interpreter/DldHacks.hc
1090
1091 interpreter/DldC.o:     interpreter/DldC.lc
1092         $(RM) interpreter/DldC.c interpreter/DldC.o
1093         lit2pgm interpreter/DldC.lc
1094         $(GHC) -c $(GHC_FLAGS) interpreter/DldC.c -I$(DLD_DIR) -optcO-DNON_POSIX_SOURCE
1095
1096 /* Does not work for a subdir ... (Sigh) 
1097 NormalLibraryTarget($(DLD_DIR)/libdld,$(DLD_OBJS_O))
1098 */
1099 all :: dld/libdld.a
1100 clean ::
1101         $(RM) dld/libdld.a
1102 dld/libdld.a :: $(DLD_OBJS_O)
1103         $(RM) $@
1104         $(AR) $@ $(DLD_OBJS_O)
1105         $(RANLIB) $@
1106
1107 # To improve loading speed, we generate some C programs which contain
1108 # references to all symbols in the libraries we link with.
1109
1110 # ToDo: remove the appel dependency.
1111
1112 MY_TOP = ..
1113 MY_LIB = $(MY_TOP)/lib
1114 MY_RTS = $(MY_TOP)/runtime
1115
1116 interpreter/prelude.o: $(MY_LIB)/libHS.a makeSymbolList.prl
1117         $(RM) interpreter/prelude.c interpreter/prelude.o
1118         nm -p $(MY_LIB)/libHS.a | perl makeSymbolList.prl > interpreter/prelude.c
1119         $(GHC) -c $(GHC_FLAGS) interpreter/prelude.c
1120
1121 interpreter/runtime.o: $(MY_RTS)/libHSrts.a $(MY_RTS)/libHSclib.a makeSymbolList.prl
1122         $(RM) interpreter/runtime.c interpreter/runtime.o
1123         nm -p $(MY_RTS)/libHSrts.a $(MY_RTS)/libHSclib.a | perl makeSymbolList.prl > interpreter/runtime.c
1124         $(GHC) -c $(GHC_FLAGS) interpreter/runtime.c
1125
1126 #endif /* GHCI */
1127
1128 /* for convenience in cross-compiling */
1129 objs:: $(ALLOBJS)
1130
1131 /* *** parser ************************************************* */
1132
1133 YACC_OPTS = -d
1134 CC_OPTS = -IyaccParser -I. -I$(COMPINFO_DIR)
1135
1136 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
1137
1138 #if BuildDataParallelHaskell == YES
1139 D_DPH = -DDPH
1140 #endif
1141
1142 XCOMM D_DEBUG = -DDEBUG
1143
1144 CPP_DEFINES = $(D_DEBUG) $(D_DPH)
1145
1146 HSP_SRCS_C = /* yaccParser/main.c */            \
1147                 yaccParser/atype.c              \
1148                 yaccParser/binding.c            \
1149                 yaccParser/coresyn.c            \
1150                 yaccParser/entidt.c             \
1151                 yaccParser/finfot.c             \
1152                 yaccParser/hpragma.c            \
1153                 yaccParser/hslexer.c            \
1154                 yaccParser/hsparser.tab.c       \
1155                 yaccParser/id.c                 \
1156                 yaccParser/import_dirlist.c     \
1157                 yaccParser/infix.c              \
1158                 yaccParser/list.c               \
1159                 yaccParser/literal.c            \
1160                 yaccParser/pbinding.c           \
1161                 /* yaccParser/printtree.c */    \
1162                 yaccParser/syntax.c             \
1163                 yaccParser/tree.c               \
1164                 yaccParser/ttype.c              \
1165                 yaccParser/type2context.c       \
1166                 yaccParser/util.c
1167
1168 HSP_OBJS_O = /* yaccParser/main.o */            \
1169                 yaccParser/atype.o              \
1170                 yaccParser/binding.o            \
1171                 yaccParser/coresyn.o            \
1172                 yaccParser/entidt.o             \
1173                 yaccParser/finfot.o             \
1174                 yaccParser/hpragma.o            \
1175                 yaccParser/hslexer.o            \
1176                 yaccParser/hsparser.tab.o       \
1177                 yaccParser/id.o                 \
1178                 yaccParser/import_dirlist.o     \
1179                 yaccParser/infix.o              \
1180                 yaccParser/list.o               \
1181                 yaccParser/literal.o            \
1182                 yaccParser/pbinding.o           \
1183                 /* yaccParser/printtree.o */    \
1184                 yaccParser/syntax.o             \
1185                 yaccParser/tree.o               \
1186                 yaccParser/ttype.o              \
1187                 yaccParser/type2context.o       \
1188                 yaccParser/util.o
1189
1190 /* DPH uses some tweaked files; here are the lists again... */
1191
1192 #if BuildDataParallelHaskell == YES
1193 DPH_HSP_SRCS_C = yaccParser/atype.c             \
1194                 yaccParser/binding.c            \
1195                 yaccParser/coresyn.c            \
1196                 yaccParser/entidt.c             \
1197                 yaccParser/finfot.c             \
1198                 yaccParser/hpragma.c            \
1199                 yaccParser/hslexer-DPH.c        \
1200                 yaccParser/hsparser-DPH.tab.c   \
1201                 yaccParser/id.c                 \
1202                 yaccParser/import_dirlist.c     \
1203                 yaccParser/infix.c              \
1204                 yaccParser/list.c               \
1205                 yaccParser/literal.c            \
1206                 yaccParser/main.c               \
1207                 yaccParser/pbinding.c           \
1208                 yaccParser/printtree.c          \
1209                 yaccParser/syntax.c             \
1210                 yaccParser/tree-DPH.c           \
1211                 yaccParser/ttype-DPH.c          \
1212                 yaccParser/type2context.c       \
1213                 yaccParser/util.c
1214
1215 DPH_HSP_OBJS_O = yaccParser/atype.o             \
1216                 yaccParser/binding.o            \
1217                 yaccParser/coresyn.o            \
1218                 yaccParser/entidt.o             \
1219                 yaccParser/finfot.o             \
1220                 yaccParser/hpragma.o            \
1221                 yaccParser/hslexer-DPH.o        \
1222                 yaccParser/hsparser-DPH.tab.o   \
1223                 yaccParser/id.o                 \
1224                 yaccParser/import_dirlist.o     \
1225                 yaccParser/infix.o              \
1226                 yaccParser/list.o               \
1227                 yaccParser/literal.o            \
1228                 yaccParser/main.o               \
1229                 yaccParser/pbinding.o           \
1230                 yaccParser/printtree.o          \
1231                 yaccParser/syntax.o             \
1232                 yaccParser/tree-DPH.o           \
1233                 yaccParser/ttype-DPH.o          \
1234                 yaccParser/type2context.o       \
1235                 yaccParser/util.o
1236 #endif
1237
1238 /* this is for etags */
1239 REAL_HSP_SRCS_C = yaccParser/main.c             \
1240                 yaccParser/hschooks.c           \
1241                 yaccParser/hsclink.c            \
1242                 yaccParser/id.c                 \
1243                 yaccParser/util.c               \
1244                 yaccParser/syntax.c             \
1245                 yaccParser/type2context.c       \
1246                 yaccParser/import_dirlist.c     \
1247                 yaccParser/infix.c              \
1248                 yaccParser/printtree.c 
1249
1250 UgenNeededHere(all depend)
1251
1252 /* Most hsp files are in libhsp.a, so we can either make
1253    a standalone parser, or incorporate the files into
1254    the hsc compiler directly (WDP 94/10)
1255 */
1256 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
1257
1258 /* We need the hsp program for hstags to work! */
1259 BuildPgmFromCFiles(hsp,yaccParser/printtree.o yaccParser/main.o,,libhsp.a)
1260 #if BuildDataParallelHaskell == YES
1261 BuildPgmFromCFiles(dphsp,$(DPH_HSP_OBJS_O),,)
1262 #endif
1263
1264 #if DoInstallGHCSystem == YES
1265 MakeDirectories(install, $(INSTLIBDIR_GHC))
1266 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
1267 # if BuildDataParallelHaskell == YES
1268 InstallBinaryTarget(dphsp,$(INSTLIBDIR_GHC))
1269 # endif
1270 #endif /* DoInstall... */
1271
1272 YaccRunWithExpectMsg(yaccParser/hsparser,12,2)
1273
1274 UgenTarget(yaccParser/atype)
1275 UgenTarget(yaccParser/binding)
1276 UgenTarget(yaccParser/coresyn)
1277 UgenTarget(yaccParser/entidt)
1278 UgenTarget(yaccParser/finfot)
1279 UgenTarget(yaccParser/literal)
1280 UgenTarget(yaccParser/list)
1281 UgenTarget(yaccParser/pbinding)
1282 UgenTarget(yaccParser/hpragma)
1283 UgenTarget(yaccParser/tree)
1284 UgenTarget(yaccParser/ttype)
1285
1286 #if BuildDataParallelHaskell == YES
1287 YaccRunWithExpectMsg(yaccParser/hsparser-DPH,12,4)
1288 UgenTarget(yaccParser/tree-DPH)
1289 UgenTarget(yaccParser/ttype-DPH)
1290 #endif
1291
1292 UGENS_C = yaccParser/atype.c    \
1293         yaccParser/binding.c    \
1294         yaccParser/coresyn.c    \
1295         yaccParser/entidt.c     \
1296         yaccParser/finfot.c     \
1297         yaccParser/literal.c    \
1298         yaccParser/list.c       \
1299         yaccParser/pbinding.c   \
1300         yaccParser/hpragma.c    \
1301         yaccParser/tree.c       \
1302         yaccParser/ttype.c
1303
1304 compile(yaccParser/UgenAll,lhs,if_ghc(-fvia-C))
1305 compile(yaccParser/UgenUtil,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1306 compile(yaccParser/U_atype,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1307 compile(yaccParser/U_binding,hs,-H20m if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1308 compile(yaccParser/U_coresyn,hs,-H20m if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1309 compile(yaccParser/U_entidt,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1310 compile(yaccParser/U_finfot,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1311 compile(yaccParser/U_hpragma,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1312 compile(yaccParser/U_list,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1313 compile(yaccParser/U_literal,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1314 compile(yaccParser/U_pbinding,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1315 compile(yaccParser/U_tree,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1316 compile(yaccParser/U_treeHACK,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1317 compile(yaccParser/U_ttype,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
1318
1319 /* finished with local macros */
1320 #undef compile
1321 #undef compile_rec
1322 #undef if_ghc
1323
1324 /* *** misc *************************************************** */
1325
1326 /* ?????????? ToDo: need parser depend/clean/etc in here ????? */
1327
1328 /* omit for now:
1329 LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
1330 */
1331 /* LitDependTarget(root,lit): built-in to the above */
1332
1333 /* mkdependHS has to have the -i.../-I... subdirectory lists even if "ghc" does not
1334 */
1335 #if GhcWithHscBuiltViaC == NO
1336 DEPSRCS        = $(ALLSRCS_LHS) $(ALLSRCS_HS)
1337 MKDEPENDHS_OPTS= $(DASH_I_SUBDIR_LIST) -i$(SUBDIR_LIST) -I$(MAIN_INCLUDE_DIR) 
1338
1339 #else /* booting from .hc (no ghci) */
1340 DEPSRCS        = $(HSCSRCS_LHS) $(HSCSRCS_HS)
1341 MKDEPENDHS_OPTS= -o .hc $(DASH_I_SUBDIR_LIST) -i$(SUBDIR_LIST) -I$(MAIN_INCLUDE_DIR) 
1342 #endif /* booting from .hc files */
1343
1344 #if HaskellCompilerType != HC_USE_HC_FILES
1345     /* otherwise, the dependencies jeopardize our .hc files --
1346         which are all we have! */
1347 HaskellDependTarget( $(DEPSRCS) )
1348 #endif
1349
1350 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
1351 #if GhcWithHscBuiltViaC == YES
1352 ExtraStuffToClean( $(ALLHCS) )
1353 #endif
1354 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
1355
1356 ClearTagsFile()
1357 HsTagsTarget( $(ALLSRCS_LHS) )
1358 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
1359
1360 /* count the number of lines in the source files */
1361 count_lines ::
1362         ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
1363
1364 /* accumulate similar info about the sizes of object files */
1365 count_bytes ::
1366         ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)