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
117 #define RENAMERSRCS_HS \
120 #define RENAMERSRCS_LHS \
121 rename/ParseUtils.lhs \
126 rename/RnSource.lhs \
129 rename/RnIfaces.lhs \
133 typecheck/TcHsSyn.lhs \
134 typecheck/GenSpecEtc.lhs \
136 typecheck/TcBinds.lhs \
137 typecheck/TcClassDcl.lhs \
138 typecheck/TcDefaults.lhs \
139 typecheck/TcDeriv.lhs \
140 typecheck/TcExpr.lhs \
141 typecheck/TcGenDeriv.lhs \
142 typecheck/TcGRHSs.lhs \
143 typecheck/TcIfaceSig.lhs \
144 typecheck/TcInstDcls.lhs \
145 typecheck/TcInstUtil.lhs \
146 typecheck/TcMatches.lhs \
147 typecheck/TcModule.lhs \
148 typecheck/TcMonad.lhs \
149 typecheck/TcEnv.lhs \
150 typecheck/TcKind.lhs \
151 typecheck/TcType.lhs \
152 typecheck/TcMonoType.lhs \
153 typecheck/TcPat.lhs \
154 typecheck/TcSimplify.lhs \
155 typecheck/TcTyClsDecls.lhs \
156 typecheck/TcTyDecls.lhs \
157 typecheck/Typecheck.lhs \
161 typecheck/TcPragmas.lhs \
165 deSugar/Desugar.lhs \
167 deSugar/MatchCon.lhs \
168 deSugar/MatchLit.lhs \
169 deSugar/DsBinds.lhs \
170 deSugar/DsCCall.lhs \
172 deSugar/DsGRHSs.lhs \
173 deSugar/DsHsSyn.lhs \
174 deSugar/DsListComp.lhs \
175 deSugar/DsMonad.lhs \
176 deSugar/DsUtils.lhs \
178 coreSyn/CoreLift.lhs \
181 #if GhcWithDeforester != YES
182 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
183 #define DEFORESTER_SRCS_LHS /*none*/
185 #define __omit_deforester_flag /*nope*/
186 #define DEFORESTER_SRCS_LHS \
187 deforest/DefSyn.lhs \
188 deforest/Core2Def.lhs \
189 deforest/Def2Core.lhs \
190 deforest/Deforest.lhs \
191 deforest/DefUtils.lhs \
192 deforest/DefExpr.lhs \
193 deforest/Cyclic.lhs \
194 deforest/TreelessForm.lhs
195 #endif /* GhcWithDeforester */
197 #define SIMPL_SRCS_LHS \
198 coreSyn/AnnCoreSyn.lhs \
199 coreSyn/FreeVars.lhs \
201 specialise/Specialise.lhs \
202 specialise/SpecUtils.lhs \
204 simplCore/SimplCase.lhs \
205 simplCore/SimplEnv.lhs \
206 simplCore/SimplMonad.lhs \
207 simplCore/SimplPgm.lhs \
208 simplCore/SimplUtils.lhs \
209 simplCore/SimplVar.lhs \
210 simplCore/Simplify.lhs \
212 simplCore/LiberateCase.lhs \
214 simplCore/ConFold.lhs \
215 simplCore/FloatIn.lhs \
216 simplCore/FloatOut.lhs \
218 simplCore/SATMonad.lhs \
219 simplCore/SetLevels.lhs \
220 simplCore/SimplCore.lhs \
221 simplCore/OccurAnal.lhs \
222 simplCore/FoldrBuildWW.lhs \
223 simplCore/AnalFBWW.lhs \
225 stranal/StrictAnal.lhs \
227 stranal/SaAbsInt.lhs \
229 stranal/WorkWrap.lhs \
231 profiling/SCCauto.lhs DEFORESTER_SRCS_LHS
233 #define STG_SRCS_LHS \
234 stgSyn/CoreToStg.lhs \
236 stgSyn/StgUtils.lhs \
238 profiling/SCCfinal.lhs \
240 simplStg/SatStgRhs.lhs \
241 simplStg/LambdaLift.lhs \
242 simplStg/StgVarInfo.lhs \
243 simplStg/UpdAnal.lhs \
244 simplStg/StgStats.lhs \
245 simplStg/StgSATMonad.lhs \
246 simplStg/StgSAT.lhs \
247 simplStg/SimplStg.lhs
249 #define BACKSRCS_LHS \
250 absCSyn/AbsCUtils.lhs \
251 absCSyn/AbsCSyn.lhs \
254 absCSyn/HeapOffs.lhs \
255 absCSyn/PprAbsC.lhs \
257 codeGen/CodeGen.lhs \
258 codeGen/ClosureInfo.lhs \
260 codeGen/CgConTbls.lhs \
261 codeGen/CgMonad.lhs \
262 codeGen/CgUsages.lhs \
263 codeGen/CgHeapery.lhs \
264 codeGen/CgStackery.lhs \
267 codeGen/CgLetNoEscape.lhs \
268 codeGen/CgTailCall.lhs \
269 codeGen/CgClosure.lhs \
271 codeGen/CgRetConv.lhs \
272 codeGen/CgBindery.lhs \
275 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
276 /* if building via C, we *assume* that it is the
277 distributed C files, which do not have a native-code
280 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
281 # define NATIVEGEN_SRCS_LHS /*none*/
283 # define __omit_ncg_maybe /*none*/
285 # define NATIVEGEN_SRCS_LHS \
286 nativeGen/AbsCStixGen.lhs \
287 nativeGen/AsmCodeGen.lhs \
288 nativeGen/AsmRegAlloc.lhs \
289 nativeGen/MachCode.lhs \
290 nativeGen/MachMisc.lhs \
291 nativeGen/MachRegs.lhs \
292 nativeGen/PprMach.lhs \
293 nativeGen/RegAllocInfo.lhs \
295 nativeGen/StixInfo.lhs \
296 nativeGen/StixInteger.lhs \
297 nativeGen/StixPrim.lhs \
298 nativeGen/StixMacro.lhs
301 #define UTILSRCS_LHS \
307 utils/FiniteMap.lhs \
308 utils/ListSetOps.lhs \
312 utils/Outputable.lhs \
321 #define MAIN_SRCS_LHS \
323 main/CmdLineOpts.lhs \
331 #define VBASICSRCS_LHS \
332 prelude/PrelMods.lhs \
333 prelude/PrimRep.lhs \
335 prelude/TysPrim.lhs \
336 prelude/TysWiredIn.lhs \
337 prelude/PrelVals.lhs \
338 prelude/PrelInfo.lhs \
340 absCSyn/CStrings.lhs \
341 codeGen/CgCompInfo.lhs \
342 coreSyn/CoreSyn.lhs \
343 coreSyn/CoreUnfold.lhs \
344 coreSyn/CoreUtils.lhs \
345 coreSyn/PprCore.lhs \
346 profiling/CostCentre.lhs \
347 simplCore/BinderInfo.lhs \
348 simplCore/MagicUFs.lhs
350 ALLSRCS_HS = READERSRCS_HS RENAMERSRCS_HS
351 ALLSRCS_LHS = /* all pieces of the compiler */ \
353 NOT_SO_BASICSRCS_LHS \
362 BACKSRCS_LHS NATIVEGEN_SRCS_LHS
367 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
368 need to be on the last line.
371 /* should't use these fancy `make' things, really */
372 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
373 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
374 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
376 .PRECIOUS: $(ALLINTS)
378 #if GhcWithHscDebug == YES
379 # define use_DDEBUG -DDEBUG
381 # define use_DDEBUG /*nothing*/
384 #if GhcWithHscOptimised == YES
385 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
387 #define __version_sensitive_flags -fomit-reexported-instances
390 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
391 #undef AllProjectsHcOpts
392 #define AllProjectsHcOpts /**/
394 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
395 -fomit-derived-read \
396 -I. -i$(SUBDIR_LIST) \
397 use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
399 #undef __version_sensitive_flags
400 #undef __omit_ncg_maybe
401 #undef __omit_deforester_flag
403 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
407 # if HaskellCompilerType == HC_USE_HC_FILES
408 HC = $(GHC) /* uses the driver herein */
411 #endif /* using .hc files */
415 Used when compiling GHC. Some GHC utility modules are
416 *also* part of the GHC library. There are a few bits
417 of those modules that only apply to GHC itself and
418 should not be in the library stuff. We use this
419 CPP thing to isolate those bits.
422 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
424 #if DoInstallGHCSystem == YES
425 MakeDirectories(install, $(INSTLIBDIR_GHC))
426 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
429 /* set up for going either to .hc or to .o files */
430 #if GhcWithHscBuiltViaC == YES
432 /*OLD:SuffixRule_hc_o() */
434 # if HaskellCompilerType == HC_USE_HC_FILES
435 /* if we do not, we never try to compile .lhs files;
436 we *blast* the macro we would normally use (HACK) (WDP 94/12)
439 # undef HaskellCompileWithSpecifiedFlags
440 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
441 module.osuf : module.isuf \
442 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
444 # define compile(module,isuf,extra_flags) \
445 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
447 # define compile_rec(module,isuf,extra_flags) \
448 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
452 # define compile(module,isuf,extra_flags) \
453 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
455 # define compile_rec(module,isuf,extra_flags) \
456 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
458 # endif /* ... == HC_USE_HC_FILES */
460 #else /* ! booting from C */
462 # define compile(module,isuf,extra_flags) \
463 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
465 # define compile_rec(module,isuf,extra_flags) \
466 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
468 #endif /* ! booting from C */
471 #if GhcBuilderVersion >= 26
472 # define if_ghc26(x) x
474 # define if_ghc26(x) /*nothing*/
477 /* OK, here we go: */
479 utils/Ubiq.hi : utils/Ubiq.lhi
480 $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
482 absCSyn/AbsCLoop.hi : absCSyn/AbsCLoop.lhi
483 $(GHC_UNLIT) absCSyn/AbsCLoop.lhi absCSyn/AbsCLoop.hi
484 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
485 $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
486 codeGen/CgLoop1.hi : codeGen/CgLoop1.lhi
487 $(GHC_UNLIT) codeGen/CgLoop1.lhi codeGen/CgLoop1.hi
488 codeGen/CgLoop2.hi : codeGen/CgLoop2.lhi
489 $(GHC_UNLIT) codeGen/CgLoop2.lhi codeGen/CgLoop2.hi
490 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
491 $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
492 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
493 $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
494 nativeGen/NcgLoop.hi : nativeGen/NcgLoop.lhi
495 $(GHC_UNLIT) nativeGen/NcgLoop.lhi nativeGen/NcgLoop.hi
496 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
497 $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
498 rename/RnLoop.hi : rename/RnLoop.lhi
499 $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
500 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
501 $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
502 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
503 $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
504 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
505 $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
506 types/TyLoop.hi : types/TyLoop.lhi
507 $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
509 rename/ParseIface.hs : rename/ParseIface.y
510 $(RM) rename/ParseIface.hs rename/ParseIface.hinfo
511 happy -i rename/ParseIface.hinfo rename/ParseIface.y
512 @chmod 444 rename/ParseIface.hs
514 compile(absCSyn/AbsCUtils,lhs,)
515 compile(absCSyn/CStrings,lhs,)
516 compile(absCSyn/CLabel,lhs,)
517 compile(absCSyn/Costs,lhs,)
518 compile(absCSyn/HeapOffs,lhs,)
519 compile(absCSyn/PprAbsC,lhs,)
520 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
522 compile(hsSyn/HsBinds,lhs,)
523 compile(hsSyn/HsCore,lhs,)
524 compile(hsSyn/HsDecls,lhs,)
525 compile(hsSyn/HsExpr,lhs,)
526 compile(hsSyn/HsImpExp,lhs,)
527 compile(hsSyn/HsLit,lhs,)
528 compile(hsSyn/HsMatches,lhs,)
529 compile(hsSyn/HsPat,lhs,)
530 compile(hsSyn/HsPragmas,lhs,)
531 compile(hsSyn/HsTypes,lhs,)
532 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
534 compile(basicTypes/FieldLabel,lhs,)
535 compile(basicTypes/Id,lhs,)
536 compile(basicTypes/IdInfo,lhs,-K2m)
537 compile(basicTypes/IdUtils,lhs,)
538 compile(basicTypes/Literal,lhs,)
539 compile(basicTypes/Name,lhs,)
540 compile(basicTypes/PprEnv,lhs,)
541 compile(basicTypes/PragmaInfo,lhs,)
542 compile(basicTypes/SrcLoc,lhs,)
543 compile(basicTypes/UniqSupply,lhs,)
544 compile(basicTypes/Unique,lhs,)
546 compile(codeGen/CgBindery,lhs,)
547 compile(codeGen/CgCase,lhs,)
548 compile(codeGen/CgClosure,lhs,)
549 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
550 compile(codeGen/CgCon,lhs,)
551 compile(codeGen/CgConTbls,lhs,)
552 compile(codeGen/CgExpr,lhs,)
553 compile(codeGen/CgHeapery,lhs,)
554 compile(codeGen/CgLetNoEscape,lhs,)
555 compile(codeGen/CgMonad,lhs,)
556 compile(codeGen/CgRetConv,lhs,)
557 compile(codeGen/CgStackery,lhs,)
558 compile(codeGen/CgTailCall,lhs,)
559 compile(codeGen/CgUpdate,lhs,)
560 compile(codeGen/CgUsages,lhs,)
561 compile(codeGen/ClosureInfo,lhs,)
562 compile(codeGen/CodeGen,lhs,)
563 compile(codeGen/SMRep,lhs,)
565 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
566 compile(coreSyn/CoreUtils,lhs,)
567 compile(coreSyn/CoreLift,lhs,)
568 compile(coreSyn/CoreLint,lhs,)
569 compile(coreSyn/CoreSyn,lhs,)
570 compile(coreSyn/PprCore,lhs,)
571 compile(coreSyn/CoreUnfold,lhs,)
572 compile(coreSyn/FreeVars,lhs,)
574 compile(deSugar/Desugar,lhs,)
575 compile(deSugar/DsBinds,lhs,)
576 compile(deSugar/DsCCall,lhs,)
577 compile(deSugar/DsExpr,lhs,)
578 compile(deSugar/DsGRHSs,lhs,)
579 compile(deSugar/DsHsSyn,lhs,)
580 compile(deSugar/DsListComp,lhs,)
581 compile(deSugar/DsMonad,lhs,)
582 compile(deSugar/DsUtils,lhs,)
583 compile(deSugar/Match,lhs,)
584 compile(deSugar/MatchCon,lhs,)
585 compile(deSugar/MatchLit,lhs,)
587 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
588 compile(main/ErrUtils,lhs,)
589 compile(main/Main,lhs,if_ghc(-fvia-C))
590 compile(main/MainMonad,lhs,)
591 compile(main/MkIface,lhs,)
593 #if GhcWithNativeCodeGen == YES
594 compile(nativeGen/AbsCStixGen,lhs,)
595 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
596 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
597 compile(nativeGen/MachCode,lhs,-I$(NATIVEGEN_DIR))
598 compile(nativeGen/MachMisc,lhs,-I$(NATIVEGEN_DIR))
599 compile(nativeGen/MachRegs,lhs,-I$(NATIVEGEN_DIR))
600 compile(nativeGen/PprMach,lhs,-I$(NATIVEGEN_DIR))
601 compile(nativeGen/RegAllocInfo,lhs,-I$(NATIVEGEN_DIR))
602 compile(nativeGen/Stix,lhs,)
603 compile(nativeGen/StixInfo,lhs,)
604 compile(nativeGen/StixInteger,lhs,)
605 compile(nativeGen/StixMacro,lhs,)
606 compile(nativeGen/StixPrim,lhs,)
609 compile(prelude/PrelInfo,lhs,)
610 compile(prelude/PrelMods,lhs,)
611 compile(prelude/PrelVals,lhs,)
612 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
613 compile(prelude/PrimOp,lhs,-K3m -H10m)
614 compile(prelude/TysPrim,lhs,)
615 compile(prelude/TysWiredIn,lhs,)
617 compile(profiling/SCCauto,lhs,)
618 compile(profiling/SCCfinal,lhs,)
619 compile(profiling/CostCentre,lhs,)
621 compile(reader/PrefixSyn,lhs,)
622 compile(reader/PrefixToHs,lhs,)
623 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
624 compile(reader/RdrHsSyn,lhs,)
626 compile(rename/ParseIface,hs,)
627 compile(rename/ParseUtils,lhs,)
628 compile(rename/RnHsSyn,lhs,)
629 compile(rename/RnMonad,lhs,)
630 compile(rename/Rename,lhs,)
631 compile(rename/RnNames,lhs,)
632 compile(rename/RnSource,lhs,)
633 compile(rename/RnBinds,lhs,)
634 compile(rename/RnExpr,lhs,)
635 compile(rename/RnIfaces,lhs,)
636 compile(rename/RnUtils,lhs,)
638 compile(simplCore/BinderInfo,lhs,)
639 compile(simplCore/ConFold,lhs,)
640 compile(simplCore/FloatIn,lhs,)
641 compile(simplCore/FloatOut,lhs,)
642 compile(simplCore/LiberateCase,lhs,)
643 compile(simplCore/MagicUFs,lhs,)
644 compile(simplCore/OccurAnal,lhs,)
646 compile(simplCore/AnalFBWW,lhs,)
647 compile(simplCore/FoldrBuildWW,lhs,)
649 compile(simplCore/SAT,lhs,)
650 compile(simplCore/SATMonad,lhs,)
651 compile(simplCore/SetLevels,lhs,)
652 compile(simplCore/SimplCase,lhs,)
653 compile(simplCore/SimplCore,lhs,)
654 compile(simplCore/SimplEnv,lhs,)
655 compile(simplCore/SimplMonad,lhs,)
656 compile(simplCore/SimplPgm,lhs,)
657 compile(simplCore/SimplUtils,lhs,)
658 compile(simplCore/SimplVar,lhs,)
659 compile(simplCore/Simplify,lhs,)
661 compile(simplStg/SatStgRhs,lhs,)
662 compile(simplStg/LambdaLift,lhs,)
663 compile(simplStg/StgVarInfo,lhs,)
664 compile(simplStg/UpdAnal,lhs,)
665 compile(simplStg/StgStats,lhs,)
666 compile(simplStg/StgSATMonad,lhs,)
667 compile(simplStg/StgSAT,lhs,)
668 compile(simplStg/SimplStg,lhs,)
670 #if GhcWithDeforester == YES
671 compile(deforest/Core2Def,lhs,)
672 compile(deforest/Cyclic,lhs,)
673 compile(deforest/Def2Core,lhs,)
674 compile(deforest/DefExpr,lhs,)
675 compile(deforest/DefSyn,lhs,)
676 compile(deforest/DefUtils,lhs,)
677 compile(deforest/Deforest,lhs,)
678 compile(deforest/TreelessForm,lhs,)
681 compile(specialise/Specialise,lhs,)
682 compile(specialise/SpecEnv,lhs,)
683 compile(specialise/SpecUtils,lhs,)
685 compile(stgSyn/CoreToStg,lhs,)
686 compile(stgSyn/StgUtils,lhs,)
687 compile(stgSyn/StgLint,lhs,)
688 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
690 compile(stranal/SaAbsInt,lhs,)
691 compile(stranal/SaLib,lhs,)
692 compile(stranal/StrictAnal,lhs,)
693 compile(stranal/WorkWrap,lhs,)
694 compile(stranal/WwLib,lhs,)
696 compile(typecheck/GenSpecEtc,lhs,)
697 compile(typecheck/Inst,lhs,)
698 compile(typecheck/TcHsSyn,lhs,)
699 compile(typecheck/TcBinds,lhs,)
700 compile(typecheck/TcClassDcl,lhs,)
701 compile(typecheck/TcDefaults,lhs,)
702 compile(typecheck/TcDeriv,lhs,)
703 compile(typecheck/TcExpr,lhs,)
704 compile(typecheck/TcGRHSs,lhs,)
705 compile(typecheck/TcGenDeriv,lhs,)
706 compile(typecheck/TcIfaceSig,lhs,)
707 compile(typecheck/TcInstDcls,lhs,)
708 compile(typecheck/TcInstUtil,lhs,)
709 compile(typecheck/TcMatches,lhs,)
710 compile(typecheck/TcModule,lhs,)
711 compile(typecheck/TcMonad,lhs,)
712 compile(typecheck/TcKind,lhs,)
713 compile(typecheck/TcType,lhs,)
714 compile(typecheck/TcEnv,lhs,)
715 compile(typecheck/TcMonoType,lhs,)
716 compile(typecheck/TcPat,lhs,)
717 compile(typecheck/TcPragmas,lhs,)
718 compile(typecheck/TcSimplify,lhs,)
719 compile(typecheck/TcTyClsDecls,lhs,)
720 compile(typecheck/TcTyDecls,lhs,)
721 compile(typecheck/Typecheck,lhs,)
722 compile(typecheck/Unify,lhs,)
724 compile(types/Class,lhs,)
725 compile(types/Kind,lhs,)
726 compile(types/PprType,lhs,)
727 compile(types/TyCon,lhs,)
728 compile(types/TyVar,lhs,)
729 compile(types/Usage,lhs,)
730 compile(types/Type,lhs,)
732 compile(utils/Argv,lhs,if_ghc(-fvia-C))
733 compile(utils/Bag,lhs,)
734 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
735 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
736 compile(utils/Digraph,lhs,)
737 compile(utils/FiniteMap,lhs,)
738 compile(utils/ListSetOps,lhs,)
739 compile(utils/Maybes,lhs,)
740 compile(utils/OrdList,lhs,)
741 compile(utils/Outputable,lhs,)
742 compile(utils/PprStyle,lhs,)
743 compile(utils/Pretty,lhs,)
744 compile(utils/SST,lhs,if_ghc(-fvia-C))
745 compile(utils/UniqFM,lhs,)
746 compile(utils/UniqSet,lhs,)
747 compile(utils/Unpretty,lhs,)
748 compile(utils/MatchEnv,lhs,)
749 compile(utils/Util,lhs,)
751 /* for convenience in cross-compiling */
754 /* *** parser ************************************************* */
757 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
759 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
761 XCOMM D_DEBUG = -DDEBUG
763 CPP_DEFINES = $(D_DEBUG)
765 HSP_SRCS_C = parser/constr.c \
770 parser/hsparser.tab.c \
781 parser/type2context.c \
784 HSP_OBJS_O = parser/constr.o \
789 parser/hsparser.tab.o \
800 parser/type2context.o \
803 /* this is for etags */
804 REAL_HSP_SRCS_C = parser/main.c \
810 parser/type2context.c \
814 UgenNeededHere(all depend)
816 /* Most hsp files are in libhsp.a, so we can either make
817 a standalone parser, or incorporate the files into
818 the hsc compiler directly (WDP 94/10)
820 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
822 /* We need the hsp program for hstags to work! */
823 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
825 #if DoInstallGHCSystem == YES
826 MakeDirectories(install, $(INSTLIBDIR_GHC))
827 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
828 #endif /* DoInstall... */
830 YaccRunWithExpectMsg(parser/hsparser,14,0)
832 UgenTarget(parser/constr)
833 UgenTarget(parser/binding)
834 UgenTarget(parser/pbinding)
835 UgenTarget(parser/entidt)
836 UgenTarget(parser/list)
837 UgenTarget(parser/literal)
838 UgenTarget(parser/maybe)
839 UgenTarget(parser/either)
840 UgenTarget(parser/qid)
841 UgenTarget(parser/tree)
842 UgenTarget(parser/ttype)
844 UGENS_C = parser/constr.c \
856 /* Putting the -#include"hspincl.h" option into the
857 PARSER_HS_OPTS line really does not work (it depends
858 on the 'make' that you use).
860 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
862 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
863 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
864 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
865 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
866 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
867 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
868 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
869 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
870 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
871 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
872 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
873 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
874 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
876 /* finished with local macros */
881 /* *** misc *************************************************** */
883 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
885 #if GhcWithHscBuiltViaC == NO
886 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
887 #else /* booting from .hc */
888 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
889 #endif /* booting from .hc files */
891 #if HaskellCompilerType != HC_USE_HC_FILES
892 /* otherwise, the dependencies jeopardize our .hc files --
893 which are all we have! */
894 HaskellDependTarget( $(DEPSRCS) )
897 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
898 #if GhcWithHscBuiltViaC == YES
899 ExtraStuffToClean( $(ALLHCS) )
901 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
904 HsTagsTarget( $(ALLSRCS_LHS) )
905 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
907 /* count the number of lines in the source files */
909 ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
911 /* accumulate similar info about the sizes of object files */
913 ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)