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/FieldLabel.lhs \
100 basicTypes/IdInfo.lhs \
101 basicTypes/IdUtils.lhs \
102 basicTypes/Literal.lhs \
103 basicTypes/Name.lhs \
104 basicTypes/NameTypes.lhs \
105 basicTypes/PprEnv.lhs \
106 basicTypes/PragmaInfo.lhs \
107 basicTypes/ProtoName.lhs \
108 basicTypes/SrcLoc.lhs \
109 basicTypes/UniqSupply.lhs \
110 basicTypes/Unique.lhs \
120 specialise/SpecEnv.lhs
123 #define RENAMERSRCS_LHS \
130 rename/RnMonad12.lhs \
131 rename/RnMonad3.lhs \
132 rename/RnMonad4.lhs \
133 rename/RnBinds4.lhs \
138 typecheck/TcHsSyn.lhs \
139 typecheck/GenSpecEtc.lhs \
141 typecheck/TcBinds.lhs \
142 typecheck/TcClassDcl.lhs \
143 typecheck/TcDefaults.lhs \
144 typecheck/TcDeriv.lhs \
145 typecheck/TcExpr.lhs \
146 typecheck/TcGenDeriv.lhs \
147 typecheck/TcGRHSs.lhs \
148 typecheck/TcIfaceSig.lhs \
149 typecheck/TcInstDcls.lhs \
150 typecheck/TcInstUtil.lhs \
151 typecheck/TcMatches.lhs \
152 typecheck/TcModule.lhs \
153 typecheck/TcMonad.lhs \
154 typecheck/TcEnv.lhs \
155 typecheck/TcKind.lhs \
156 typecheck/TcType.lhs \
157 typecheck/TcMonoType.lhs \
158 typecheck/TcPat.lhs \
159 typecheck/TcSimplify.lhs \
160 typecheck/TcTyClsDecls.lhs \
161 typecheck/TcTyDecls.lhs \
162 typecheck/Typecheck.lhs \
166 typecheck/TcPragmas.lhs \
170 deSugar/Desugar.lhs \
172 deSugar/MatchCon.lhs \
173 deSugar/MatchLit.lhs \
174 deSugar/DsBinds.lhs \
175 deSugar/DsCCall.lhs \
177 deSugar/DsGRHSs.lhs \
178 deSugar/DsHsSyn.lhs \
179 deSugar/DsListComp.lhs \
180 deSugar/DsMonad.lhs \
181 deSugar/DsUtils.lhs \
183 coreSyn/CoreLift.lhs \
186 #if GhcWithDeforester != YES
187 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
188 #define DEFORESTER_SRCS_LHS /*none*/
190 #define __omit_deforester_flag /*nope*/
191 #define DEFORESTER_SRCS_LHS \
192 deforest/DefSyn.lhs \
193 deforest/Core2Def.lhs \
194 deforest/Def2Core.lhs \
195 deforest/Deforest.lhs \
196 deforest/DefUtils.lhs \
197 deforest/DefExpr.lhs \
198 deforest/Cyclic.lhs \
199 deforest/TreelessForm.lhs
200 #endif /* GhcWithDeforester */
202 #define SIMPL_SRCS_LHS \
203 coreSyn/AnnCoreSyn.lhs \
204 coreSyn/FreeVars.lhs \
206 specialise/Specialise.lhs \
207 specialise/SpecUtils.lhs \
209 simplCore/SimplCase.lhs \
210 simplCore/SimplEnv.lhs \
211 simplCore/SimplMonad.lhs \
212 simplCore/SimplPgm.lhs \
213 simplCore/SimplUtils.lhs \
214 simplCore/SimplVar.lhs \
215 simplCore/Simplify.lhs \
217 simplCore/LiberateCase.lhs \
219 simplCore/ConFold.lhs \
220 simplCore/FloatIn.lhs \
221 simplCore/FloatOut.lhs \
223 simplCore/SATMonad.lhs \
224 simplCore/SetLevels.lhs \
225 simplCore/SimplCore.lhs \
226 simplCore/OccurAnal.lhs \
227 simplCore/FoldrBuildWW.lhs \
228 simplCore/AnalFBWW.lhs \
230 stranal/StrictAnal.lhs \
232 stranal/SaAbsInt.lhs \
234 stranal/WorkWrap.lhs \
236 profiling/SCCauto.lhs DEFORESTER_SRCS_LHS
238 #define STG_SRCS_LHS \
239 stgSyn/CoreToStg.lhs \
241 stgSyn/StgUtils.lhs \
243 profiling/SCCfinal.lhs \
245 simplStg/SatStgRhs.lhs \
246 simplStg/LambdaLift.lhs \
247 simplStg/StgVarInfo.lhs \
248 simplStg/UpdAnal.lhs \
249 simplStg/StgStats.lhs \
250 simplStg/StgSATMonad.lhs \
251 simplStg/StgSAT.lhs \
252 simplStg/SimplStg.lhs
254 #define BACKSRCS_LHS \
255 absCSyn/AbsCUtils.lhs \
256 absCSyn/AbsCSyn.lhs \
259 absCSyn/HeapOffs.lhs \
260 absCSyn/PprAbsC.lhs \
262 codeGen/CodeGen.lhs \
263 codeGen/ClosureInfo.lhs \
265 codeGen/CgConTbls.lhs \
266 codeGen/CgMonad.lhs \
267 codeGen/CgUsages.lhs \
268 codeGen/CgHeapery.lhs \
269 codeGen/CgStackery.lhs \
272 codeGen/CgLetNoEscape.lhs \
273 codeGen/CgTailCall.lhs \
274 codeGen/CgClosure.lhs \
276 codeGen/CgRetConv.lhs \
277 codeGen/CgBindery.lhs \
280 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
281 /* if building via C, we *assume* that it is the
282 distributed C files, which do not have a native-code
285 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
286 # define NATIVEGEN_SRCS_LHS /*none*/
288 # define __omit_ncg_maybe /*none*/
290 # define NATIVEGEN_SRCS_LHS \
291 nativeGen/AbsCStixGen.lhs \
292 nativeGen/AsmCodeGen.lhs \
293 nativeGen/AsmRegAlloc.lhs \
294 nativeGen/MachCode.lhs \
295 nativeGen/MachMisc.lhs \
296 nativeGen/MachRegs.lhs \
297 nativeGen/PprMach.lhs \
298 nativeGen/RegAllocInfo.lhs \
300 nativeGen/StixInfo.lhs \
301 nativeGen/StixInteger.lhs \
302 nativeGen/StixPrim.lhs \
303 nativeGen/StixMacro.lhs
306 #define UTILSRCS_LHS \
312 utils/FiniteMap.lhs \
313 utils/ListSetOps.lhs \
317 utils/Outputable.lhs \
326 #define MAIN_SRCS_LHS \
328 main/CmdLineOpts.lhs \
336 #define VBASICSRCS_LHS \
337 prelude/PrelMods.lhs \
338 prelude/PrimRep.lhs \
340 prelude/TysPrim.lhs \
341 prelude/TysWiredIn.lhs \
342 prelude/PrelVals.lhs \
343 prelude/PrelInfo.lhs \
345 absCSyn/CStrings.lhs \
346 codeGen/CgCompInfo.lhs \
347 coreSyn/CoreSyn.lhs \
348 coreSyn/CoreUnfold.lhs \
349 coreSyn/CoreUtils.lhs \
350 coreSyn/PprCore.lhs \
351 profiling/CostCentre.lhs \
352 simplCore/BinderInfo.lhs \
353 simplCore/MagicUFs.lhs
355 ALLSRCS_HS = READERSRCS_HS
356 ALLSRCS_LHS = /* all pieces of the compiler */ \
358 NOT_SO_BASICSRCS_LHS \
367 BACKSRCS_LHS NATIVEGEN_SRCS_LHS
371 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
372 need to be on the last line.
375 /* should't use these fancy `make' things, really */
376 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
377 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
378 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
380 .PRECIOUS: $(ALLINTS)
382 #if GhcWithHscDebug == YES
383 # define use_DDEBUG -DDEBUG
385 # define use_DDEBUG /*nothing*/
388 #if GhcWithHscOptimised == YES
389 #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
391 #define __version_sensitive_flags -fomit-reexported-instances
394 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
395 #undef AllProjectsHcOpts
396 #define AllProjectsHcOpts /**/
398 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
399 -fomit-derived-read \
400 -I. -i$(SUBDIR_LIST) \
401 use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
403 #undef __version_sensitive_flags
404 #undef __omit_ncg_maybe
405 #undef __omit_deforester_flag
407 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
411 # if HaskellCompilerType == HC_USE_HC_FILES
412 HC = $(GHC) /* uses the driver herein */
415 #endif /* using .hc files */
419 Used when compiling GHC. Some GHC utility modules are
420 *also* part of the GHC library. There are a few bits
421 of those modules that only apply to GHC itself and
422 should not be in the library stuff. We use this
423 CPP thing to isolate those bits.
426 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
428 #if DoInstallGHCSystem == YES
429 MakeDirectories(install, $(INSTLIBDIR_GHC))
430 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
433 /* set up for going either to .hc or to .o files */
434 #if GhcWithHscBuiltViaC == YES
436 /*OLD:SuffixRule_hc_o() */
438 # if HaskellCompilerType == HC_USE_HC_FILES
439 /* if we do not, we never try to compile .lhs files;
440 we *blast* the macro we would normally use (HACK) (WDP 94/12)
443 # undef HaskellCompileWithSpecifiedFlags
444 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
445 module.osuf : module.isuf \
446 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
448 # define compile(module,isuf,extra_flags) \
449 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
451 # define compile_rec(module,isuf,extra_flags) \
452 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
456 # define compile(module,isuf,extra_flags) \
457 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
459 # define compile_rec(module,isuf,extra_flags) \
460 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
462 # endif /* ... == HC_USE_HC_FILES */
464 #else /* ! booting from C */
466 # define compile(module,isuf,extra_flags) \
467 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
469 # define compile_rec(module,isuf,extra_flags) \
470 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
472 #endif /* ! booting from C */
475 #if GhcBuilderVersion >= 26
476 # define if_ghc26(x) x
478 # define if_ghc26(x) /*nothing*/
481 /* OK, here we go: */
483 utils/Ubiq.hi : utils/Ubiq.lhi
484 $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi
486 absCSyn/AbsCLoop.hi : absCSyn/AbsCLoop.lhi
487 $(GHC_UNLIT) absCSyn/AbsCLoop.lhi absCSyn/AbsCLoop.hi
488 basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
489 $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
490 basicTypes/NameLoop.hi : basicTypes/NameLoop.lhi
491 $(GHC_UNLIT) basicTypes/NameLoop.lhi basicTypes/NameLoop.hi
492 codeGen/CgLoop1.hi : codeGen/CgLoop1.lhi
493 $(GHC_UNLIT) codeGen/CgLoop1.lhi codeGen/CgLoop1.hi
494 codeGen/CgLoop2.hi : codeGen/CgLoop2.lhi
495 $(GHC_UNLIT) codeGen/CgLoop2.lhi codeGen/CgLoop2.hi
496 deSugar/DsLoop.hi : deSugar/DsLoop.lhi
497 $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi
498 hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi
499 $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi
500 nativeGen/NcgLoop.hi : nativeGen/NcgLoop.lhi
501 $(GHC_UNLIT) nativeGen/NcgLoop.lhi nativeGen/NcgLoop.hi
502 prelude/PrelLoop.hi : prelude/PrelLoop.lhi
503 $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi
504 reader/RdrLoop.hi : reader/RdrLoop.lhi
505 $(GHC_UNLIT) reader/RdrLoop.lhi reader/RdrLoop.hi
506 rename/RnLoop.hi : rename/RnLoop.lhi
507 $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi
508 simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi
509 $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi
510 typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi
511 $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi
512 typecheck/TcLoop.hi : typecheck/TcLoop.lhi
513 $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi
514 types/TyLoop.hi : types/TyLoop.lhi
515 $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi
517 compile(absCSyn/AbsCUtils,lhs,)
518 compile(absCSyn/CStrings,lhs,)
519 compile(absCSyn/CLabel,lhs,)
520 compile(absCSyn/Costs,lhs,)
521 compile(absCSyn/HeapOffs,lhs,)
522 compile(absCSyn/PprAbsC,lhs,)
523 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
525 compile(hsSyn/HsBinds,lhs,)
526 compile(hsSyn/HsCore,lhs,)
527 compile(hsSyn/HsDecls,lhs,)
528 compile(hsSyn/HsExpr,lhs,)
529 compile(hsSyn/HsImpExp,lhs,)
530 compile(hsSyn/HsLit,lhs,)
531 compile(hsSyn/HsMatches,lhs,)
532 compile(hsSyn/HsPat,lhs,)
533 compile(hsSyn/HsPragmas,lhs,)
534 compile(hsSyn/HsTypes,lhs,)
535 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
537 compile(basicTypes/FieldLabel,lhs,)
538 compile(basicTypes/Id,lhs,)
539 compile(basicTypes/IdInfo,lhs,-K2m)
540 compile(basicTypes/IdUtils,lhs,)
541 compile(basicTypes/Literal,lhs,)
542 compile(basicTypes/Name,lhs,)
543 compile(basicTypes/NameTypes,lhs,)
544 compile(basicTypes/PprEnv,lhs,)
545 compile(basicTypes/PragmaInfo,lhs,)
546 compile(basicTypes/ProtoName,lhs,)
547 compile(basicTypes/SrcLoc,lhs,)
548 compile(basicTypes/UniqSupply,lhs,)
549 compile(basicTypes/Unique,lhs,)
551 compile(codeGen/CgBindery,lhs,)
552 compile(codeGen/CgCase,lhs,)
553 compile(codeGen/CgClosure,lhs,)
554 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
555 compile(codeGen/CgCon,lhs,)
556 compile(codeGen/CgConTbls,lhs,)
557 compile(codeGen/CgExpr,lhs,)
558 compile(codeGen/CgHeapery,lhs,)
559 compile(codeGen/CgLetNoEscape,lhs,)
560 compile(codeGen/CgMonad,lhs,)
561 compile(codeGen/CgRetConv,lhs,)
562 compile(codeGen/CgStackery,lhs,)
563 compile(codeGen/CgTailCall,lhs,)
564 compile(codeGen/CgUpdate,lhs,)
565 compile(codeGen/CgUsages,lhs,)
566 compile(codeGen/ClosureInfo,lhs,)
567 compile(codeGen/CodeGen,lhs,)
568 compile(codeGen/SMRep,lhs,)
570 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
571 compile(coreSyn/CoreUtils,lhs,)
572 compile(coreSyn/CoreLift,lhs,)
573 compile(coreSyn/CoreLint,lhs,)
574 compile(coreSyn/CoreSyn,lhs,)
575 compile(coreSyn/PprCore,lhs,)
576 compile(coreSyn/CoreUnfold,lhs,)
577 compile(coreSyn/FreeVars,lhs,)
579 compile(deSugar/Desugar,lhs,)
580 compile(deSugar/DsBinds,lhs,)
581 compile(deSugar/DsCCall,lhs,)
582 compile(deSugar/DsExpr,lhs,)
583 compile(deSugar/DsGRHSs,lhs,)
584 compile(deSugar/DsHsSyn,lhs,)
585 compile(deSugar/DsListComp,lhs,)
586 compile(deSugar/DsMonad,lhs,)
587 compile(deSugar/DsUtils,lhs,)
588 compile(deSugar/Match,lhs,)
589 compile(deSugar/MatchCon,lhs,)
590 compile(deSugar/MatchLit,lhs,)
592 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
593 compile(main/ErrUtils,lhs,)
594 compile(main/Main,lhs,if_ghc(-fvia-C))
595 compile(main/MainMonad,lhs,)
596 compile(main/MkIface,lhs,)
598 #if GhcWithNativeCodeGen == YES
599 compile(nativeGen/AbsCStixGen,lhs,)
600 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
601 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
602 compile(nativeGen/MachCode,lhs,)
603 compile(nativeGen/MachMisc,lhs,)
604 compile(nativeGen/MachRegs,lhs,)
605 compile(nativeGen/PprMach,lhs,)
606 compile(nativeGen/RegAllocInfo,lhs,)
607 compile(nativeGen/Stix,lhs,)
608 compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
609 compile(nativeGen/StixInteger,lhs,)
610 compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
611 compile(nativeGen/StixPrim,lhs,)
614 compile(prelude/PrelInfo,lhs,)
615 compile(prelude/PrelMods,lhs,)
616 compile(prelude/PrelVals,lhs,)
617 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
618 compile(prelude/PrimOp,lhs,-K3m -H10m)
619 compile(prelude/TysPrim,lhs,)
620 compile(prelude/TysWiredIn,lhs,)
622 compile(profiling/SCCauto,lhs,)
623 compile(profiling/SCCfinal,lhs,)
624 compile(profiling/CostCentre,lhs,)
626 compile(reader/PrefixSyn,lhs,)
627 compile(reader/PrefixToHs,lhs,)
628 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
629 compile(reader/ReadPragmas,lhs,)
630 compile(reader/RdrHsSyn,lhs,)
632 compile(rename/Rename,lhs,)
633 compile(rename/RnPass1,lhs,)
634 compile(rename/RnPass2,lhs,)
635 compile(rename/RnPass3,lhs,)
636 compile(rename/RnPass4,lhs,)
637 compile(rename/RnUtils,lhs,)
638 compile(rename/RnHsSyn,lhs,)
639 compile(rename/RnBinds4,lhs,)
640 compile(rename/RnExpr4,lhs,)
641 compile(rename/RnMonad12,lhs,)
642 compile(rename/RnMonad3,lhs,)
643 compile(rename/RnMonad4,lhs,)
645 compile(simplCore/BinderInfo,lhs,)
646 compile(simplCore/ConFold,lhs,)
647 compile(simplCore/FloatIn,lhs,)
648 compile(simplCore/FloatOut,lhs,)
649 compile(simplCore/LiberateCase,lhs,)
650 compile(simplCore/MagicUFs,lhs,)
651 compile(simplCore/OccurAnal,lhs,)
653 compile(simplCore/AnalFBWW,lhs,)
654 compile(simplCore/FoldrBuildWW,lhs,)
656 compile(simplCore/SAT,lhs,)
657 compile(simplCore/SATMonad,lhs,)
658 compile(simplCore/SetLevels,lhs,)
659 compile(simplCore/SimplCase,lhs,)
660 compile(simplCore/SimplCore,lhs,)
661 compile(simplCore/SimplEnv,lhs,)
662 compile(simplCore/SimplMonad,lhs,)
663 compile(simplCore/SimplPgm,lhs,)
664 compile(simplCore/SimplUtils,lhs,)
665 compile(simplCore/SimplVar,lhs,)
666 compile(simplCore/Simplify,lhs,)
668 compile(simplStg/SatStgRhs,lhs,)
669 compile(simplStg/LambdaLift,lhs,)
670 compile(simplStg/StgVarInfo,lhs,)
671 compile(simplStg/UpdAnal,lhs,)
672 compile(simplStg/StgStats,lhs,)
673 compile(simplStg/StgSATMonad,lhs,)
674 compile(simplStg/StgSAT,lhs,)
675 compile(simplStg/SimplStg,lhs,)
677 #if GhcWithDeforester == YES
678 compile(deforest/Core2Def,lhs,)
679 compile(deforest/Cyclic,lhs,)
680 compile(deforest/Def2Core,lhs,)
681 compile(deforest/DefExpr,lhs,)
682 compile(deforest/DefSyn,lhs,)
683 compile(deforest/DefUtils,lhs,)
684 compile(deforest/Deforest,lhs,)
685 compile(deforest/TreelessForm,lhs,)
688 compile(specialise/Specialise,lhs,)
689 compile(specialise/SpecEnv,lhs,)
690 compile(specialise/SpecUtils,lhs,)
692 compile(stgSyn/CoreToStg,lhs,)
693 compile(stgSyn/StgUtils,lhs,)
694 compile(stgSyn/StgLint,lhs,)
695 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
697 compile(stranal/SaAbsInt,lhs,)
698 compile(stranal/SaLib,lhs,)
699 compile(stranal/StrictAnal,lhs,)
700 compile(stranal/WorkWrap,lhs,)
701 compile(stranal/WwLib,lhs,)
703 compile(typecheck/GenSpecEtc,lhs,)
704 compile(typecheck/Inst,lhs,)
705 compile(typecheck/TcHsSyn,lhs,)
706 compile(typecheck/TcBinds,lhs,)
707 compile(typecheck/TcClassDcl,lhs,)
708 compile(typecheck/TcDefaults,lhs,)
709 compile(typecheck/TcDeriv,lhs,)
710 compile(typecheck/TcExpr,lhs,)
711 compile(typecheck/TcGRHSs,lhs,)
712 compile(typecheck/TcGenDeriv,lhs,)
713 compile(typecheck/TcIfaceSig,lhs,)
714 compile(typecheck/TcInstDcls,lhs,)
715 compile(typecheck/TcInstUtil,lhs,)
716 compile(typecheck/TcMatches,lhs,)
717 compile(typecheck/TcModule,lhs,)
718 compile(typecheck/TcMonad,lhs,)
719 compile(typecheck/TcKind,lhs,)
720 compile(typecheck/TcType,lhs,)
721 compile(typecheck/TcEnv,lhs,)
722 compile(typecheck/TcMonoType,lhs,)
723 compile(typecheck/TcPat,lhs,)
724 compile(typecheck/TcPragmas,lhs,)
725 compile(typecheck/TcSimplify,lhs,)
726 compile(typecheck/TcTyClsDecls,lhs,)
727 compile(typecheck/TcTyDecls,lhs,)
728 compile(typecheck/Typecheck,lhs,)
729 compile(typecheck/Unify,lhs,)
731 compile(types/Class,lhs,)
732 compile(types/Kind,lhs,)
733 compile(types/PprType,lhs,)
734 compile(types/TyCon,lhs,)
735 compile(types/TyVar,lhs,)
736 compile(types/Usage,lhs,)
737 compile(types/Type,lhs,)
739 compile(utils/Argv,lhs,if_ghc(-fvia-C))
740 compile(utils/Bag,lhs,)
741 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
742 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
743 compile(utils/Digraph,lhs,)
744 compile(utils/FiniteMap,lhs,)
745 compile(utils/ListSetOps,lhs,)
746 compile(utils/Maybes,lhs,)
747 compile(utils/OrdList,lhs,)
748 compile(utils/Outputable,lhs,)
749 compile(utils/PprStyle,lhs,)
750 compile(utils/Pretty,lhs,)
751 compile(utils/SST,lhs,if_ghc(-fvia-C))
752 compile(utils/UniqFM,lhs,)
753 compile(utils/UniqSet,lhs,)
754 compile(utils/Unpretty,lhs,)
755 compile(utils/MatchEnv,lhs,)
756 compile(utils/Util,lhs,)
758 /* for convenience in cross-compiling */
761 /* *** parser ************************************************* */
764 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
766 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
768 XCOMM D_DEBUG = -DDEBUG
770 CPP_DEFINES = $(D_DEBUG)
772 HSP_SRCS_C = parser/constr.c \
779 parser/hsparser.tab.c \
781 parser/import_dirlist.c \
791 parser/type2context.c \
794 HSP_OBJS_O = parser/constr.o \
801 parser/hsparser.tab.o \
803 parser/import_dirlist.o \
813 parser/type2context.o \
816 /* this is for etags */
817 REAL_HSP_SRCS_C = parser/main.c \
823 parser/type2context.c \
824 parser/import_dirlist.c \
828 UgenNeededHere(all depend)
830 /* Most hsp files are in libhsp.a, so we can either make
831 a standalone parser, or incorporate the files into
832 the hsc compiler directly (WDP 94/10)
834 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
836 /* We need the hsp program for hstags to work! */
837 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
839 #if DoInstallGHCSystem == YES
840 MakeDirectories(install, $(INSTLIBDIR_GHC))
841 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
842 #endif /* DoInstall... */
844 YaccRunWithExpectMsg(parser/hsparser,16,0)
846 UgenTarget(parser/constr)
847 UgenTarget(parser/binding)
848 UgenTarget(parser/pbinding)
849 UgenTarget(parser/coresyn)
850 UgenTarget(parser/entidt)
851 UgenTarget(parser/hpragma)
852 UgenTarget(parser/list)
853 UgenTarget(parser/literal)
854 UgenTarget(parser/maybe)
855 UgenTarget(parser/either)
856 UgenTarget(parser/qid)
857 UgenTarget(parser/tree)
858 UgenTarget(parser/ttype)
860 UGENS_C = parser/constr.c \
874 /* Putting the -#include"hspincl.h" option into the
875 PARSER_HS_OPTS line really does not work (it depends
876 on the 'make' that you use).
878 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
880 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
881 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
882 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
883 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
884 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
885 compile(parser/U_coresyn,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
886 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
887 compile(parser/U_hpragma,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
888 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
889 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
890 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
891 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
892 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
893 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
894 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
896 /* finished with local macros */
901 /* *** misc *************************************************** */
903 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
905 #if GhcWithHscBuiltViaC == NO
906 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
907 #else /* booting from .hc */
908 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
909 #endif /* booting from .hc files */
911 #if HaskellCompilerType != HC_USE_HC_FILES
912 /* otherwise, the dependencies jeopardize our .hc files --
913 which are all we have! */
914 HaskellDependTarget( $(DEPSRCS) )
917 ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
918 #if GhcWithHscBuiltViaC == YES
919 ExtraStuffToClean( $(ALLHCS) )
921 ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
924 HsTagsTarget( $(ALLSRCS_LHS) )
925 HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
927 /* count the number of lines in the source files */
929 ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
931 /* accumulate similar info about the sizes of object files */
933 ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)