3 /* (only subdir is the test suite) */
5 #if IncludeTestDirsInBuild == YES
8 # define __ghc_compiler_tests_dir tests
10 # define __ghc_compiler_tests_dir /* nothing */
12 SUBDIRS = __ghc_compiler_tests_dir
13 #undef __ghc_compiler_tests_dir
15 #define NoAllTargetForSubdirs
16 #define NoDocsTargetForSubdirs
17 #define NoInstallDocsTargetForSubdirs
18 #define NoDependTargetForSubdirs
19 #define NoInstallTargetForSubdirs
20 #define NoTagTargetForSubdirs
22 /* Suffix rules: we do not use them much at all in GHC.
23 We need some magic stuff (from suffixes-GEN.ljm) for
28 LitSuffixRule(.lprl,.prl) /* for makeSymbolList.prl */
30 /* assume ALL source is in subdirectories one level below
31 they don't have Jmakefiles; this Jmakefile controls everything
34 SUBDIR_LIST = \ /* here they are, colon separated (for mkdependHS) */
35 utils:basicTypes:types:hsSyn:prelude:envs:rename:typecheck:deSugar:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen:nativeGen:absCSyn:main:reader:profiling:deforest:parser
38 MAIN_INCLUDE_DIR=MainIncludeDir
40 MAIN_INCLUDE_DIR=$(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
43 /* helps to find GhcConstants.h in codeGen/CgCompInfo.lhs */
45 COMPINFO_DIR=CompInfoDir
47 COMPINFO_DIR=$(TOP_PWD)/$(CURRENT_DIR)/codeGen
49 /* nativeGen, elsewhere */
51 NATIVEGEN_DIR=NativeGenDir
53 NATIVEGEN_DIR=$(TOP_PWD)/$(CURRENT_DIR)/nativeGen
56 /* in order-of-passes order, utility modules at the end */
58 #define READERSRCS_HS \
61 parser/U_pbinding.hs \
71 #define hsp_library libhsp.a
73 #define READERSRCS_LHS \
76 reader/ReadPrefix.lhs \
78 reader/PrefixSyn.lhs \
79 reader/PrefixToHs.lhs \
82 hsSyn/HsBinds.lhs /* abstract Haskell syntax */ \
94 #define NOT_SO_BASICSRCS_LHS \
95 basicTypes/FieldLabel.lhs \
97 basicTypes/IdInfo.lhs \
98 basicTypes/IdUtils.lhs \
99 basicTypes/Literal.lhs \
100 basicTypes/Name.lhs \
101 basicTypes/PprEnv.lhs \
102 basicTypes/PragmaInfo.lhs \
103 basicTypes/SrcLoc.lhs \
104 basicTypes/UniqSupply.lhs \
105 basicTypes/Unique.lhs \
115 specialise/SpecEnv.lhs
118 #define RENAMERSRCS_LHS \
123 rename/RnSource.lhs \
126 rename/RnIfaces.lhs \
130 typecheck/TcHsSyn.lhs \
131 typecheck/GenSpecEtc.lhs \
133 typecheck/TcBinds.lhs \
134 typecheck/TcClassDcl.lhs \
135 typecheck/TcDefaults.lhs \
136 typecheck/TcDeriv.lhs \
137 typecheck/TcExpr.lhs \
138 typecheck/TcGenDeriv.lhs \
139 typecheck/TcGRHSs.lhs \
140 typecheck/TcIfaceSig.lhs \
141 typecheck/TcInstDcls.lhs \
142 typecheck/TcInstUtil.lhs \
143 typecheck/TcMatches.lhs \
144 typecheck/TcModule.lhs \
145 typecheck/TcMonad.lhs \
146 typecheck/TcEnv.lhs \
147 typecheck/TcKind.lhs \
148 typecheck/TcType.lhs \
149 typecheck/TcMonoType.lhs \
150 typecheck/TcPat.lhs \
151 typecheck/TcSimplify.lhs \
152 typecheck/TcTyClsDecls.lhs \
153 typecheck/TcTyDecls.lhs \
154 typecheck/Typecheck.lhs \
158 typecheck/TcPragmas.lhs \
162 deSugar/Desugar.lhs \
164 deSugar/MatchCon.lhs \
165 deSugar/MatchLit.lhs \
166 deSugar/DsBinds.lhs \
167 deSugar/DsCCall.lhs \
169 deSugar/DsGRHSs.lhs \
170 deSugar/DsHsSyn.lhs \
171 deSugar/DsListComp.lhs \
172 deSugar/DsMonad.lhs \
173 deSugar/DsUtils.lhs \
175 coreSyn/CoreLift.lhs \
178 #if GhcWithDeforester != YES
179 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
180 #define DEFORESTER_SRCS_LHS /*none*/
182 #define __omit_deforester_flag /*nope*/
183 #define DEFORESTER_SRCS_LHS \
184 deforest/DefSyn.lhs \
185 deforest/Core2Def.lhs \
186 deforest/Def2Core.lhs \
187 deforest/Deforest.lhs \
188 deforest/DefUtils.lhs \
189 deforest/DefExpr.lhs \
190 deforest/Cyclic.lhs \
191 deforest/TreelessForm.lhs
192 #endif /* GhcWithDeforester */
194 #define SIMPL_SRCS_LHS \
195 coreSyn/AnnCoreSyn.lhs \
196 coreSyn/FreeVars.lhs \
198 specialise/Specialise.lhs \
199 specialise/SpecUtils.lhs \
201 simplCore/SimplCase.lhs \
202 simplCore/SimplEnv.lhs \
203 simplCore/SimplMonad.lhs \
204 simplCore/SimplPgm.lhs \
205 simplCore/SimplUtils.lhs \
206 simplCore/SimplVar.lhs \
207 simplCore/Simplify.lhs \
209 simplCore/LiberateCase.lhs \
211 simplCore/ConFold.lhs \
212 simplCore/FloatIn.lhs \
213 simplCore/FloatOut.lhs \
215 simplCore/SATMonad.lhs \
216 simplCore/SetLevels.lhs \
217 simplCore/SimplCore.lhs \
218 simplCore/OccurAnal.lhs \
219 simplCore/FoldrBuildWW.lhs \
220 simplCore/AnalFBWW.lhs \
222 stranal/StrictAnal.lhs \
224 stranal/SaAbsInt.lhs \
226 stranal/WorkWrap.lhs \
228 profiling/SCCauto.lhs DEFORESTER_SRCS_LHS
230 #define STG_SRCS_LHS \
231 stgSyn/CoreToStg.lhs \
233 stgSyn/StgUtils.lhs \
235 profiling/SCCfinal.lhs \
237 simplStg/SatStgRhs.lhs \
238 simplStg/LambdaLift.lhs \
239 simplStg/StgVarInfo.lhs \
240 simplStg/UpdAnal.lhs \
241 simplStg/StgStats.lhs \
242 simplStg/StgSATMonad.lhs \
243 simplStg/StgSAT.lhs \
244 simplStg/SimplStg.lhs
246 #define BACKSRCS_LHS \
247 absCSyn/AbsCUtils.lhs \
248 absCSyn/AbsCSyn.lhs \
251 absCSyn/HeapOffs.lhs \
252 absCSyn/PprAbsC.lhs \
254 codeGen/CodeGen.lhs \
255 codeGen/ClosureInfo.lhs \
257 codeGen/CgConTbls.lhs \
258 codeGen/CgMonad.lhs \
259 codeGen/CgUsages.lhs \
260 codeGen/CgHeapery.lhs \
261 codeGen/CgStackery.lhs \
264 codeGen/CgLetNoEscape.lhs \
265 codeGen/CgTailCall.lhs \
266 codeGen/CgClosure.lhs \
268 codeGen/CgRetConv.lhs \
269 codeGen/CgBindery.lhs \
272 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
273 /* if building via C, we *assume* that it is the
274 distributed C files, which do not have a native-code
277 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
278 # define NATIVEGEN_SRCS_LHS /*none*/
280 # define __omit_ncg_maybe /*none*/
282 # define NATIVEGEN_SRCS_LHS \
283 nativeGen/AbsCStixGen.lhs \
284 nativeGen/AsmCodeGen.lhs \
285 nativeGen/AsmRegAlloc.lhs \
286 nativeGen/MachCode.lhs \
287 nativeGen/MachMisc.lhs \
288 nativeGen/MachRegs.lhs \
289 nativeGen/PprMach.lhs \
290 nativeGen/RegAllocInfo.lhs \
292 nativeGen/StixInfo.lhs \
293 nativeGen/StixInteger.lhs \
294 nativeGen/StixPrim.lhs \
295 nativeGen/StixMacro.lhs
298 #define UTILSRCS_LHS \
304 utils/FiniteMap.lhs \
305 utils/ListSetOps.lhs \
309 utils/Outputable.lhs \
318 #define MAIN_SRCS_LHS \
320 main/CmdLineOpts.lhs \
328 #define VBASICSRCS_LHS \
329 prelude/PrelMods.lhs \
330 prelude/PrimRep.lhs \
332 prelude/TysPrim.lhs \
333 prelude/TysWiredIn.lhs \
334 prelude/PrelVals.lhs \
335 prelude/PrelInfo.lhs \
337 absCSyn/CStrings.lhs \
338 codeGen/CgCompInfo.lhs \
339 coreSyn/CoreSyn.lhs \
340 coreSyn/CoreUnfold.lhs \
341 coreSyn/CoreUtils.lhs \
342 coreSyn/PprCore.lhs \
343 profiling/CostCentre.lhs \
344 simplCore/BinderInfo.lhs \
345 simplCore/MagicUFs.lhs
347 ALLSRCS_HS = READERSRCS_HS
348 ALLSRCS_LHS = /* all pieces of the compiler */ \
350 NOT_SO_BASICSRCS_LHS \
359 BACKSRCS_LHS NATIVEGEN_SRCS_LHS
364 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
365 need to be on the last line.
368 /* should't use these fancy `make' things, really */
369 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
370 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
371 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
373 .PRECIOUS: $(ALLINTS)
375 #if GhcWithHscDebug == YES
376 # define use_DDEBUG -DDEBUG
378 # define use_DDEBUG /*nothing*/
381 #if GhcWithHscOptimised == YES
382 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
384 #define __version_sensitive_flags -fomit-reexported-instances
387 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
388 #undef AllProjectsHcOpts
389 #define AllProjectsHcOpts /**/
391 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
392 -fomit-derived-read \
393 -I. -i$(SUBDIR_LIST) \
394 use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
396 #undef __version_sensitive_flags
397 #undef __omit_ncg_maybe
398 #undef __omit_deforester_flag
400 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
404 # if HaskellCompilerType == HC_USE_HC_FILES
405 HC = $(GHC) /* uses the driver herein */
408 #endif /* using .hc files */
412 Used when compiling GHC. Some GHC utility modules are
413 *also* part of the GHC library. There are a few bits
414 of those modules that only apply to GHC itself and
415 should not be in the library stuff. We use this
416 CPP thing to isolate those bits.
419 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
421 #if DoInstallGHCSystem == YES
422 MakeDirectories(install, $(INSTLIBDIR_GHC))
423 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
426 /* set up for going either to .hc or to .o files */
427 #if GhcWithHscBuiltViaC == YES
429 /*OLD:SuffixRule_hc_o() */
431 # if HaskellCompilerType == HC_USE_HC_FILES
432 /* if we do not, we never try to compile .lhs files;
433 we *blast* the macro we would normally use (HACK) (WDP 94/12)
436 # undef HaskellCompileWithSpecifiedFlags
437 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
438 module.osuf : module.isuf \
439 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
441 # define compile(module,isuf,extra_flags) \
442 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
444 # define compile_rec(module,isuf,extra_flags) \
445 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
449 # define compile(module,isuf,extra_flags) \
450 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
452 # define compile_rec(module,isuf,extra_flags) \
453 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
455 # endif /* ... == HC_USE_HC_FILES */
457 #else /* ! booting from C */
459 # define compile(module,isuf,extra_flags) \
460 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
462 # define compile_rec(module,isuf,extra_flags) \
463 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
465 #endif /* ! booting from C */
468 #if GhcBuilderVersion >= 26
469 # define if_ghc26(x) x
471 # define if_ghc26(x) /*nothing*/
474 /* OK, here we go: */
476 utils/Ubiq.hi : utils/Ubiq.lhi
477 $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
479 absCSyn/AbsCLoop.hi : absCSyn/AbsCLoop.lhi
480 $(GHC_UNLIT) absCSyn/AbsCLoop.lhi absCSyn/AbsCLoop.hi
481 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
482 $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
483 codeGen/CgLoop1.hi : codeGen/CgLoop1.lhi
484 $(GHC_UNLIT) codeGen/CgLoop1.lhi codeGen/CgLoop1.hi
485 codeGen/CgLoop2.hi : codeGen/CgLoop2.lhi
486 $(GHC_UNLIT) codeGen/CgLoop2.lhi codeGen/CgLoop2.hi
487 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
488 $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
489 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
490 $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
491 nativeGen/NcgLoop.hi : nativeGen/NcgLoop.lhi
492 $(GHC_UNLIT) nativeGen/NcgLoop.lhi nativeGen/NcgLoop.hi
493 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
494 $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
495 rename/RnLoop.hi : rename/RnLoop.lhi
496 $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
497 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
498 $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
499 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
500 $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
501 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
502 $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
503 types/TyLoop.hi : types/TyLoop.lhi
504 $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
506 compile(absCSyn/AbsCUtils,lhs,)
507 compile(absCSyn/CStrings,lhs,)
508 compile(absCSyn/CLabel,lhs,)
509 compile(absCSyn/Costs,lhs,)
510 compile(absCSyn/HeapOffs,lhs,)
511 compile(absCSyn/PprAbsC,lhs,)
512 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
514 compile(hsSyn/HsBinds,lhs,)
515 compile(hsSyn/HsCore,lhs,)
516 compile(hsSyn/HsDecls,lhs,)
517 compile(hsSyn/HsExpr,lhs,)
518 compile(hsSyn/HsImpExp,lhs,)
519 compile(hsSyn/HsLit,lhs,)
520 compile(hsSyn/HsMatches,lhs,)
521 compile(hsSyn/HsPat,lhs,)
522 compile(hsSyn/HsPragmas,lhs,)
523 compile(hsSyn/HsTypes,lhs,)
524 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
526 compile(basicTypes/FieldLabel,lhs,)
527 compile(basicTypes/Id,lhs,)
528 compile(basicTypes/IdInfo,lhs,-K2m)
529 compile(basicTypes/IdUtils,lhs,)
530 compile(basicTypes/Literal,lhs,)
531 compile(basicTypes/Name,lhs,)
532 compile(basicTypes/PprEnv,lhs,)
533 compile(basicTypes/PragmaInfo,lhs,)
534 compile(basicTypes/SrcLoc,lhs,)
535 compile(basicTypes/UniqSupply,lhs,)
536 compile(basicTypes/Unique,lhs,)
538 compile(codeGen/CgBindery,lhs,)
539 compile(codeGen/CgCase,lhs,)
540 compile(codeGen/CgClosure,lhs,)
541 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
542 compile(codeGen/CgCon,lhs,)
543 compile(codeGen/CgConTbls,lhs,)
544 compile(codeGen/CgExpr,lhs,)
545 compile(codeGen/CgHeapery,lhs,)
546 compile(codeGen/CgLetNoEscape,lhs,)
547 compile(codeGen/CgMonad,lhs,)
548 compile(codeGen/CgRetConv,lhs,)
549 compile(codeGen/CgStackery,lhs,)
550 compile(codeGen/CgTailCall,lhs,)
551 compile(codeGen/CgUpdate,lhs,)
552 compile(codeGen/CgUsages,lhs,)
553 compile(codeGen/ClosureInfo,lhs,)
554 compile(codeGen/CodeGen,lhs,)
555 compile(codeGen/SMRep,lhs,)
557 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
558 compile(coreSyn/CoreUtils,lhs,)
559 compile(coreSyn/CoreLift,lhs,)
560 compile(coreSyn/CoreLint,lhs,)
561 compile(coreSyn/CoreSyn,lhs,)
562 compile(coreSyn/PprCore,lhs,)
563 compile(coreSyn/CoreUnfold,lhs,)
564 compile(coreSyn/FreeVars,lhs,)
566 compile(deSugar/Desugar,lhs,)
567 compile(deSugar/DsBinds,lhs,)
568 compile(deSugar/DsCCall,lhs,)
569 compile(deSugar/DsExpr,lhs,)
570 compile(deSugar/DsGRHSs,lhs,)
571 compile(deSugar/DsHsSyn,lhs,)
572 compile(deSugar/DsListComp,lhs,)
573 compile(deSugar/DsMonad,lhs,)
574 compile(deSugar/DsUtils,lhs,)
575 compile(deSugar/Match,lhs,)
576 compile(deSugar/MatchCon,lhs,)
577 compile(deSugar/MatchLit,lhs,)
579 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
580 compile(main/ErrUtils,lhs,)
581 compile(main/Main,lhs,if_ghc(-fvia-C))
582 compile(main/MainMonad,lhs,)
583 compile(main/MkIface,lhs,)
585 #if GhcWithNativeCodeGen == YES
586 compile(nativeGen/AbsCStixGen,lhs,)
587 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
588 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
589 compile(nativeGen/MachCode,lhs,)
590 compile(nativeGen/MachMisc,lhs,)
591 compile(nativeGen/MachRegs,lhs,)
592 compile(nativeGen/PprMach,lhs,)
593 compile(nativeGen/RegAllocInfo,lhs,)
594 compile(nativeGen/Stix,lhs,)
595 compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
596 compile(nativeGen/StixInteger,lhs,)
597 compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
598 compile(nativeGen/StixPrim,lhs,)
601 compile(prelude/PrelInfo,lhs,)
602 compile(prelude/PrelMods,lhs,)
603 compile(prelude/PrelVals,lhs,)
604 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
605 compile(prelude/PrimOp,lhs,-K3m -H10m)
606 compile(prelude/TysPrim,lhs,)
607 compile(prelude/TysWiredIn,lhs,)
609 compile(profiling/SCCauto,lhs,)
610 compile(profiling/SCCfinal,lhs,)
611 compile(profiling/CostCentre,lhs,)
613 compile(reader/PrefixSyn,lhs,)
614 compile(reader/PrefixToHs,lhs,)
615 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
616 compile(reader/RdrHsSyn,lhs,)
618 compile(rename/RnHsSyn,lhs,)
619 compile(rename/RnMonad,lhs,)
620 compile(rename/Rename,lhs,)
621 compile(rename/RnNames,lhs,)
622 compile(rename/RnSource,lhs,)
623 compile(rename/RnBinds,lhs,)
624 compile(rename/RnExpr,lhs,)
625 compile(rename/RnIfaces,lhs,)
626 compile(rename/RnUtils,lhs,)
628 compile(simplCore/BinderInfo,lhs,)
629 compile(simplCore/ConFold,lhs,)
630 compile(simplCore/FloatIn,lhs,)
631 compile(simplCore/FloatOut,lhs,)
632 compile(simplCore/LiberateCase,lhs,)
633 compile(simplCore/MagicUFs,lhs,)
634 compile(simplCore/OccurAnal,lhs,)
636 compile(simplCore/AnalFBWW,lhs,)
637 compile(simplCore/FoldrBuildWW,lhs,)
639 compile(simplCore/SAT,lhs,)
640 compile(simplCore/SATMonad,lhs,)
641 compile(simplCore/SetLevels,lhs,)
642 compile(simplCore/SimplCase,lhs,)
643 compile(simplCore/SimplCore,lhs,)
644 compile(simplCore/SimplEnv,lhs,)
645 compile(simplCore/SimplMonad,lhs,)
646 compile(simplCore/SimplPgm,lhs,)
647 compile(simplCore/SimplUtils,lhs,)
648 compile(simplCore/SimplVar,lhs,)
649 compile(simplCore/Simplify,lhs,)
651 compile(simplStg/SatStgRhs,lhs,)
652 compile(simplStg/LambdaLift,lhs,)
653 compile(simplStg/StgVarInfo,lhs,)
654 compile(simplStg/UpdAnal,lhs,)
655 compile(simplStg/StgStats,lhs,)
656 compile(simplStg/StgSATMonad,lhs,)
657 compile(simplStg/StgSAT,lhs,)
658 compile(simplStg/SimplStg,lhs,)
660 #if GhcWithDeforester == YES
661 compile(deforest/Core2Def,lhs,)
662 compile(deforest/Cyclic,lhs,)
663 compile(deforest/Def2Core,lhs,)
664 compile(deforest/DefExpr,lhs,)
665 compile(deforest/DefSyn,lhs,)
666 compile(deforest/DefUtils,lhs,)
667 compile(deforest/Deforest,lhs,)
668 compile(deforest/TreelessForm,lhs,)
671 compile(specialise/Specialise,lhs,)
672 compile(specialise/SpecEnv,lhs,)
673 compile(specialise/SpecUtils,lhs,)
675 compile(stgSyn/CoreToStg,lhs,)
676 compile(stgSyn/StgUtils,lhs,)
677 compile(stgSyn/StgLint,lhs,)
678 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
680 compile(stranal/SaAbsInt,lhs,)
681 compile(stranal/SaLib,lhs,)
682 compile(stranal/StrictAnal,lhs,)
683 compile(stranal/WorkWrap,lhs,)
684 compile(stranal/WwLib,lhs,)
686 compile(typecheck/GenSpecEtc,lhs,)
687 compile(typecheck/Inst,lhs,)
688 compile(typecheck/TcHsSyn,lhs,)
689 compile(typecheck/TcBinds,lhs,)
690 compile(typecheck/TcClassDcl,lhs,)
691 compile(typecheck/TcDefaults,lhs,)
692 compile(typecheck/TcDeriv,lhs,)
693 compile(typecheck/TcExpr,lhs,)
694 compile(typecheck/TcGRHSs,lhs,)
695 compile(typecheck/TcGenDeriv,lhs,)
696 compile(typecheck/TcIfaceSig,lhs,)
697 compile(typecheck/TcInstDcls,lhs,)
698 compile(typecheck/TcInstUtil,lhs,)
699 compile(typecheck/TcMatches,lhs,)
700 compile(typecheck/TcModule,lhs,)
701 compile(typecheck/TcMonad,lhs,)
702 compile(typecheck/TcKind,lhs,)
703 compile(typecheck/TcType,lhs,)
704 compile(typecheck/TcEnv,lhs,)
705 compile(typecheck/TcMonoType,lhs,)
706 compile(typecheck/TcPat,lhs,)
707 compile(typecheck/TcPragmas,lhs,)
708 compile(typecheck/TcSimplify,lhs,)
709 compile(typecheck/TcTyClsDecls,lhs,)
710 compile(typecheck/TcTyDecls,lhs,)
711 compile(typecheck/Typecheck,lhs,)
712 compile(typecheck/Unify,lhs,)
714 compile(types/Class,lhs,)
715 compile(types/Kind,lhs,)
716 compile(types/PprType,lhs,)
717 compile(types/TyCon,lhs,)
718 compile(types/TyVar,lhs,)
719 compile(types/Usage,lhs,)
720 compile(types/Type,lhs,)
722 compile(utils/Argv,lhs,if_ghc(-fvia-C))
723 compile(utils/Bag,lhs,)
724 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
725 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
726 compile(utils/Digraph,lhs,)
727 compile(utils/FiniteMap,lhs,)
728 compile(utils/ListSetOps,lhs,)
729 compile(utils/Maybes,lhs,)
730 compile(utils/OrdList,lhs,)
731 compile(utils/Outputable,lhs,)
732 compile(utils/PprStyle,lhs,)
733 compile(utils/Pretty,lhs,)
734 compile(utils/SST,lhs,if_ghc(-fvia-C))
735 compile(utils/UniqFM,lhs,)
736 compile(utils/UniqSet,lhs,)
737 compile(utils/Unpretty,lhs,)
738 compile(utils/MatchEnv,lhs,)
739 compile(utils/Util,lhs,)
741 /* for convenience in cross-compiling */
744 /* *** parser ************************************************* */
747 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
749 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
751 XCOMM D_DEBUG = -DDEBUG
753 CPP_DEFINES = $(D_DEBUG)
755 HSP_SRCS_C = parser/constr.c \
760 parser/hsparser.tab.c \
762 parser/import_dirlist.c \
772 parser/type2context.c \
775 HSP_OBJS_O = parser/constr.o \
780 parser/hsparser.tab.o \
782 parser/import_dirlist.o \
792 parser/type2context.o \
795 /* this is for etags */
796 REAL_HSP_SRCS_C = parser/main.c \
802 parser/type2context.c \
803 parser/import_dirlist.c \
807 UgenNeededHere(all depend)
809 /* Most hsp files are in libhsp.a, so we can either make
810 a standalone parser, or incorporate the files into
811 the hsc compiler directly (WDP 94/10)
813 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
815 /* We need the hsp program for hstags to work! */
816 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
818 #if DoInstallGHCSystem == YES
819 MakeDirectories(install, $(INSTLIBDIR_GHC))
820 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
821 #endif /* DoInstall... */
823 YaccRunWithExpectMsg(parser/hsparser,14,0)
825 UgenTarget(parser/constr)
826 UgenTarget(parser/binding)
827 UgenTarget(parser/pbinding)
828 UgenTarget(parser/entidt)
829 UgenTarget(parser/list)
830 UgenTarget(parser/literal)
831 UgenTarget(parser/maybe)
832 UgenTarget(parser/either)
833 UgenTarget(parser/qid)
834 UgenTarget(parser/tree)
835 UgenTarget(parser/ttype)
837 UGENS_C = parser/constr.c \
849 /* Putting the -#include"hspincl.h" option into the
850 PARSER_HS_OPTS line really does not work (it depends
851 on the 'make' that you use).
853 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
855 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
856 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
857 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
858 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
859 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
860 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
861 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
862 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
863 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
864 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
865 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
866 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
867 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
869 /* finished with local macros */
874 /* *** misc *************************************************** */
876 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
878 #if GhcWithHscBuiltViaC == NO
879 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
880 #else /* booting from .hc */
881 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
882 #endif /* booting from .hc files */
884 #if HaskellCompilerType != HC_USE_HC_FILES
885 /* otherwise, the dependencies jeopardize our .hc files --
886 which are all we have! */
887 HaskellDependTarget( $(DEPSRCS) )
890 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
891 #if GhcWithHscBuiltViaC == YES
892 ExtraStuffToClean( $(ALLHCS) )
894 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
897 HsTagsTarget( $(ALLSRCS_LHS) )
898 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
900 /* count the number of lines in the source files */
902 ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
904 /* accumulate similar info about the sizes of object files */
906 ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)