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 \
160 typecheck/TcPragmas.lhs \
164 deSugar/Desugar.lhs \
166 deSugar/MatchCon.lhs \
167 deSugar/MatchLit.lhs \
168 deSugar/DsBinds.lhs \
169 deSugar/DsCCall.lhs \
171 deSugar/DsGRHSs.lhs \
172 deSugar/DsHsSyn.lhs \
173 deSugar/DsListComp.lhs \
174 deSugar/DsMonad.lhs \
175 deSugar/DsUtils.lhs \
177 coreSyn/CoreLift.lhs \
180 #if GhcWithDeforester != YES
181 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
182 #define DEFORESTER_SRCS_LHS /*none*/
184 #define __omit_deforester_flag /*nope*/
185 #define DEFORESTER_SRCS_LHS \
186 deforest/DefSyn.lhs \
187 deforest/Core2Def.lhs \
188 deforest/Def2Core.lhs \
189 deforest/Deforest.lhs \
190 deforest/DefUtils.lhs \
191 deforest/DefExpr.lhs \
192 deforest/Cyclic.lhs \
193 deforest/TreelessForm.lhs
194 #endif /* GhcWithDeforester */
196 #define SIMPL_SRCS_LHS \
197 coreSyn/AnnCoreSyn.lhs \
198 coreSyn/FreeVars.lhs \
200 specialise/Specialise.lhs \
201 specialise/SpecUtils.lhs \
203 simplCore/SimplCase.lhs \
204 simplCore/SimplEnv.lhs \
205 simplCore/SimplMonad.lhs \
206 simplCore/SimplPgm.lhs \
207 simplCore/SimplUtils.lhs \
208 simplCore/SimplVar.lhs \
209 simplCore/Simplify.lhs \
211 simplCore/LiberateCase.lhs \
213 simplCore/ConFold.lhs \
214 simplCore/FloatIn.lhs \
215 simplCore/FloatOut.lhs \
217 simplCore/SATMonad.lhs \
218 simplCore/SetLevels.lhs \
219 simplCore/SimplCore.lhs \
220 simplCore/OccurAnal.lhs \
221 simplCore/FoldrBuildWW.lhs \
222 simplCore/AnalFBWW.lhs \
224 stranal/StrictAnal.lhs \
226 stranal/SaAbsInt.lhs \
228 stranal/WorkWrap.lhs \
230 profiling/SCCauto.lhs DEFORESTER_SRCS_LHS
232 #define STG_SRCS_LHS \
233 stgSyn/CoreToStg.lhs \
235 stgSyn/StgUtils.lhs \
237 profiling/SCCfinal.lhs \
239 simplStg/SatStgRhs.lhs \
240 simplStg/LambdaLift.lhs \
241 simplStg/StgVarInfo.lhs \
242 simplStg/UpdAnal.lhs \
243 simplStg/StgStats.lhs \
244 simplStg/StgSATMonad.lhs \
245 simplStg/StgSAT.lhs \
246 simplStg/SimplStg.lhs
248 #define BACKSRCS_LHS \
249 absCSyn/AbsCUtils.lhs \
250 absCSyn/AbsCSyn.lhs \
253 absCSyn/HeapOffs.lhs \
254 absCSyn/PprAbsC.lhs \
256 codeGen/CodeGen.lhs \
257 codeGen/ClosureInfo.lhs \
259 codeGen/CgConTbls.lhs \
260 codeGen/CgMonad.lhs \
261 codeGen/CgUsages.lhs \
262 codeGen/CgHeapery.lhs \
263 codeGen/CgStackery.lhs \
266 codeGen/CgLetNoEscape.lhs \
267 codeGen/CgTailCall.lhs \
268 codeGen/CgClosure.lhs \
270 codeGen/CgRetConv.lhs \
271 codeGen/CgBindery.lhs \
274 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
275 /* if building via C, we *assume* that it is the
276 distributed C files, which do not have a native-code
279 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
280 # define NATIVEGEN_SRCS_LHS /*none*/
282 # define __omit_ncg_maybe /*none*/
284 # define NATIVEGEN_SRCS_LHS \
285 nativeGen/AbsCStixGen.lhs \
286 nativeGen/AsmCodeGen.lhs \
287 nativeGen/AsmRegAlloc.lhs \
288 nativeGen/MachCode.lhs \
289 nativeGen/MachMisc.lhs \
290 nativeGen/MachRegs.lhs \
291 nativeGen/PprMach.lhs \
292 nativeGen/RegAllocInfo.lhs \
294 nativeGen/StixInfo.lhs \
295 nativeGen/StixInteger.lhs \
296 nativeGen/StixPrim.lhs \
297 nativeGen/StixMacro.lhs
300 #define UTILSRCS_LHS \
306 utils/FiniteMap.lhs \
307 utils/ListSetOps.lhs \
311 utils/Outputable.lhs \
320 #define MAIN_SRCS_LHS \
321 main/CmdLineOpts.lhs \
326 #define VBASICSRCS_LHS \
327 prelude/PrelMods.lhs \
328 prelude/PrimRep.lhs \
330 prelude/TysPrim.lhs \
331 prelude/TysWiredIn.lhs \
332 prelude/PrelVals.lhs \
333 prelude/PrelInfo.lhs \
335 absCSyn/CStrings.lhs \
336 codeGen/CgCompInfo.lhs \
337 coreSyn/CoreSyn.lhs \
338 coreSyn/CoreUnfold.lhs \
339 coreSyn/CoreUtils.lhs \
340 coreSyn/PprCore.lhs \
341 profiling/CostCentre.lhs \
342 simplCore/BinderInfo.lhs \
343 simplCore/MagicUFs.lhs
345 ALLSRCS_HS = READERSRCS_HS RENAMERSRCS_HS
346 ALLSRCS_LHS = /* all pieces of the compiler */ \
348 NOT_SO_BASICSRCS_LHS \
357 BACKSRCS_LHS NATIVEGEN_SRCS_LHS
362 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
363 need to be on the last line.
366 /* should't use these fancy `make' things, really */
367 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
368 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
369 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
371 .PRECIOUS: $(ALLINTS)
373 #if GhcWithHscDebug == YES
374 # define use_DDEBUG -DDEBUG
376 # define use_DDEBUG /*nothing*/
379 #if GhcWithHscOptimised == YES
380 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
382 #define __version_sensitive_flags -fomit-reexported-instances
385 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
386 #undef AllProjectsHcOpts
387 #define AllProjectsHcOpts /**/
389 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
390 -fomit-derived-read \
391 -I. -i$(SUBDIR_LIST) \
392 use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
394 #undef __version_sensitive_flags
395 #undef __omit_ncg_maybe
396 #undef __omit_deforester_flag
398 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
402 # if HaskellCompilerType == HC_USE_HC_FILES
403 HC = $(GHC) /* uses the driver herein */
406 #endif /* using .hc files */
410 Used when compiling GHC. Some GHC utility modules are
411 *also* part of the GHC library. There are a few bits
412 of those modules that only apply to GHC itself and
413 should not be in the library stuff. We use this
414 CPP thing to isolate those bits.
417 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
419 #if DoInstallGHCSystem == YES
420 MakeDirectories(install, $(INSTLIBDIR_GHC))
421 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
424 /* set up for going either to .hc or to .o files */
425 #if GhcWithHscBuiltViaC == YES
427 /*OLD:SuffixRule_hc_o() */
429 # if HaskellCompilerType == HC_USE_HC_FILES
430 /* if we do not, we never try to compile .lhs files;
431 we *blast* the macro we would normally use (HACK) (WDP 94/12)
434 # undef HaskellCompileWithSpecifiedFlags
435 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
436 module.osuf : module.isuf \
437 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
439 # define compile(module,isuf,extra_flags) \
440 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
442 # define compile_rec(module,isuf,extra_flags) \
443 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
447 # define compile(module,isuf,extra_flags) \
448 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
450 # define compile_rec(module,isuf,extra_flags) \
451 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
453 # endif /* ... == HC_USE_HC_FILES */
455 #else /* ! booting from C */
457 # define compile(module,isuf,extra_flags) \
458 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
460 # define compile_rec(module,isuf,extra_flags) \
461 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
463 #endif /* ! booting from C */
466 #if GhcBuilderVersion >= 26
467 # define if_ghc26(x) x
469 # define if_ghc26(x) /*nothing*/
472 /* OK, here we go: */
474 utils/Ubiq.hi : utils/Ubiq.lhi
475 $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
477 absCSyn/AbsCLoop.hi : absCSyn/AbsCLoop.lhi
478 $(GHC_UNLIT) absCSyn/AbsCLoop.lhi absCSyn/AbsCLoop.hi
479 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
480 $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
481 codeGen/CgLoop1.hi : codeGen/CgLoop1.lhi
482 $(GHC_UNLIT) codeGen/CgLoop1.lhi codeGen/CgLoop1.hi
483 codeGen/CgLoop2.hi : codeGen/CgLoop2.lhi
484 $(GHC_UNLIT) codeGen/CgLoop2.lhi codeGen/CgLoop2.hi
485 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
486 $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
487 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
488 $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
489 nativeGen/NcgLoop.hi : nativeGen/NcgLoop.lhi
490 $(GHC_UNLIT) nativeGen/NcgLoop.lhi nativeGen/NcgLoop.hi
491 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
492 $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
493 rename/RnLoop.hi : rename/RnLoop.lhi
494 $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
495 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
496 $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
497 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
498 $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
499 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
500 $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
501 types/TyLoop.hi : types/TyLoop.lhi
502 $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
504 rename/ParseIface.hs : rename/ParseIface.y
505 $(RM) rename/ParseIface.hs rename/ParseIface.hinfo
506 happy -g -i rename/ParseIface.hinfo rename/ParseIface.y
507 @chmod 444 rename/ParseIface.hs
509 compile(absCSyn/AbsCUtils,lhs,)
510 compile(absCSyn/CStrings,lhs,)
511 compile(absCSyn/CLabel,lhs,)
512 compile(absCSyn/Costs,lhs,)
513 compile(absCSyn/HeapOffs,lhs,)
514 compile(absCSyn/PprAbsC,lhs,)
515 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
517 compile(hsSyn/HsBinds,lhs,)
518 compile(hsSyn/HsCore,lhs,)
519 compile(hsSyn/HsDecls,lhs,)
520 compile(hsSyn/HsExpr,lhs,)
521 compile(hsSyn/HsImpExp,lhs,)
522 compile(hsSyn/HsLit,lhs,)
523 compile(hsSyn/HsMatches,lhs,)
524 compile(hsSyn/HsPat,lhs,)
525 compile(hsSyn/HsPragmas,lhs,)
526 compile(hsSyn/HsTypes,lhs,)
527 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
529 compile(basicTypes/FieldLabel,lhs,)
530 compile(basicTypes/Id,lhs,)
531 compile(basicTypes/IdInfo,lhs,-K2m)
532 compile(basicTypes/IdUtils,lhs,)
533 compile(basicTypes/Literal,lhs,)
534 compile(basicTypes/Name,lhs,)
535 compile(basicTypes/PprEnv,lhs,)
536 compile(basicTypes/PragmaInfo,lhs,)
537 compile(basicTypes/SrcLoc,lhs,)
538 compile(basicTypes/UniqSupply,lhs,)
539 compile(basicTypes/Unique,lhs,)
541 compile(codeGen/CgBindery,lhs,)
542 compile(codeGen/CgCase,lhs,)
543 compile(codeGen/CgClosure,lhs,)
544 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
545 compile(codeGen/CgCon,lhs,)
546 compile(codeGen/CgConTbls,lhs,)
547 compile(codeGen/CgExpr,lhs,)
548 compile(codeGen/CgHeapery,lhs,)
549 compile(codeGen/CgLetNoEscape,lhs,)
550 compile(codeGen/CgMonad,lhs,)
551 compile(codeGen/CgRetConv,lhs,)
552 compile(codeGen/CgStackery,lhs,)
553 compile(codeGen/CgTailCall,lhs,)
554 compile(codeGen/CgUpdate,lhs,)
555 compile(codeGen/CgUsages,lhs,)
556 compile(codeGen/ClosureInfo,lhs,)
557 compile(codeGen/CodeGen,lhs,)
558 compile(codeGen/SMRep,lhs,)
560 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
561 compile(coreSyn/CoreUtils,lhs,)
562 compile(coreSyn/CoreLift,lhs,)
563 compile(coreSyn/CoreLint,lhs,)
564 compile(coreSyn/CoreSyn,lhs,)
565 compile(coreSyn/PprCore,lhs,)
566 compile(coreSyn/CoreUnfold,lhs,)
567 compile(coreSyn/FreeVars,lhs,)
569 compile(deSugar/Desugar,lhs,)
570 compile(deSugar/DsBinds,lhs,)
571 compile(deSugar/DsCCall,lhs,)
572 compile(deSugar/DsExpr,lhs,)
573 compile(deSugar/DsGRHSs,lhs,)
574 compile(deSugar/DsHsSyn,lhs,)
575 compile(deSugar/DsListComp,lhs,)
576 compile(deSugar/DsMonad,lhs,)
577 compile(deSugar/DsUtils,lhs,)
578 compile(deSugar/Match,lhs,)
579 compile(deSugar/MatchCon,lhs,)
580 compile(deSugar/MatchLit,lhs,)
582 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
583 compile(main/ErrUtils,lhs,)
584 compile(main/Main,lhs,if_ghc(-fvia-C))
585 compile(main/MkIface,lhs,)
587 #if GhcWithNativeCodeGen == YES
588 compile(nativeGen/AbsCStixGen,lhs,)
589 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
590 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
591 compile(nativeGen/MachCode,lhs,-I$(NATIVEGEN_DIR))
592 compile(nativeGen/MachMisc,lhs,-I$(NATIVEGEN_DIR))
593 compile(nativeGen/MachRegs,lhs,-I$(NATIVEGEN_DIR))
594 compile(nativeGen/PprMach,lhs,-I$(NATIVEGEN_DIR))
595 compile(nativeGen/RegAllocInfo,lhs,-I$(NATIVEGEN_DIR))
596 compile(nativeGen/Stix,lhs,)
597 compile(nativeGen/StixInfo,lhs,)
598 compile(nativeGen/StixInteger,lhs,)
599 compile(nativeGen/StixMacro,lhs,)
600 compile(nativeGen/StixPrim,lhs,)
603 compile(prelude/PrelInfo,lhs,)
604 compile(prelude/PrelMods,lhs,)
605 compile(prelude/PrelVals,lhs,)
606 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
607 compile(prelude/PrimOp,lhs,-K3m -H10m)
608 compile(prelude/TysPrim,lhs,)
609 compile(prelude/TysWiredIn,lhs,)
611 compile(profiling/SCCauto,lhs,)
612 compile(profiling/SCCfinal,lhs,)
613 compile(profiling/CostCentre,lhs,)
615 compile(reader/PrefixSyn,lhs,)
616 compile(reader/PrefixToHs,lhs,)
617 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
618 compile(reader/RdrHsSyn,lhs,)
620 compile(rename/ParseIface,hs,)
621 compile(rename/ParseUtils,lhs,)
622 compile(rename/RnHsSyn,lhs,)
623 compile(rename/RnMonad,lhs,)
624 compile(rename/Rename,lhs,)
625 compile(rename/RnNames,lhs,)
626 compile(rename/RnSource,lhs,)
627 compile(rename/RnBinds,lhs,)
628 compile(rename/RnExpr,lhs,)
629 compile(rename/RnIfaces,lhs,)
630 compile(rename/RnUtils,lhs,)
632 compile(simplCore/BinderInfo,lhs,)
633 compile(simplCore/ConFold,lhs,)
634 compile(simplCore/FloatIn,lhs,)
635 compile(simplCore/FloatOut,lhs,)
636 compile(simplCore/LiberateCase,lhs,)
637 compile(simplCore/MagicUFs,lhs,)
638 compile(simplCore/OccurAnal,lhs,)
640 compile(simplCore/AnalFBWW,lhs,)
641 compile(simplCore/FoldrBuildWW,lhs,)
643 compile(simplCore/SAT,lhs,)
644 compile(simplCore/SATMonad,lhs,)
645 compile(simplCore/SetLevels,lhs,)
646 compile(simplCore/SimplCase,lhs,)
647 compile(simplCore/SimplCore,lhs,)
648 compile(simplCore/SimplEnv,lhs,)
649 compile(simplCore/SimplMonad,lhs,)
650 compile(simplCore/SimplPgm,lhs,)
651 compile(simplCore/SimplUtils,lhs,)
652 compile(simplCore/SimplVar,lhs,)
653 compile(simplCore/Simplify,lhs,)
655 compile(simplStg/SatStgRhs,lhs,)
656 compile(simplStg/LambdaLift,lhs,)
657 compile(simplStg/StgVarInfo,lhs,)
658 compile(simplStg/UpdAnal,lhs,)
659 compile(simplStg/StgStats,lhs,)
660 compile(simplStg/StgSATMonad,lhs,)
661 compile(simplStg/StgSAT,lhs,)
662 compile(simplStg/SimplStg,lhs,)
664 #if GhcWithDeforester == YES
665 compile(deforest/Core2Def,lhs,)
666 compile(deforest/Cyclic,lhs,)
667 compile(deforest/Def2Core,lhs,)
668 compile(deforest/DefExpr,lhs,)
669 compile(deforest/DefSyn,lhs,)
670 compile(deforest/DefUtils,lhs,)
671 compile(deforest/Deforest,lhs,)
672 compile(deforest/TreelessForm,lhs,)
675 compile(specialise/Specialise,lhs,)
676 compile(specialise/SpecEnv,lhs,)
677 compile(specialise/SpecUtils,lhs,)
679 compile(stgSyn/CoreToStg,lhs,)
680 compile(stgSyn/StgUtils,lhs,)
681 compile(stgSyn/StgLint,lhs,)
682 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
684 compile(stranal/SaAbsInt,lhs,)
685 compile(stranal/SaLib,lhs,)
686 compile(stranal/StrictAnal,lhs,)
687 compile(stranal/WorkWrap,lhs,)
688 compile(stranal/WwLib,lhs,)
690 compile(typecheck/GenSpecEtc,lhs,)
691 compile(typecheck/Inst,lhs,)
692 compile(typecheck/TcHsSyn,lhs,)
693 compile(typecheck/TcBinds,lhs,)
694 compile(typecheck/TcClassDcl,lhs,)
695 compile(typecheck/TcDefaults,lhs,)
696 compile(typecheck/TcDeriv,lhs,)
697 compile(typecheck/TcExpr,lhs,)
698 compile(typecheck/TcGRHSs,lhs,)
699 compile(typecheck/TcGenDeriv,lhs,)
700 compile(typecheck/TcIfaceSig,lhs,)
701 compile(typecheck/TcInstDcls,lhs,)
702 compile(typecheck/TcInstUtil,lhs,)
703 compile(typecheck/TcMatches,lhs,)
704 compile(typecheck/TcModule,lhs,)
705 compile(typecheck/TcMonad,lhs,)
706 compile(typecheck/TcKind,lhs,)
707 compile(typecheck/TcType,lhs,)
708 compile(typecheck/TcEnv,lhs,)
709 compile(typecheck/TcMonoType,lhs,)
710 compile(typecheck/TcPat,lhs,)
711 compile(typecheck/TcPragmas,lhs,)
712 compile(typecheck/TcSimplify,lhs,)
713 compile(typecheck/TcTyClsDecls,lhs,)
714 compile(typecheck/TcTyDecls,lhs,)
715 compile(typecheck/Unify,lhs,)
717 compile(types/Class,lhs,)
718 compile(types/Kind,lhs,)
719 compile(types/PprType,lhs,)
720 compile(types/TyCon,lhs,)
721 compile(types/TyVar,lhs,)
722 compile(types/Usage,lhs,)
723 compile(types/Type,lhs,)
725 compile(utils/Argv,lhs,if_ghc(-fvia-C))
726 compile(utils/Bag,lhs,)
727 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
728 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
729 compile(utils/Digraph,lhs,)
730 compile(utils/FiniteMap,lhs,)
731 compile(utils/ListSetOps,lhs,)
732 compile(utils/Maybes,lhs,)
733 compile(utils/OrdList,lhs,)
734 compile(utils/Outputable,lhs,)
735 compile(utils/PprStyle,lhs,)
736 compile(utils/Pretty,lhs,)
737 compile(utils/SST,lhs,if_ghc(-fvia-C))
738 compile(utils/UniqFM,lhs,)
739 compile(utils/UniqSet,lhs,)
740 compile(utils/Unpretty,lhs,)
741 compile(utils/MatchEnv,lhs,)
742 compile(utils/Util,lhs,)
744 /* for convenience in cross-compiling */
747 /* *** parser ************************************************* */
750 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
752 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
754 XCOMM D_DEBUG = -DDEBUG
756 CPP_DEFINES = $(D_DEBUG)
758 HSP_SRCS_C = parser/constr.c \
763 parser/hsparser.tab.c \
774 parser/type2context.c \
777 HSP_OBJS_O = parser/constr.o \
782 parser/hsparser.tab.o \
793 parser/type2context.o \
796 /* this is for etags */
797 REAL_HSP_SRCS_C = parser/main.c \
803 parser/type2context.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)