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 \
220 profiling/CostCentre.lhs
222 #if GhcWithDeforester != YES
223 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
224 #define DEFORESTER_SRCS_LHS /*none*/
226 #define __omit_deforester_flag /*nope*/
227 #define DEFORESTER_SRCS_LHS \
228 deforest/DefSyn.lhs \
229 deforest/Core2Def.lhs \
230 deforest/Def2Core.lhs \
231 deforest/Deforest.lhs \
232 deforest/DefUtils.lhs \
233 deforest/DefExpr.lhs \
234 deforest/Cyclic.lhs \
235 deforest/TreelessForm.lhs
236 #endif /* GhcWithDeforester */
238 #define BACKSRCS_LHS \
239 stgSyn/CoreToStg.lhs \
241 stgSyn/StgUtils.lhs \
244 simplStg/SatStgRhs.lhs \
245 simplStg/LambdaLift.lhs \
246 simplStg/StgVarInfo.lhs \
247 simplStg/UpdAnal.lhs \
248 simplStg/StgStats.lhs \
249 simplStg/StgSATMonad.lhs \
250 simplStg/StgSAT.lhs \
251 simplStg/SimplStg.lhs \
253 absCSyn/AbsCUtils.lhs \
254 absCSyn/AbsCSyn.lhs \
257 absCSyn/HeapOffs.lhs \
258 absCSyn/PprAbsC.lhs \
260 codeGen/CodeGen.lhs \
261 codeGen/ClosureInfo.lhs \
263 codeGen/CgConTbls.lhs \
264 codeGen/CgMonad.lhs \
265 codeGen/CgUsages.lhs \
266 codeGen/CgHeapery.lhs \
267 codeGen/CgStackery.lhs \
270 codeGen/CgLetNoEscape.lhs \
271 codeGen/CgTailCall.lhs \
272 codeGen/CgClosure.lhs \
274 codeGen/CgRetConv.lhs \
275 codeGen/CgBindery.lhs \
278 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
279 /* if building via C, we *assume* that it is the
280 distributed C files, which do not have a native-code
283 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
284 # define NATIVEGEN_SRCS_LHS /*none*/
286 # define __omit_ncg_maybe /*none*/
287 # if i386_TARGET_ARCH
288 # define __machdep_nativegen_lhs \
289 nativeGen/I386Desc.lhs \
290 nativeGen/I386Code.lhs \
291 nativeGen/I386Gen.lhs
293 # if sparc_TARGET_ARCH
294 # define __machdep_nativegen_lhs \
295 nativeGen/SparcDesc.lhs \
296 nativeGen/SparcCode.lhs \
297 nativeGen/SparcGen.lhs
299 # if alpha_TARGET_ARCH
300 # define __machdep_nativegen_lhs \
301 nativeGen/AlphaDesc.lhs \
302 nativeGen/AlphaCode.lhs \
303 nativeGen/AlphaGen.lhs
306 # define NATIVEGEN_SRCS_LHS \
307 nativeGen/AbsCStixGen.lhs \
308 nativeGen/AsmCodeGen.lhs \
309 nativeGen/AsmRegAlloc.lhs \
310 nativeGen/MachDesc.lhs \
312 nativeGen/StixInfo.lhs \
313 nativeGen/StixInteger.lhs \
314 nativeGen/StixPrim.lhs \
315 nativeGen/StixMacro.lhs \
316 __machdep_nativegen_lhs /*arch-specific ones */
319 #define UTILSRCS_LHS \
325 utils/FiniteMap.lhs \
326 utils/ListSetOps.lhs \
330 utils/Outputable.lhs \
339 #define MAIN_SRCS_LHS \
341 main/CmdLineOpts.lhs \
349 #define VBASICSRCS_LHS \
350 prelude/PrelMods.lhs \
351 prelude/PrimRep.lhs \
353 prelude/TysPrim.lhs \
354 prelude/TysWiredIn.lhs \
355 prelude/PrelVals.lhs \
356 prelude/PrelInfo.lhs \
358 absCSyn/CStrings.lhs \
359 codeGen/CgCompInfo.lhs \
360 coreSyn/CoreSyn.lhs \
361 coreSyn/CoreUnfold.lhs \
362 coreSyn/CoreUtils.lhs \
363 coreSyn/PprCore.lhs \
364 profiling/CostCentre.lhs \
365 simplCore/BinderInfo.lhs \
366 simplCore/MagicUFs.lhs
368 ALLSRCS_HS = READERSRCS_HS
369 ALLSRCS_LHS = /* all pieces of the compiler */ \
371 NOT_SO_BASICSRCS_LHS \
385 NATIVEGEN_SRCS_LHS DEFORESTER_SRCS_LHS */
386 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
387 need to be on the last line.
390 /* should't use these fancy `make' things, really */
391 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
392 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
393 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
395 .PRECIOUS: $(ALLINTS)
397 #if GhcWithHscDebug == YES
398 # define use_DDEBUG -DDEBUG
400 # define use_DDEBUG /*nothing*/
403 #if GhcWithHscOptimised == YES
404 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
406 #define __version_sensitive_flags -fomit-reexported-instances
409 #if GhcWithRegisterised == NO
410 /* doing a raw boot from .hc files, presumably */
411 #define __unreg_opts_maybe -O -unregisterised
413 #define __unreg_opts_maybe /*none*/
416 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
417 #undef AllProjectsHcOpts
418 #define AllProjectsHcOpts /**/
420 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
421 -fomit-derived-read \
422 -I. -i$(SUBDIR_LIST) \
423 use_DDEBUG __version_sensitive_flags __unreg_opts_maybe __omit_ncg_maybe
425 #undef __version_sensitive_flags
426 #undef __unreg_opts_maybe
427 #undef __omit_ncg_maybe
428 #undef __omit_deforester_flag
430 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
434 # if HaskellCompilerType == HC_USE_HC_FILES
435 HC = $(GHC) /* uses the driver herein */
438 #endif /* using .hc files */
442 Used when compiling GHC. Some GHC utility modules are
443 *also* part of the GHC library. There are a few bits
444 of those modules that only apply to GHC itself and
445 should not be in the library stuff. We use this
446 CPP thing to isolate those bits.
449 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
451 #if DoInstallGHCSystem == YES
452 MakeDirectories(install, $(INSTLIBDIR_GHC))
453 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
456 /* set up for going either to .hc or to .o files */
457 #if GhcWithHscBuiltViaC == YES
459 /*OLD:SuffixRule_hc_o() */
461 # if HaskellCompilerType == HC_USE_HC_FILES
462 /* if we do not, we never try to compile .lhs files;
463 we *blast* the macro we would normally use (HACK) (WDP 94/12)
466 # undef HaskellCompileWithSpecifiedFlags
467 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
468 module.osuf : module.isuf \
469 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
471 # define compile(module,isuf,extra_flags) \
472 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
474 # define compile_rec(module,isuf,extra_flags) \
475 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
479 # define compile(module,isuf,extra_flags) \
480 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
482 # define compile_rec(module,isuf,extra_flags) \
483 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
485 # endif /* ... == HC_USE_HC_FILES */
487 #else /* ! booting from C */
489 # define compile(module,isuf,extra_flags) \
490 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
492 # define compile_rec(module,isuf,extra_flags) \
493 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
495 #endif /* ! booting from C */
498 #if GhcBuilderVersion >= 26
499 # define if_ghc26(x) x
501 # define if_ghc26(x) /*nothing*/
504 /* OK, here we go: */
506 utils/Ubiq.hi : utils/Ubiq.lhi
507 $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
509 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
510 $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
511 basicTypes/NameLoop.hi : basicTypes/NameLoop.lhi
512 $(GHC_UNLIT) basicTypes/NameLoop.lhi basicTypes/NameLoop.hi
513 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
514 $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
515 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
516 $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
517 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
518 $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
519 reader/RdrLoop.hi : reader/RdrLoop.lhi
520 $(GHC_UNLIT) reader/RdrLoop.lhi reader/RdrLoop.hi
521 rename/RnLoop.hi : rename/RnLoop.lhi
522 $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
523 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
524 $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
525 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
526 $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
527 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
528 $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
529 types/TyLoop.hi : types/TyLoop.lhi
530 $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
532 compile(absCSyn/AbsCUtils,lhs,)
533 compile(absCSyn/CStrings,lhs,)
534 compile(absCSyn/CLabel,lhs,)
535 compile(absCSyn/Costs,lhs,)
536 compile(absCSyn/HeapOffs,lhs,)
537 compile(absCSyn/PprAbsC,lhs,)
538 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
540 compile(hsSyn/HsBinds,lhs,)
541 compile(hsSyn/HsCore,lhs,)
542 compile(hsSyn/HsDecls,lhs,)
543 compile(hsSyn/HsExpr,lhs,)
544 compile(hsSyn/HsImpExp,lhs,)
545 compile(hsSyn/HsLit,lhs,)
546 compile(hsSyn/HsMatches,lhs,)
547 compile(hsSyn/HsPat,lhs,)
548 compile(hsSyn/HsPragmas,lhs,)
549 compile(hsSyn/HsTypes,lhs,)
550 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
552 compile(basicTypes/Id,lhs,)
553 compile(basicTypes/IdInfo,lhs,-K2m)
554 compile(basicTypes/IdUtils,lhs,)
555 compile(basicTypes/Literal,lhs,)
556 compile(basicTypes/Name,lhs,)
557 compile(basicTypes/NameTypes,lhs,)
558 compile(basicTypes/PragmaInfo,lhs,)
559 compile(basicTypes/ProtoName,lhs,)
560 compile(basicTypes/SrcLoc,lhs,)
561 compile(basicTypes/UniqSupply,lhs,)
562 compile(basicTypes/Unique,lhs,)
564 compile(codeGen/CgBindery,lhs,)
565 compile(codeGen/CgCase,lhs,)
566 compile(codeGen/CgClosure,lhs,)
567 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
568 compile(codeGen/CgCon,lhs,)
569 compile(codeGen/CgConTbls,lhs,)
570 compile(codeGen/CgExpr,lhs,)
571 compile(codeGen/CgHeapery,lhs,)
572 compile(codeGen/CgLetNoEscape,lhs,)
573 compile(codeGen/CgMonad,lhs,)
574 compile(codeGen/CgRetConv,lhs,)
575 compile(codeGen/CgStackery,lhs,)
576 compile(codeGen/CgTailCall,lhs,)
577 compile(codeGen/CgUpdate,lhs,)
578 compile(codeGen/CgUsages,lhs,)
579 compile(codeGen/ClosureInfo,lhs,)
580 compile(codeGen/CodeGen,lhs,)
581 compile(codeGen/SMRep,lhs,)
583 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
584 compile(coreSyn/CoreUtils,lhs,)
585 compile(coreSyn/CoreLift,lhs,)
586 compile(coreSyn/CoreLint,lhs,)
587 compile(coreSyn/CoreSyn,lhs,)
588 compile(coreSyn/PprCore,lhs,)
589 compile(coreSyn/CoreUnfold,lhs,)
590 compile(coreSyn/FreeVars,lhs,)
592 compile(deSugar/Desugar,lhs,)
593 compile(deSugar/DsBinds,lhs,)
594 compile(deSugar/DsCCall,lhs,)
595 compile(deSugar/DsExpr,lhs,)
596 compile(deSugar/DsGRHSs,lhs,)
597 compile(deSugar/DsHsSyn,lhs,)
598 compile(deSugar/DsListComp,lhs,)
599 compile(deSugar/DsMonad,lhs,)
600 compile(deSugar/DsUtils,lhs,)
601 compile(deSugar/Match,lhs,)
602 compile(deSugar/MatchCon,lhs,)
603 compile(deSugar/MatchLit,lhs,)
605 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
606 compile(main/ErrUtils,lhs,)
607 compile(main/Main,lhs,if_ghc(-fvia-C))
608 compile(main/MainMonad,lhs,)
609 compile(main/MkIface,lhs,)
611 #if GhcWithNativeCodeGen == YES
612 compile(nativeGen/AbsCStixGen,lhs,)
613 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
614 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
615 compile(nativeGen/MachDesc,lhs,)
616 compile(nativeGen/Stix,lhs,)
617 compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
618 compile(nativeGen/StixInteger,lhs,)
619 compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
620 compile(nativeGen/StixPrim,lhs,)
621 # if i386_TARGET_ARCH
622 compile(nativeGen/I386Desc,lhs,)
623 compile(nativeGen/I386Code,lhs,-I$(NATIVEGEN_DIR) if_ghc(-monly-4-regs))
624 compile(nativeGen/I386Gen,lhs,)
626 # if sparc_TARGET_ARCH
627 compile(nativeGen/SparcDesc,lhs,)
628 compile(nativeGen/SparcCode,lhs,-I$(NATIVEGEN_DIR))
629 compile(nativeGen/SparcGen,lhs,)
631 # if alpha_TARGET_ARCH
632 compile(nativeGen/AlphaDesc,lhs,)
633 compile(nativeGen/AlphaCode,lhs,-I$(NATIVEGEN_DIR))
634 compile(nativeGen/AlphaGen,lhs,)
638 compile(prelude/PrelInfo,lhs,)
639 compile(prelude/PrelMods,lhs,)
640 compile(prelude/PrelVals,lhs,)
641 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
642 compile(prelude/PrimOp,lhs,-K3m -H10m)
643 compile(prelude/TysPrim,lhs,)
644 compile(prelude/TysWiredIn,lhs,)
646 compile(profiling/SCCauto,lhs,)
647 compile(profiling/SCCfinal,lhs,)
648 compile(profiling/CostCentre,lhs,)
650 compile(reader/PrefixSyn,lhs,)
651 compile(reader/PrefixToHs,lhs,)
652 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
653 compile(reader/ReadPragmas,lhs,)
654 compile(reader/RdrHsSyn,lhs,)
656 compile(rename/Rename,lhs,)
657 compile(rename/RnPass1,lhs,)
658 compile(rename/RnPass2,lhs,)
659 compile(rename/RnPass3,lhs,)
660 compile(rename/RnPass4,lhs,)
661 compile(rename/RnUtils,lhs,)
662 compile(rename/RnHsSyn,lhs,)
663 compile(rename/RnBinds4,lhs,)
664 compile(rename/RnExpr4,lhs,)
665 compile(rename/RnMonad12,lhs,)
666 compile(rename/RnMonad3,lhs,)
667 compile(rename/RnMonad4,lhs,)
669 compile(simplCore/BinderInfo,lhs,)
670 compile(simplCore/ConFold,lhs,)
671 compile(simplCore/FloatIn,lhs,)
672 compile(simplCore/FloatOut,lhs,)
673 compile(simplCore/LiberateCase,lhs,)
674 compile(simplCore/MagicUFs,lhs,)
675 compile(simplCore/OccurAnal,lhs,)
677 compile(simplCore/AnalFBWW,lhs,)
678 compile(simplCore/FoldrBuildWW,lhs,)
680 compile(simplCore/SAT,lhs,)
681 compile(simplCore/SATMonad,lhs,)
682 compile(simplCore/SetLevels,lhs,)
683 compile(simplCore/SimplCase,lhs,)
684 compile(simplCore/SimplCore,lhs,)
685 compile(simplCore/SimplEnv,lhs,)
686 compile(simplCore/SimplMonad,lhs,)
687 compile(simplCore/SimplPgm,lhs,)
688 compile(simplCore/SimplUtils,lhs,)
689 compile(simplCore/SimplVar,lhs,)
690 compile(simplCore/Simplify,lhs,)
692 compile(simplStg/SatStgRhs,lhs,)
693 compile(simplStg/LambdaLift,lhs,)
694 compile(simplStg/StgVarInfo,lhs,)
695 compile(simplStg/UpdAnal,lhs,)
696 compile(simplStg/StgStats,lhs,)
697 compile(simplStg/StgSATMonad,lhs,)
698 compile(simplStg/StgSAT,lhs,)
699 compile(simplStg/SimplStg,lhs,)
701 #if GhcWithDeforester == YES
702 compile(deforest/Core2Def,lhs,)
703 compile(deforest/Cyclic,lhs,)
704 compile(deforest/Def2Core,lhs,)
705 compile(deforest/DefExpr,lhs,)
706 compile(deforest/DefSyn,lhs,)
707 compile(deforest/DefUtils,lhs,)
708 compile(deforest/Deforest,lhs,)
709 compile(deforest/TreelessForm,lhs,)
712 compile(specialise/Specialise,lhs,)
713 compile(specialise/SpecEnv,lhs,)
714 compile(specialise/SpecUtils,lhs,)
716 compile(stgSyn/CoreToStg,lhs,)
717 compile(stgSyn/StgUtils,lhs,)
718 compile(stgSyn/StgLint,lhs,)
719 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
721 compile(stranal/SaAbsInt,lhs,)
722 compile(stranal/SaLib,lhs,)
723 compile(stranal/StrictAnal,lhs,)
724 compile(stranal/WorkWrap,lhs,)
725 compile(stranal/WwLib,lhs,)
727 compile(typecheck/GenSpecEtc,lhs,)
728 compile(typecheck/Inst,lhs,)
729 compile(typecheck/TcHsSyn,lhs,)
730 compile(typecheck/TcBinds,lhs,)
731 compile(typecheck/TcClassDcl,lhs,)
732 compile(typecheck/TcDefaults,lhs,)
733 compile(typecheck/TcDeriv,lhs,)
734 compile(typecheck/TcExpr,lhs,)
735 compile(typecheck/TcGRHSs,lhs,)
736 compile(typecheck/TcGenDeriv,lhs,)
737 compile(typecheck/TcIfaceSig,lhs,)
738 compile(typecheck/TcInstDcls,lhs,)
739 compile(typecheck/TcInstUtil,lhs,)
740 compile(typecheck/TcMatches,lhs,)
741 compile(typecheck/TcModule,lhs,)
742 compile(typecheck/TcMonad,lhs,)
743 compile(typecheck/TcKind,lhs,)
744 compile(typecheck/TcType,lhs,)
745 compile(typecheck/TcEnv,lhs,)
746 compile(typecheck/TcMonoType,lhs,)
747 compile(typecheck/TcPat,lhs,)
748 compile(typecheck/TcPragmas,lhs,)
749 compile(typecheck/TcSimplify,lhs,)
750 compile(typecheck/TcTyClsDecls,lhs,)
751 compile(typecheck/TcTyDecls,lhs,)
752 compile(typecheck/Typecheck,lhs,)
753 compile(typecheck/Unify,lhs,)
755 compile(types/Class,lhs,)
756 compile(types/Kind,lhs,)
757 compile(types/PprType,lhs,)
758 compile(types/TyCon,lhs,)
759 compile(types/TyVar,lhs,)
760 compile(types/Usage,lhs,)
761 compile(types/Type,lhs,)
763 compile(utils/Argv,lhs,if_ghc(-fvia-C))
764 compile(utils/Bag,lhs,)
765 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
766 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
767 compile(utils/Digraph,lhs,)
768 compile(utils/FiniteMap,lhs,)
769 compile(utils/ListSetOps,lhs,)
770 compile(utils/Maybes,lhs,)
771 compile(utils/OrdList,lhs,)
772 compile(utils/Outputable,lhs,)
773 compile(utils/PprStyle,lhs,)
774 compile(utils/Pretty,lhs,)
775 compile(utils/SST,lhs,if_ghc(-fvia-C))
776 compile(utils/UniqFM,lhs,)
777 compile(utils/UniqSet,lhs,)
778 compile(utils/Unpretty,lhs,)
779 compile(utils/MatchEnv,lhs,)
780 compile(utils/Util,lhs,)
782 /* for convenience in cross-compiling */
785 /* *** parser ************************************************* */
788 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
790 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
792 XCOMM D_DEBUG = -DDEBUG
794 CPP_DEFINES = $(D_DEBUG)
796 HSP_SRCS_C = parser/constr.c \
803 parser/hsparser.tab.c \
805 parser/import_dirlist.c \
815 parser/type2context.c \
818 HSP_OBJS_O = parser/constr.o \
825 parser/hsparser.tab.o \
827 parser/import_dirlist.o \
837 parser/type2context.o \
840 /* this is for etags */
841 REAL_HSP_SRCS_C = parser/main.c \
847 parser/type2context.c \
848 parser/import_dirlist.c \
852 UgenNeededHere(all depend)
854 /* Most hsp files are in libhsp.a, so we can either make
855 a standalone parser, or incorporate the files into
856 the hsc compiler directly (WDP 94/10)
858 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
860 /* We need the hsp program for hstags to work! */
861 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
863 #if DoInstallGHCSystem == YES
864 MakeDirectories(install, $(INSTLIBDIR_GHC))
865 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
866 #endif /* DoInstall... */
868 YaccRunWithExpectMsg(parser/hsparser,16,0)
870 UgenTarget(parser/constr)
871 UgenTarget(parser/binding)
872 UgenTarget(parser/pbinding)
873 UgenTarget(parser/coresyn)
874 UgenTarget(parser/entidt)
875 UgenTarget(parser/hpragma)
876 UgenTarget(parser/list)
877 UgenTarget(parser/literal)
878 UgenTarget(parser/maybe)
879 UgenTarget(parser/either)
880 UgenTarget(parser/qid)
881 UgenTarget(parser/tree)
882 UgenTarget(parser/ttype)
884 UGENS_C = parser/constr.c \
898 /* Putting the -#include"hspincl.h" option into the
899 PARSER_HS_OPTS line really does not work (it depends
900 on the 'make' that you use).
902 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
904 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
905 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
906 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
907 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
908 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
909 compile(parser/U_coresyn,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
910 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
911 compile(parser/U_hpragma,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
912 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
913 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
914 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
915 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
916 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
917 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
918 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
920 /* finished with local macros */
925 /* *** misc *************************************************** */
927 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
929 #if GhcWithHscBuiltViaC == NO
930 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
931 #else /* booting from .hc */
932 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
933 #endif /* booting from .hc files */
935 #if HaskellCompilerType != HC_USE_HC_FILES
936 /* otherwise, the dependencies jeopardize our .hc files --
937 which are all we have! */
938 HaskellDependTarget( $(DEPSRCS) )
941 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
942 #if GhcWithHscBuiltViaC == YES
943 ExtraStuffToClean( $(ALLHCS) )
945 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
948 HsTagsTarget( $(ALLSRCS_LHS) )
949 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
951 /* count the number of lines in the source files */
953 ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
955 /* accumulate similar info about the sizes of object files */
957 ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)