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 \
73 #define hsp_library libhsp.a
75 #define READERSRCS_LHS \
78 reader/ReadPrefix.lhs \
79 reader/ReadPragmas.lhs \
81 reader/PrefixSyn.lhs \
82 reader/PrefixToHs.lhs \
85 hsSyn/HsBinds.lhs /* abstract Haskell syntax */ \
97 #define NOT_SO_BASICSRCS_LHS \
98 basicTypes/Unique.lhs \
99 basicTypes/UniqSupply.lhs \
100 basicTypes/ProtoName.lhs \
101 basicTypes/Name.lhs \
102 basicTypes/NameTypes.lhs \
103 basicTypes/SrcLoc.lhs \
105 basicTypes/IdInfo.lhs \
106 basicTypes/IdUtils.lhs \
107 basicTypes/PragmaInfo.lhs \
108 basicTypes/Literal.lhs \
118 specialise/SpecEnv.lhs
121 #define RENAMERSRCS_LHS \
128 rename/RnMonad12.lhs \
129 rename/RnMonad3.lhs \
130 rename/RnMonad4.lhs \
131 rename/RnBinds4.lhs \
136 typecheck/TcHsSyn.lhs \
137 typecheck/GenSpecEtc.lhs \
139 typecheck/TcBinds.lhs \
140 typecheck/TcClassDcl.lhs \
141 typecheck/TcDefaults.lhs \
142 typecheck/TcDeriv.lhs \
143 typecheck/TcExpr.lhs \
144 typecheck/TcGenDeriv.lhs \
145 typecheck/TcGRHSs.lhs \
146 typecheck/TcIfaceSig.lhs \
147 typecheck/TcInstDcls.lhs \
148 typecheck/TcInstUtil.lhs \
149 typecheck/TcMatches.lhs \
150 typecheck/TcModule.lhs \
151 typecheck/TcMonad.lhs \
152 typecheck/TcEnv.lhs \
153 typecheck/TcKind.lhs \
154 typecheck/TcType.lhs \
155 typecheck/TcMonoType.lhs \
156 typecheck/TcPat.lhs \
157 typecheck/TcSimplify.lhs \
158 typecheck/TcTyClsDecls.lhs \
159 typecheck/TcTyDecls.lhs \
160 typecheck/Typecheck.lhs \
164 typecheck/TcPragmas.lhs \
168 deSugar/Desugar.lhs \
170 deSugar/MatchCon.lhs \
171 deSugar/MatchLit.lhs \
172 deSugar/DsBinds.lhs \
173 deSugar/DsCCall.lhs \
175 deSugar/DsGRHSs.lhs \
176 deSugar/DsHsSyn.lhs \
177 deSugar/DsListComp.lhs \
178 deSugar/DsMonad.lhs \
179 deSugar/DsUtils.lhs \
181 coreSyn/CoreLift.lhs \
184 #define SIMPL_SRCS_LHS \
185 coreSyn/AnnCoreSyn.lhs \
186 coreSyn/FreeVars.lhs \
188 specialise/Specialise.lhs \
189 specialise/SpecUtils.lhs \
191 simplCore/SimplCase.lhs \
192 simplCore/SimplEnv.lhs \
193 simplCore/SimplMonad.lhs \
194 simplCore/SimplPgm.lhs \
195 simplCore/SimplUtils.lhs \
196 simplCore/SimplVar.lhs \
197 simplCore/Simplify.lhs \
199 simplCore/LiberateCase.lhs \
201 simplCore/ConFold.lhs \
202 simplCore/FloatIn.lhs \
203 simplCore/FloatOut.lhs \
205 simplCore/SATMonad.lhs \
206 simplCore/SetLevels.lhs \
207 simplCore/SimplCore.lhs \
208 simplCore/OccurAnal.lhs \
209 simplCore/FoldrBuildWW.lhs \
210 simplCore/AnalFBWW.lhs \
212 stranal/StrictAnal.lhs \
214 stranal/SaAbsInt.lhs \
216 stranal/WorkWrap.lhs \
218 profiling/SCCauto.lhs \
219 profiling/SCCfinal.lhs
221 #if GhcWithDeforester != YES
222 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
223 #define DEFORESTER_SRCS_LHS /*none*/
225 #define __omit_deforester_flag /*nope*/
226 #define DEFORESTER_SRCS_LHS \
227 deforest/DefSyn.lhs \
228 deforest/Core2Def.lhs \
229 deforest/Def2Core.lhs \
230 deforest/Deforest.lhs \
231 deforest/DefUtils.lhs \
232 deforest/DefExpr.lhs \
233 deforest/Cyclic.lhs \
234 deforest/TreelessForm.lhs
235 #endif /* GhcWithDeforester */
237 #define BACKSRCS_LHS \
238 stgSyn/CoreToStg.lhs \
240 stgSyn/StgUtils.lhs \
243 simplStg/SatStgRhs.lhs \
244 simplStg/LambdaLift.lhs \
245 simplStg/StgVarInfo.lhs \
246 simplStg/UpdAnal.lhs \
247 simplStg/StgStats.lhs \
248 simplStg/StgSATMonad.lhs \
249 simplStg/StgSAT.lhs \
250 simplStg/SimplStg.lhs \
252 absCSyn/AbsCUtils.lhs \
253 absCSyn/AbsCSyn.lhs \
256 absCSyn/HeapOffs.lhs \
257 absCSyn/PprAbsC.lhs \
259 codeGen/CodeGen.lhs \
260 codeGen/ClosureInfo.lhs \
262 codeGen/CgConTbls.lhs \
263 codeGen/CgMonad.lhs \
264 codeGen/CgUsages.lhs \
265 codeGen/CgHeapery.lhs \
266 codeGen/CgStackery.lhs \
269 codeGen/CgLetNoEscape.lhs \
270 codeGen/CgTailCall.lhs \
271 codeGen/CgClosure.lhs \
273 codeGen/CgRetConv.lhs \
274 codeGen/CgBindery.lhs \
277 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
278 /* if building via C, we *assume* that it is the
279 distributed C files, which do not have a native-code
282 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
283 # define NATIVEGEN_SRCS_LHS /*none*/
285 # define __omit_ncg_maybe /*none*/
286 # if i386_TARGET_ARCH
287 # define __machdep_nativegen_lhs \
288 nativeGen/I386Desc.lhs \
289 nativeGen/I386Code.lhs \
290 nativeGen/I386Gen.lhs
292 # if sparc_TARGET_ARCH
293 # define __machdep_nativegen_lhs \
294 nativeGen/SparcDesc.lhs \
295 nativeGen/SparcCode.lhs \
296 nativeGen/SparcGen.lhs
298 # if alpha_TARGET_ARCH
299 # define __machdep_nativegen_lhs \
300 nativeGen/AlphaDesc.lhs \
301 nativeGen/AlphaCode.lhs \
302 nativeGen/AlphaGen.lhs
305 # define NATIVEGEN_SRCS_LHS \
306 nativeGen/AbsCStixGen.lhs \
307 nativeGen/AsmCodeGen.lhs \
308 nativeGen/AsmRegAlloc.lhs \
309 nativeGen/MachDesc.lhs \
311 nativeGen/StixInfo.lhs \
312 nativeGen/StixInteger.lhs \
313 nativeGen/StixPrim.lhs \
314 nativeGen/StixMacro.lhs \
315 __machdep_nativegen_lhs /*arch-specific ones */
318 #define UTILSRCS_LHS \
324 utils/FiniteMap.lhs \
325 utils/ListSetOps.lhs \
329 utils/Outputable.lhs \
338 #define MAIN_SRCS_LHS \
340 main/CmdLineOpts.lhs \
348 #define VBASICSRCS_LHS \
349 prelude/PrelMods.lhs \
350 prelude/PrimRep.lhs \
352 prelude/TysPrim.lhs \
353 prelude/TysWiredIn.lhs \
354 prelude/PrelVals.lhs \
355 prelude/PrelInfo.lhs \
357 absCSyn/CStrings.lhs \
358 codeGen/CgCompInfo.lhs \
359 coreSyn/CoreSyn.lhs \
360 coreSyn/CoreUnfold.lhs \
361 coreSyn/CoreUtils.lhs \
362 coreSyn/PprCore.lhs \
363 profiling/CostCentre.lhs \
364 simplCore/BinderInfo.lhs \
365 simplCore/MagicUFs.lhs
367 ALLSRCS_HS = READERSRCS_HS
368 ALLSRCS_LHS = /* all pieces of the compiler */ \
370 NOT_SO_BASICSRCS_LHS \
384 NATIVEGEN_SRCS_LHS DEFORESTER_SRCS_LHS */
385 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
386 need to be on the last line.
389 /* should't use these fancy `make' things, really */
390 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
391 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
392 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
394 .PRECIOUS: $(ALLINTS)
396 #if GhcWithHscDebug == YES
397 # define use_DDEBUG -DDEBUG
399 # define use_DDEBUG /*nothing*/
402 #if GhcWithHscOptimised == YES
403 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
405 #define __version_sensitive_flags -fomit-reexported-instances
408 #if GhcWithRegisterised == NO
409 /* doing a raw boot from .hc files, presumably */
410 #define __unreg_opts_maybe -O -unregisterised
412 #define __unreg_opts_maybe /*none*/
415 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
416 #undef AllProjectsHcOpts
417 #define AllProjectsHcOpts /**/
419 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
420 -fomit-derived-read \
421 -I. -i$(SUBDIR_LIST) \
422 use_DDEBUG __version_sensitive_flags __unreg_opts_maybe __omit_ncg_maybe
424 #undef __version_sensitive_flags
425 #undef __unreg_opts_maybe
426 #undef __omit_ncg_maybe
427 #undef __omit_deforester_flag
429 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
433 # if HaskellCompilerType == HC_USE_HC_FILES
434 HC = $(GHC) /* uses the driver herein */
437 #endif /* using .hc files */
441 Used when compiling GHC. Some GHC utility modules are
442 *also* part of the GHC library. There are a few bits
443 of those modules that only apply to GHC itself and
444 should not be in the library stuff. We use this
445 CPP thing to isolate those bits.
448 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
450 #if DoInstallGHCSystem == YES
451 MakeDirectories(install, $(INSTLIBDIR_GHC))
452 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
455 /* set up for going either to .hc or to .o files */
456 #if GhcWithHscBuiltViaC == YES
458 /*OLD:SuffixRule_hc_o() */
460 # if HaskellCompilerType == HC_USE_HC_FILES
461 /* if we do not, we never try to compile .lhs files;
462 we *blast* the macro we would normally use (HACK) (WDP 94/12)
465 # undef HaskellCompileWithSpecifiedFlags
466 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
467 module.osuf : module.isuf \
468 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
470 # define compile(module,isuf,extra_flags) \
471 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
473 # define compile_rec(module,isuf,extra_flags) \
474 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
478 # define compile(module,isuf,extra_flags) \
479 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
481 # define compile_rec(module,isuf,extra_flags) \
482 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
484 # endif /* ... == HC_USE_HC_FILES */
486 #else /* ! booting from C */
488 # define compile(module,isuf,extra_flags) \
489 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
491 # define compile_rec(module,isuf,extra_flags) \
492 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
494 #endif /* ! booting from C */
497 #if GhcBuilderVersion >= 26
498 # define if_ghc26(x) x
500 # define if_ghc26(x) /*nothing*/
503 /* OK, here we go: */
505 utils/Ubiq.hi : utils/Ubiq.lhi
506 $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
508 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
509 $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
510 basicTypes/NameLoop.hi : basicTypes/NameLoop.lhi
511 $(GHC_UNLIT) basicTypes/NameLoop.lhi basicTypes/NameLoop.hi
512 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
513 $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
514 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
515 $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
516 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
517 $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
518 reader/RdrLoop.hi : reader/RdrLoop.lhi
519 $(GHC_UNLIT) reader/RdrLoop.lhi reader/RdrLoop.hi
520 rename/RnLoop.hi : rename/RnLoop.lhi
521 $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
522 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
523 $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
524 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
525 $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
526 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
527 $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
528 types/TyLoop.hi : types/TyLoop.lhi
529 $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
531 compile(absCSyn/AbsCUtils,lhs,)
532 compile(absCSyn/CStrings,lhs,)
533 compile(absCSyn/CLabel,lhs,)
534 compile(absCSyn/Costs,lhs,)
535 compile(absCSyn/HeapOffs,lhs,)
536 compile(absCSyn/PprAbsC,lhs,)
537 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
539 compile(hsSyn/HsBinds,lhs,)
540 compile(hsSyn/HsCore,lhs,)
541 compile(hsSyn/HsDecls,lhs,)
542 compile(hsSyn/HsExpr,lhs,)
543 compile(hsSyn/HsImpExp,lhs,)
544 compile(hsSyn/HsLit,lhs,)
545 compile(hsSyn/HsMatches,lhs,)
546 compile(hsSyn/HsPat,lhs,)
547 compile(hsSyn/HsPragmas,lhs,)
548 compile(hsSyn/HsTypes,lhs,)
549 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
551 compile(basicTypes/Id,lhs,)
552 compile(basicTypes/IdInfo,lhs,-K2m)
553 compile(basicTypes/IdUtils,lhs,)
554 compile(basicTypes/Literal,lhs,)
555 compile(basicTypes/Name,lhs,)
556 compile(basicTypes/NameTypes,lhs,)
557 compile(basicTypes/PragmaInfo,lhs,)
558 compile(basicTypes/ProtoName,lhs,)
559 compile(basicTypes/SrcLoc,lhs,)
560 compile(basicTypes/UniqSupply,lhs,)
561 compile(basicTypes/Unique,lhs,)
563 compile(codeGen/CgBindery,lhs,)
564 compile(codeGen/CgCase,lhs,)
565 compile(codeGen/CgClosure,lhs,)
566 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
567 compile(codeGen/CgCon,lhs,)
568 compile(codeGen/CgConTbls,lhs,)
569 compile(codeGen/CgExpr,lhs,)
570 compile(codeGen/CgHeapery,lhs,)
571 compile(codeGen/CgLetNoEscape,lhs,)
572 compile(codeGen/CgMonad,lhs,)
573 compile(codeGen/CgRetConv,lhs,)
574 compile(codeGen/CgStackery,lhs,)
575 compile(codeGen/CgTailCall,lhs,)
576 compile(codeGen/CgUpdate,lhs,)
577 compile(codeGen/CgUsages,lhs,)
578 compile(codeGen/ClosureInfo,lhs,)
579 compile(codeGen/CodeGen,lhs,)
580 compile(codeGen/SMRep,lhs,)
582 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
583 compile(coreSyn/CoreUtils,lhs,)
584 compile(coreSyn/CoreLift,lhs,)
585 compile(coreSyn/CoreLint,lhs,)
586 compile(coreSyn/CoreSyn,lhs,)
587 compile(coreSyn/PprCore,lhs,)
588 compile(coreSyn/CoreUnfold,lhs,)
589 compile(coreSyn/FreeVars,lhs,)
591 compile(deSugar/Desugar,lhs,)
592 compile(deSugar/DsBinds,lhs,)
593 compile(deSugar/DsCCall,lhs,)
594 compile(deSugar/DsExpr,lhs,)
595 compile(deSugar/DsGRHSs,lhs,)
596 compile(deSugar/DsHsSyn,lhs,)
597 compile(deSugar/DsListComp,lhs,)
598 compile(deSugar/DsMonad,lhs,)
599 compile(deSugar/DsUtils,lhs,)
600 compile(deSugar/Match,lhs,)
601 compile(deSugar/MatchCon,lhs,)
602 compile(deSugar/MatchLit,lhs,)
604 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
605 compile(main/ErrUtils,lhs,)
606 compile(main/Main,lhs,if_ghc(-fvia-C))
607 compile(main/MainMonad,lhs,)
608 compile(main/MkIface,lhs,)
610 #if GhcWithNativeCodeGen == YES
611 compile(nativeGen/AbsCStixGen,lhs,)
612 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
613 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
614 compile(nativeGen/MachDesc,lhs,)
615 compile(nativeGen/Stix,lhs,)
616 compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
617 compile(nativeGen/StixInteger,lhs,)
618 compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
619 compile(nativeGen/StixPrim,lhs,)
620 # if i386_TARGET_ARCH
621 compile(nativeGen/I386Desc,lhs,)
622 compile(nativeGen/I386Code,lhs,-I$(NATIVEGEN_DIR) if_ghc(-monly-4-regs))
623 compile(nativeGen/I386Gen,lhs,)
625 # if sparc_TARGET_ARCH
626 compile(nativeGen/SparcDesc,lhs,)
627 compile(nativeGen/SparcCode,lhs,-I$(NATIVEGEN_DIR))
628 compile(nativeGen/SparcGen,lhs,)
630 # if alpha_TARGET_ARCH
631 compile(nativeGen/AlphaDesc,lhs,)
632 compile(nativeGen/AlphaCode,lhs,-I$(NATIVEGEN_DIR))
633 compile(nativeGen/AlphaGen,lhs,)
637 compile(prelude/PrelInfo,lhs,)
638 compile(prelude/PrelMods,lhs,)
639 compile(prelude/PrelVals,lhs,)
640 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
641 compile(prelude/PrimOp,lhs,-K3m -H10m)
642 compile(prelude/TysPrim,lhs,)
643 compile(prelude/TysWiredIn,lhs,)
645 compile(profiling/SCCauto,lhs,)
646 compile(profiling/SCCfinal,lhs,)
647 compile(profiling/CostCentre,lhs,)
649 compile(reader/PrefixSyn,lhs,)
650 compile(reader/PrefixToHs,lhs,)
651 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
652 compile(reader/ReadPragmas,lhs,)
653 compile(reader/RdrHsSyn,lhs,)
655 compile(rename/Rename,lhs,)
656 compile(rename/RnPass1,lhs,)
657 compile(rename/RnPass2,lhs,)
658 compile(rename/RnPass3,lhs,)
659 compile(rename/RnPass4,lhs,)
660 compile(rename/RnUtils,lhs,)
661 compile(rename/RnHsSyn,lhs,)
662 compile(rename/RnBinds4,lhs,)
663 compile(rename/RnExpr4,lhs,)
664 compile(rename/RnMonad12,lhs,)
665 compile(rename/RnMonad3,lhs,)
666 compile(rename/RnMonad4,lhs,)
668 compile(simplCore/BinderInfo,lhs,)
669 compile(simplCore/ConFold,lhs,)
670 compile(simplCore/FloatIn,lhs,)
671 compile(simplCore/FloatOut,lhs,)
672 compile(simplCore/LiberateCase,lhs,)
673 compile(simplCore/MagicUFs,lhs,)
674 compile(simplCore/OccurAnal,lhs,)
676 compile(simplCore/AnalFBWW,lhs,)
677 compile(simplCore/FoldrBuildWW,lhs,)
679 compile(simplCore/SAT,lhs,)
680 compile(simplCore/SATMonad,lhs,)
681 compile(simplCore/SetLevels,lhs,)
682 compile(simplCore/SimplCase,lhs,)
683 compile(simplCore/SimplCore,lhs,)
684 compile(simplCore/SimplEnv,lhs,)
685 compile(simplCore/SimplMonad,lhs,)
686 compile(simplCore/SimplPgm,lhs,)
687 compile(simplCore/SimplUtils,lhs,)
688 compile(simplCore/SimplVar,lhs,)
689 compile(simplCore/Simplify,lhs,)
691 compile(simplStg/SatStgRhs,lhs,)
692 compile(simplStg/LambdaLift,lhs,)
693 compile(simplStg/StgVarInfo,lhs,)
694 compile(simplStg/UpdAnal,lhs,)
695 compile(simplStg/StgStats,lhs,)
696 compile(simplStg/StgSATMonad,lhs,)
697 compile(simplStg/StgSAT,lhs,)
698 compile(simplStg/SimplStg,lhs,)
700 #if GhcWithDeforester == YES
701 compile(deforest/Core2Def,lhs,)
702 compile(deforest/Cyclic,lhs,)
703 compile(deforest/Def2Core,lhs,)
704 compile(deforest/DefExpr,lhs,)
705 compile(deforest/DefSyn,lhs,)
706 compile(deforest/DefUtils,lhs,)
707 compile(deforest/Deforest,lhs,)
708 compile(deforest/TreelessForm,lhs,)
711 compile(specialise/Specialise,lhs,)
712 compile(specialise/SpecEnv,lhs,)
713 compile(specialise/SpecUtils,lhs,)
715 compile(stgSyn/CoreToStg,lhs,)
716 compile(stgSyn/StgUtils,lhs,)
717 compile(stgSyn/StgLint,lhs,)
718 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
720 compile(stranal/SaAbsInt,lhs,)
721 compile(stranal/SaLib,lhs,)
722 compile(stranal/StrictAnal,lhs,)
723 compile(stranal/WorkWrap,lhs,)
724 compile(stranal/WwLib,lhs,)
726 compile(typecheck/GenSpecEtc,lhs,)
727 compile(typecheck/Inst,lhs,)
728 compile(typecheck/TcHsSyn,lhs,)
729 compile(typecheck/TcBinds,lhs,)
730 compile(typecheck/TcClassDcl,lhs,)
731 compile(typecheck/TcDefaults,lhs,)
732 compile(typecheck/TcDeriv,lhs,)
733 compile(typecheck/TcExpr,lhs,)
734 compile(typecheck/TcGRHSs,lhs,)
735 compile(typecheck/TcGenDeriv,lhs,)
736 compile(typecheck/TcIfaceSig,lhs,)
737 compile(typecheck/TcInstDcls,lhs,)
738 compile(typecheck/TcInstUtil,lhs,)
739 compile(typecheck/TcMatches,lhs,)
740 compile(typecheck/TcModule,lhs,)
741 compile(typecheck/TcMonad,lhs,)
742 compile(typecheck/TcKind,lhs,)
743 compile(typecheck/TcType,lhs,)
744 compile(typecheck/TcEnv,lhs,)
745 compile(typecheck/TcMonoType,lhs,)
746 compile(typecheck/TcPat,lhs,)
747 compile(typecheck/TcPragmas,lhs,)
748 compile(typecheck/TcSimplify,lhs,)
749 compile(typecheck/TcTyClsDecls,lhs,)
750 compile(typecheck/TcTyDecls,lhs,)
751 compile(typecheck/Typecheck,lhs,)
752 compile(typecheck/Unify,lhs,)
754 compile(types/Class,lhs,)
755 compile(types/Kind,lhs,)
756 compile(types/PprType,lhs,)
757 compile(types/TyCon,lhs,)
758 compile(types/TyVar,lhs,)
759 compile(types/Usage,lhs,)
760 compile(types/Type,lhs,)
762 compile(utils/Argv,lhs,if_ghc(-fvia-C))
763 compile(utils/Bag,lhs,)
764 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
765 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
766 compile(utils/Digraph,lhs,)
767 compile(utils/FiniteMap,lhs,)
768 compile(utils/ListSetOps,lhs,)
769 compile(utils/Maybes,lhs,)
770 compile(utils/OrdList,lhs,)
771 compile(utils/Outputable,lhs,)
772 compile(utils/PprStyle,lhs,)
773 compile(utils/Pretty,lhs,)
774 compile(utils/SST,lhs,if_ghc(-fvia-C))
775 compile(utils/UniqFM,lhs,)
776 compile(utils/UniqSet,lhs,)
777 compile(utils/Unpretty,lhs,)
778 compile(utils/MatchEnv,lhs,)
779 compile(utils/Util,lhs,)
781 /* for convenience in cross-compiling */
784 /* *** parser ************************************************* */
787 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
789 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
791 XCOMM D_DEBUG = -DDEBUG
793 CPP_DEFINES = $(D_DEBUG)
795 HSP_SRCS_C = parser/constr.c \
802 parser/hsparser.tab.c \
804 parser/import_dirlist.c \
814 parser/type2context.c \
817 HSP_OBJS_O = parser/constr.o \
824 parser/hsparser.tab.o \
826 parser/import_dirlist.o \
836 parser/type2context.o \
839 /* this is for etags */
840 REAL_HSP_SRCS_C = parser/main.c \
846 parser/type2context.c \
847 parser/import_dirlist.c \
851 UgenNeededHere(all depend)
853 /* Most hsp files are in libhsp.a, so we can either make
854 a standalone parser, or incorporate the files into
855 the hsc compiler directly (WDP 94/10)
857 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
859 /* We need the hsp program for hstags to work! */
860 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
862 #if DoInstallGHCSystem == YES
863 MakeDirectories(install, $(INSTLIBDIR_GHC))
864 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
865 #endif /* DoInstall... */
867 YaccRunWithExpectMsg(parser/hsparser,16,0)
869 UgenTarget(parser/constr)
870 UgenTarget(parser/binding)
871 UgenTarget(parser/pbinding)
872 UgenTarget(parser/coresyn)
873 UgenTarget(parser/entidt)
874 UgenTarget(parser/hpragma)
875 UgenTarget(parser/list)
876 UgenTarget(parser/literal)
877 UgenTarget(parser/maybe)
878 UgenTarget(parser/either)
879 UgenTarget(parser/qid)
880 UgenTarget(parser/tree)
881 UgenTarget(parser/ttype)
883 UGENS_C = parser/constr.c \
897 /* Putting the -#include"hspincl.h" option into the
898 PARSER_HS_OPTS line really does not work (it depends
899 on the 'make' that you use).
901 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
903 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
904 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
905 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
906 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
907 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
908 compile(parser/U_coresyn,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
909 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
910 compile(parser/U_hpragma,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
911 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
912 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
913 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
914 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
915 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
916 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
917 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
919 /* finished with local macros */
924 /* *** misc *************************************************** */
926 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS) SIMPL_SRCS_LHS
928 #if GhcWithHscBuiltViaC == NO
929 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
930 #else /* booting from .hc */
931 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
932 #endif /* booting from .hc files */
934 #if HaskellCompilerType != HC_USE_HC_FILES
935 /* otherwise, the dependencies jeopardize our .hc files --
936 which are all we have! */
937 HaskellDependTarget( $(DEPSRCS) )
940 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
941 #if GhcWithHscBuiltViaC == YES
942 ExtraStuffToClean( $(ALLHCS) )
944 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
947 HsTagsTarget( $(ALLSRCS_LHS) )
948 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
950 /* count the number of lines in the source files */
952 ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
954 /* accumulate similar info about the sizes of object files */
956 ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)