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 \
125 rename/RnSource.lhs \
128 rename/RnIfaces.lhs \
132 typecheck/TcHsSyn.lhs \
133 typecheck/GenSpecEtc.lhs \
135 typecheck/TcBinds.lhs \
136 typecheck/TcClassDcl.lhs \
137 typecheck/TcDefaults.lhs \
138 typecheck/TcDeriv.lhs \
139 typecheck/TcExpr.lhs \
140 typecheck/TcGenDeriv.lhs \
141 typecheck/TcGRHSs.lhs \
142 typecheck/TcIfaceSig.lhs \
143 typecheck/TcInstDcls.lhs \
144 typecheck/TcInstUtil.lhs \
145 typecheck/TcMatches.lhs \
146 typecheck/TcModule.lhs \
147 typecheck/TcMonad.lhs \
148 typecheck/TcEnv.lhs \
149 typecheck/TcKind.lhs \
150 typecheck/TcType.lhs \
151 typecheck/TcMonoType.lhs \
152 typecheck/TcPat.lhs \
153 typecheck/TcSimplify.lhs \
154 typecheck/TcTyClsDecls.lhs \
155 typecheck/TcTyDecls.lhs \
156 typecheck/Typecheck.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 \
322 main/CmdLineOpts.lhs \
330 #define VBASICSRCS_LHS \
331 prelude/PrelMods.lhs \
332 prelude/PrimRep.lhs \
334 prelude/TysPrim.lhs \
335 prelude/TysWiredIn.lhs \
336 prelude/PrelVals.lhs \
337 prelude/PrelInfo.lhs \
339 absCSyn/CStrings.lhs \
340 codeGen/CgCompInfo.lhs \
341 coreSyn/CoreSyn.lhs \
342 coreSyn/CoreUnfold.lhs \
343 coreSyn/CoreUtils.lhs \
344 coreSyn/PprCore.lhs \
345 profiling/CostCentre.lhs \
346 simplCore/BinderInfo.lhs \
347 simplCore/MagicUFs.lhs
349 ALLSRCS_HS = READERSRCS_HS RENAMERSRCS_HS
350 ALLSRCS_LHS = /* all pieces of the compiler */ \
352 NOT_SO_BASICSRCS_LHS \
361 BACKSRCS_LHS NATIVEGEN_SRCS_LHS
366 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
367 need to be on the last line.
370 /* should't use these fancy `make' things, really */
371 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
372 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
373 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
375 .PRECIOUS: $(ALLINTS)
377 #if GhcWithHscDebug == YES
378 # define use_DDEBUG -DDEBUG
380 # define use_DDEBUG /*nothing*/
383 #if GhcWithHscOptimised == YES
384 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
386 #define __version_sensitive_flags -fomit-reexported-instances
389 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
390 #undef AllProjectsHcOpts
391 #define AllProjectsHcOpts /**/
393 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
394 -fomit-derived-read \
395 -I. -i$(SUBDIR_LIST) \
396 use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
398 #undef __version_sensitive_flags
399 #undef __omit_ncg_maybe
400 #undef __omit_deforester_flag
402 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
406 # if HaskellCompilerType == HC_USE_HC_FILES
407 HC = $(GHC) /* uses the driver herein */
410 #endif /* using .hc files */
414 Used when compiling GHC. Some GHC utility modules are
415 *also* part of the GHC library. There are a few bits
416 of those modules that only apply to GHC itself and
417 should not be in the library stuff. We use this
418 CPP thing to isolate those bits.
421 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
423 #if DoInstallGHCSystem == YES
424 MakeDirectories(install, $(INSTLIBDIR_GHC))
425 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
428 /* set up for going either to .hc or to .o files */
429 #if GhcWithHscBuiltViaC == YES
431 /*OLD:SuffixRule_hc_o() */
433 # if HaskellCompilerType == HC_USE_HC_FILES
434 /* if we do not, we never try to compile .lhs files;
435 we *blast* the macro we would normally use (HACK) (WDP 94/12)
438 # undef HaskellCompileWithSpecifiedFlags
439 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
440 module.osuf : module.isuf \
441 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
443 # define compile(module,isuf,extra_flags) \
444 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
446 # define compile_rec(module,isuf,extra_flags) \
447 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
451 # define compile(module,isuf,extra_flags) \
452 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
454 # define compile_rec(module,isuf,extra_flags) \
455 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
457 # endif /* ... == HC_USE_HC_FILES */
459 #else /* ! booting from C */
461 # define compile(module,isuf,extra_flags) \
462 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
464 # define compile_rec(module,isuf,extra_flags) \
465 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
467 #endif /* ! booting from C */
470 #if GhcBuilderVersion >= 26
471 # define if_ghc26(x) x
473 # define if_ghc26(x) /*nothing*/
476 /* OK, here we go: */
478 utils/Ubiq.hi : utils/Ubiq.lhi
479 $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
481 absCSyn/AbsCLoop.hi : absCSyn/AbsCLoop.lhi
482 $(GHC_UNLIT) absCSyn/AbsCLoop.lhi absCSyn/AbsCLoop.hi
483 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
484 $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
485 codeGen/CgLoop1.hi : codeGen/CgLoop1.lhi
486 $(GHC_UNLIT) codeGen/CgLoop1.lhi codeGen/CgLoop1.hi
487 codeGen/CgLoop2.hi : codeGen/CgLoop2.lhi
488 $(GHC_UNLIT) codeGen/CgLoop2.lhi codeGen/CgLoop2.hi
489 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
490 $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
491 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
492 $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
493 nativeGen/NcgLoop.hi : nativeGen/NcgLoop.lhi
494 $(GHC_UNLIT) nativeGen/NcgLoop.lhi nativeGen/NcgLoop.hi
495 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
496 $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
497 rename/RnLoop.hi : rename/RnLoop.lhi
498 $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
499 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
500 $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
501 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
502 $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
503 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
504 $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
505 types/TyLoop.hi : types/TyLoop.lhi
506 $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
508 rename/ParseIface.hs : rename/ParseIface.y
509 $(RM) rename/ParseIface.hs
510 happy -g rename/ParseIface.y
512 compile(absCSyn/AbsCUtils,lhs,)
513 compile(absCSyn/CStrings,lhs,)
514 compile(absCSyn/CLabel,lhs,)
515 compile(absCSyn/Costs,lhs,)
516 compile(absCSyn/HeapOffs,lhs,)
517 compile(absCSyn/PprAbsC,lhs,)
518 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
520 compile(hsSyn/HsBinds,lhs,)
521 compile(hsSyn/HsCore,lhs,)
522 compile(hsSyn/HsDecls,lhs,)
523 compile(hsSyn/HsExpr,lhs,)
524 compile(hsSyn/HsImpExp,lhs,)
525 compile(hsSyn/HsLit,lhs,)
526 compile(hsSyn/HsMatches,lhs,)
527 compile(hsSyn/HsPat,lhs,)
528 compile(hsSyn/HsPragmas,lhs,)
529 compile(hsSyn/HsTypes,lhs,)
530 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
532 compile(basicTypes/FieldLabel,lhs,)
533 compile(basicTypes/Id,lhs,)
534 compile(basicTypes/IdInfo,lhs,-K2m)
535 compile(basicTypes/IdUtils,lhs,)
536 compile(basicTypes/Literal,lhs,)
537 compile(basicTypes/Name,lhs,)
538 compile(basicTypes/PprEnv,lhs,)
539 compile(basicTypes/PragmaInfo,lhs,)
540 compile(basicTypes/SrcLoc,lhs,)
541 compile(basicTypes/UniqSupply,lhs,)
542 compile(basicTypes/Unique,lhs,)
544 compile(codeGen/CgBindery,lhs,)
545 compile(codeGen/CgCase,lhs,)
546 compile(codeGen/CgClosure,lhs,)
547 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
548 compile(codeGen/CgCon,lhs,)
549 compile(codeGen/CgConTbls,lhs,)
550 compile(codeGen/CgExpr,lhs,)
551 compile(codeGen/CgHeapery,lhs,)
552 compile(codeGen/CgLetNoEscape,lhs,)
553 compile(codeGen/CgMonad,lhs,)
554 compile(codeGen/CgRetConv,lhs,)
555 compile(codeGen/CgStackery,lhs,)
556 compile(codeGen/CgTailCall,lhs,)
557 compile(codeGen/CgUpdate,lhs,)
558 compile(codeGen/CgUsages,lhs,)
559 compile(codeGen/ClosureInfo,lhs,)
560 compile(codeGen/CodeGen,lhs,)
561 compile(codeGen/SMRep,lhs,)
563 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
564 compile(coreSyn/CoreUtils,lhs,)
565 compile(coreSyn/CoreLift,lhs,)
566 compile(coreSyn/CoreLint,lhs,)
567 compile(coreSyn/CoreSyn,lhs,)
568 compile(coreSyn/PprCore,lhs,)
569 compile(coreSyn/CoreUnfold,lhs,)
570 compile(coreSyn/FreeVars,lhs,)
572 compile(deSugar/Desugar,lhs,)
573 compile(deSugar/DsBinds,lhs,)
574 compile(deSugar/DsCCall,lhs,)
575 compile(deSugar/DsExpr,lhs,)
576 compile(deSugar/DsGRHSs,lhs,)
577 compile(deSugar/DsHsSyn,lhs,)
578 compile(deSugar/DsListComp,lhs,)
579 compile(deSugar/DsMonad,lhs,)
580 compile(deSugar/DsUtils,lhs,)
581 compile(deSugar/Match,lhs,)
582 compile(deSugar/MatchCon,lhs,)
583 compile(deSugar/MatchLit,lhs,)
585 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
586 compile(main/ErrUtils,lhs,)
587 compile(main/Main,lhs,if_ghc(-fvia-C))
588 compile(main/MainMonad,lhs,)
589 compile(main/MkIface,lhs,)
591 #if GhcWithNativeCodeGen == YES
592 compile(nativeGen/AbsCStixGen,lhs,)
593 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
594 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
595 compile(nativeGen/MachCode,lhs,)
596 compile(nativeGen/MachMisc,lhs,)
597 compile(nativeGen/MachRegs,lhs,)
598 compile(nativeGen/PprMach,lhs,)
599 compile(nativeGen/RegAllocInfo,lhs,)
600 compile(nativeGen/Stix,lhs,)
601 compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
602 compile(nativeGen/StixInteger,lhs,)
603 compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
604 compile(nativeGen/StixPrim,lhs,)
607 compile(prelude/PrelInfo,lhs,)
608 compile(prelude/PrelMods,lhs,)
609 compile(prelude/PrelVals,lhs,)
610 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
611 compile(prelude/PrimOp,lhs,-K3m -H10m)
612 compile(prelude/TysPrim,lhs,)
613 compile(prelude/TysWiredIn,lhs,)
615 compile(profiling/SCCauto,lhs,)
616 compile(profiling/SCCfinal,lhs,)
617 compile(profiling/CostCentre,lhs,)
619 compile(reader/PrefixSyn,lhs,)
620 compile(reader/PrefixToHs,lhs,)
621 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
622 compile(reader/RdrHsSyn,lhs,)
624 compile(rename/ParseIface,hs,)
625 compile(rename/RnHsSyn,lhs,)
626 compile(rename/RnMonad,lhs,)
627 compile(rename/Rename,lhs,)
628 compile(rename/RnNames,lhs,)
629 compile(rename/RnSource,lhs,)
630 compile(rename/RnBinds,lhs,)
631 compile(rename/RnExpr,lhs,)
632 compile(rename/RnIfaces,lhs,)
633 compile(rename/RnUtils,lhs,)
635 compile(simplCore/BinderInfo,lhs,)
636 compile(simplCore/ConFold,lhs,)
637 compile(simplCore/FloatIn,lhs,)
638 compile(simplCore/FloatOut,lhs,)
639 compile(simplCore/LiberateCase,lhs,)
640 compile(simplCore/MagicUFs,lhs,)
641 compile(simplCore/OccurAnal,lhs,)
643 compile(simplCore/AnalFBWW,lhs,)
644 compile(simplCore/FoldrBuildWW,lhs,)
646 compile(simplCore/SAT,lhs,)
647 compile(simplCore/SATMonad,lhs,)
648 compile(simplCore/SetLevels,lhs,)
649 compile(simplCore/SimplCase,lhs,)
650 compile(simplCore/SimplCore,lhs,)
651 compile(simplCore/SimplEnv,lhs,)
652 compile(simplCore/SimplMonad,lhs,)
653 compile(simplCore/SimplPgm,lhs,)
654 compile(simplCore/SimplUtils,lhs,)
655 compile(simplCore/SimplVar,lhs,)
656 compile(simplCore/Simplify,lhs,)
658 compile(simplStg/SatStgRhs,lhs,)
659 compile(simplStg/LambdaLift,lhs,)
660 compile(simplStg/StgVarInfo,lhs,)
661 compile(simplStg/UpdAnal,lhs,)
662 compile(simplStg/StgStats,lhs,)
663 compile(simplStg/StgSATMonad,lhs,)
664 compile(simplStg/StgSAT,lhs,)
665 compile(simplStg/SimplStg,lhs,)
667 #if GhcWithDeforester == YES
668 compile(deforest/Core2Def,lhs,)
669 compile(deforest/Cyclic,lhs,)
670 compile(deforest/Def2Core,lhs,)
671 compile(deforest/DefExpr,lhs,)
672 compile(deforest/DefSyn,lhs,)
673 compile(deforest/DefUtils,lhs,)
674 compile(deforest/Deforest,lhs,)
675 compile(deforest/TreelessForm,lhs,)
678 compile(specialise/Specialise,lhs,)
679 compile(specialise/SpecEnv,lhs,)
680 compile(specialise/SpecUtils,lhs,)
682 compile(stgSyn/CoreToStg,lhs,)
683 compile(stgSyn/StgUtils,lhs,)
684 compile(stgSyn/StgLint,lhs,)
685 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
687 compile(stranal/SaAbsInt,lhs,)
688 compile(stranal/SaLib,lhs,)
689 compile(stranal/StrictAnal,lhs,)
690 compile(stranal/WorkWrap,lhs,)
691 compile(stranal/WwLib,lhs,)
693 compile(typecheck/GenSpecEtc,lhs,)
694 compile(typecheck/Inst,lhs,)
695 compile(typecheck/TcHsSyn,lhs,)
696 compile(typecheck/TcBinds,lhs,)
697 compile(typecheck/TcClassDcl,lhs,)
698 compile(typecheck/TcDefaults,lhs,)
699 compile(typecheck/TcDeriv,lhs,)
700 compile(typecheck/TcExpr,lhs,)
701 compile(typecheck/TcGRHSs,lhs,)
702 compile(typecheck/TcGenDeriv,lhs,)
703 compile(typecheck/TcIfaceSig,lhs,)
704 compile(typecheck/TcInstDcls,lhs,)
705 compile(typecheck/TcInstUtil,lhs,)
706 compile(typecheck/TcMatches,lhs,)
707 compile(typecheck/TcModule,lhs,)
708 compile(typecheck/TcMonad,lhs,)
709 compile(typecheck/TcKind,lhs,)
710 compile(typecheck/TcType,lhs,)
711 compile(typecheck/TcEnv,lhs,)
712 compile(typecheck/TcMonoType,lhs,)
713 compile(typecheck/TcPat,lhs,)
714 compile(typecheck/TcPragmas,lhs,)
715 compile(typecheck/TcSimplify,lhs,)
716 compile(typecheck/TcTyClsDecls,lhs,)
717 compile(typecheck/TcTyDecls,lhs,)
718 compile(typecheck/Typecheck,lhs,)
719 compile(typecheck/Unify,lhs,)
721 compile(types/Class,lhs,)
722 compile(types/Kind,lhs,)
723 compile(types/PprType,lhs,)
724 compile(types/TyCon,lhs,)
725 compile(types/TyVar,lhs,)
726 compile(types/Usage,lhs,)
727 compile(types/Type,lhs,)
729 compile(utils/Argv,lhs,if_ghc(-fvia-C))
730 compile(utils/Bag,lhs,)
731 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
732 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
733 compile(utils/Digraph,lhs,)
734 compile(utils/FiniteMap,lhs,)
735 compile(utils/ListSetOps,lhs,)
736 compile(utils/Maybes,lhs,)
737 compile(utils/OrdList,lhs,)
738 compile(utils/Outputable,lhs,)
739 compile(utils/PprStyle,lhs,)
740 compile(utils/Pretty,lhs,)
741 compile(utils/SST,lhs,if_ghc(-fvia-C))
742 compile(utils/UniqFM,lhs,)
743 compile(utils/UniqSet,lhs,)
744 compile(utils/Unpretty,lhs,)
745 compile(utils/MatchEnv,lhs,)
746 compile(utils/Util,lhs,)
748 /* for convenience in cross-compiling */
751 /* *** parser ************************************************* */
754 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
756 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
758 XCOMM D_DEBUG = -DDEBUG
760 CPP_DEFINES = $(D_DEBUG)
762 HSP_SRCS_C = parser/constr.c \
767 parser/hsparser.tab.c \
778 parser/type2context.c \
781 HSP_OBJS_O = parser/constr.o \
786 parser/hsparser.tab.o \
797 parser/type2context.o \
800 /* this is for etags */
801 REAL_HSP_SRCS_C = parser/main.c \
807 parser/type2context.c \
811 UgenNeededHere(all depend)
813 /* Most hsp files are in libhsp.a, so we can either make
814 a standalone parser, or incorporate the files into
815 the hsc compiler directly (WDP 94/10)
817 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
819 /* We need the hsp program for hstags to work! */
820 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
822 #if DoInstallGHCSystem == YES
823 MakeDirectories(install, $(INSTLIBDIR_GHC))
824 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
825 #endif /* DoInstall... */
827 YaccRunWithExpectMsg(parser/hsparser,14,0)
829 UgenTarget(parser/constr)
830 UgenTarget(parser/binding)
831 UgenTarget(parser/pbinding)
832 UgenTarget(parser/entidt)
833 UgenTarget(parser/list)
834 UgenTarget(parser/literal)
835 UgenTarget(parser/maybe)
836 UgenTarget(parser/either)
837 UgenTarget(parser/qid)
838 UgenTarget(parser/tree)
839 UgenTarget(parser/ttype)
841 UGENS_C = parser/constr.c \
853 /* Putting the -#include"hspincl.h" option into the
854 PARSER_HS_OPTS line really does not work (it depends
855 on the 'make' that you use).
857 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
859 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
860 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
861 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
862 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
863 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
864 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
865 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
866 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
867 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
868 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
869 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
870 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
871 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
873 /* finished with local macros */
878 /* *** misc *************************************************** */
880 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
882 #if GhcWithHscBuiltViaC == NO
883 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
884 #else /* booting from .hc */
885 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
886 #endif /* booting from .hc files */
888 #if HaskellCompilerType != HC_USE_HC_FILES
889 /* otherwise, the dependencies jeopardize our .hc files --
890 which are all we have! */
891 HaskellDependTarget( $(DEPSRCS) )
894 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
895 #if GhcWithHscBuiltViaC == YES
896 ExtraStuffToClean( $(ALLHCS) )
898 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
901 HsTagsTarget( $(ALLSRCS_LHS) )
902 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
904 /* count the number of lines in the source files */
906 ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
908 /* accumulate similar info about the sizes of object files */
910 ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)