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
35 /* assume ALL source is in subdirectories one level below
36 they don't have Jmakefiles; this Jmakefile controls everything
39 SUBDIR_LIST = \ /* here they are, colon separated (for mkdependHS) */
40 utils:basicTypes:types:hsSyn:prelude:envs:rename:typecheck:deSugar:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen:nativeGen:absCSyn:main:reader:profiling:deforest:parser
43 MAIN_INCLUDE_DIR=MainIncludeDir
45 MAIN_INCLUDE_DIR=$(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
48 /* helps to find GhcConstants.h in codeGen/CgCompInfo.lhs */
50 COMPINFO_DIR=CompInfoDir
52 COMPINFO_DIR=$(TOP_PWD)/$(CURRENT_DIR)/codeGen
54 /* nativeGen, elsewhere */
56 NATIVEGEN_DIR=NativeGenDir
58 NATIVEGEN_DIR=$(TOP_PWD)/$(CURRENT_DIR)/nativeGen
61 /* in order-of-passes order, utility modules at the end */
63 #define READERSRCS_HS \
66 parser/U_pbinding.hs \
76 #define hsp_library libhsp.a
78 #define READERSRCS_LHS \
81 reader/ReadPrefix.lhs \
83 reader/PrefixSyn.lhs \
84 reader/PrefixToHs.lhs \
87 hsSyn/HsBinds.lhs /* abstract Haskell syntax */ \
99 #define NOT_SO_BASICSRCS_LHS \
100 basicTypes/FieldLabel.lhs \
102 basicTypes/IdInfo.lhs \
103 basicTypes/IdUtils.lhs \
104 basicTypes/Literal.lhs \
105 basicTypes/Name.lhs \
106 basicTypes/PprEnv.lhs \
107 basicTypes/PragmaInfo.lhs \
108 basicTypes/SrcLoc.lhs \
109 basicTypes/UniqSupply.lhs \
110 basicTypes/Unique.lhs \
120 specialise/SpecEnv.lhs
122 #define RENAMERSRCS_HS \
125 #define RENAMERSRCS_LHS \
126 rename/ParseUtils.lhs \
131 rename/RnSource.lhs \
134 rename/RnIfaces.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 \
165 typecheck/TcPragmas.lhs \
169 deSugar/Desugar.lhs \
171 deSugar/MatchCon.lhs \
172 deSugar/MatchLit.lhs \
173 deSugar/DsBinds.lhs \
174 deSugar/DsCCall.lhs \
176 deSugar/DsGRHSs.lhs \
177 deSugar/DsHsSyn.lhs \
178 deSugar/DsListComp.lhs \
179 deSugar/DsMonad.lhs \
180 deSugar/DsUtils.lhs \
182 coreSyn/CoreLift.lhs \
185 #if GhcWithDeforester != YES
186 #define __omit_deforester_flag -DOMIT_DEFORESTER=1
187 #define DEFORESTER_SRCS_LHS /*none*/
189 #define __omit_deforester_flag /*nope*/
190 #define DEFORESTER_SRCS_LHS \
191 deforest/DefSyn.lhs \
192 deforest/Core2Def.lhs \
193 deforest/Def2Core.lhs \
194 deforest/Deforest.lhs \
195 deforest/DefUtils.lhs \
196 deforest/DefExpr.lhs \
197 deforest/Cyclic.lhs \
198 deforest/TreelessForm.lhs
199 #endif /* GhcWithDeforester */
201 #define SIMPL_SRCS_LHS \
202 coreSyn/AnnCoreSyn.lhs \
203 coreSyn/FreeVars.lhs \
205 specialise/Specialise.lhs \
206 specialise/SpecUtils.lhs \
208 simplCore/SimplCase.lhs \
209 simplCore/SimplEnv.lhs \
210 simplCore/SimplMonad.lhs \
211 simplCore/SimplPgm.lhs \
212 simplCore/SimplUtils.lhs \
213 simplCore/SimplVar.lhs \
214 simplCore/Simplify.lhs \
216 simplCore/LiberateCase.lhs \
218 simplCore/ConFold.lhs \
219 simplCore/FloatIn.lhs \
220 simplCore/FloatOut.lhs \
222 simplCore/SATMonad.lhs \
223 simplCore/SetLevels.lhs \
224 simplCore/SimplCore.lhs \
225 simplCore/OccurAnal.lhs \
226 simplCore/FoldrBuildWW.lhs \
227 simplCore/AnalFBWW.lhs \
229 stranal/StrictAnal.lhs \
231 stranal/SaAbsInt.lhs \
233 stranal/WorkWrap.lhs DEFORESTER_SRCS_LHS
235 #define STG_SRCS_LHS \
236 stgSyn/CoreToStg.lhs \
238 stgSyn/StgUtils.lhs \
240 profiling/SCCfinal.lhs \
242 simplStg/SatStgRhs.lhs \
243 simplStg/LambdaLift.lhs \
244 simplStg/StgVarInfo.lhs \
245 simplStg/UpdAnal.lhs \
246 simplStg/StgStats.lhs \
247 simplStg/StgSATMonad.lhs \
248 simplStg/StgSAT.lhs \
249 simplStg/SimplStg.lhs
251 #define BACKSRCS_LHS \
252 absCSyn/AbsCUtils.lhs \
253 absCSyn/AbsCSyn.lhs \
256 absCSyn/HeapOffs.lhs \
257 absCSyn/PprAbsC.lhs \
259 codeGen/CodeGen.lhs \
260 codeGen/ClosureInfo.lhs \
262 codeGen/CgConTbls.lhs \
263 codeGen/CgMonad.lhs \
264 codeGen/CgUsages.lhs \
265 codeGen/CgHeapery.lhs \
266 codeGen/CgStackery.lhs \
269 codeGen/CgLetNoEscape.lhs \
270 codeGen/CgTailCall.lhs \
271 codeGen/CgClosure.lhs \
273 codeGen/CgRetConv.lhs \
274 codeGen/CgBindery.lhs \
277 #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
278 /* if building via C, we *assume* that it is the
279 distributed C files, which do not have a native-code
282 # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
283 # define NATIVEGEN_SRCS_LHS /*none*/
285 # define __omit_ncg_maybe /*none*/
287 # define NATIVEGEN_SRCS_LHS \
288 nativeGen/AbsCStixGen.lhs \
289 nativeGen/AsmCodeGen.lhs \
290 nativeGen/AsmRegAlloc.lhs \
291 nativeGen/MachCode.lhs \
292 nativeGen/MachMisc.lhs \
293 nativeGen/MachRegs.lhs \
294 nativeGen/PprMach.lhs \
295 nativeGen/RegAllocInfo.lhs \
297 nativeGen/StixInfo.lhs \
298 nativeGen/StixInteger.lhs \
299 nativeGen/StixPrim.lhs \
300 nativeGen/StixMacro.lhs
303 #define UTILSRCS_LHS \
309 utils/FiniteMap.lhs \
310 utils/ListSetOps.lhs \
314 utils/Outputable.lhs \
323 #define MAIN_SRCS_LHS \
324 main/CmdLineOpts.lhs \
329 #define VBASICSRCS_LHS \
330 prelude/PrelMods.lhs \
331 prelude/PrimRep.lhs \
333 prelude/TysPrim.lhs \
334 prelude/TysWiredIn.lhs \
335 prelude/PrelVals.lhs \
336 prelude/PrelInfo.lhs \
338 absCSyn/CStrings.lhs \
339 codeGen/CgCompInfo.lhs \
340 coreSyn/CoreSyn.lhs \
341 coreSyn/CoreUnfold.lhs \
342 coreSyn/CoreUtils.lhs \
343 coreSyn/PprCore.lhs \
344 profiling/CostCentre.lhs \
345 simplCore/BinderInfo.lhs \
346 simplCore/MagicUFs.lhs
348 ALLSRCS_HS = READERSRCS_HS RENAMERSRCS_HS
349 ALLSRCS_LHS = /* all pieces of the compiler */ \
351 NOT_SO_BASICSRCS_LHS \
360 BACKSRCS_LHS NATIVEGEN_SRCS_LHS
362 #if GhcBuilderVersion >= 200
363 # define loop_hi(f) CAT3(f,_1_3,.hi)
365 # define loop_hi(f) CAT2(f,.hi)
370 absCSyn/AbsCLoop.hi \
371 basicTypes/IdLoop.hi \
376 nativeGen/NcgLoop.hi \
377 prelude/PrelLoop.hi \
379 simplCore/SmplLoop.hi \
380 typecheck/TcMLoop.hi \
381 typecheck/TcLoop.hi \
387 /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS)
388 need to be on the last line.
391 /* should't use these fancy `make' things, really */
392 ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc)
393 ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
394 ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
396 .PRECIOUS: $(ALLINTS)
398 #if GhcWithHscDebug == YES
399 # define use_DDEBUG -DDEBUG
401 # define use_DDEBUG /*nothing*/
404 #if GhcWithHscOptimised == YES
405 #define __version_sensitive_flags -O /*-DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs*/ -fomit-reexported-instances -fshow-import-specs
407 #define __version_sensitive_flags -fomit-reexported-instances
410 /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
411 #undef AllProjectsHcOpts
412 #define AllProjectsHcOpts /**/
414 HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
415 -fomit-derived-read \
416 -I. -i$(SUBDIR_LIST) \
417 use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
419 #undef __version_sensitive_flags
420 #undef __omit_ncg_maybe
421 #undef __omit_deforester_flag
423 #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
427 # if HaskellCompilerType == HC_USE_HC_FILES
428 HC = $(GHC) /* uses the driver herein */
431 #endif /* using .hc files */
435 Used when compiling GHC. Some GHC utility modules are
436 *also* part of the GHC library. There are a few bits
437 of those modules that only apply to GHC itself and
438 should not be in the library stuff. We use this
439 CPP thing to isolate those bits.
442 BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a)
444 #if DoInstallGHCSystem == YES
445 MakeDirectories(install, $(INSTLIBDIR_GHC))
446 InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
449 /* set up for going either to .hc or to .o files */
450 #if GhcWithHscBuiltViaC == YES
452 /*OLD:SuffixRule_hc_o() */
454 # if HaskellCompilerType == HC_USE_HC_FILES
455 /* if we do not, we never try to compile .lhs files;
456 we *blast* the macro we would normally use (HACK) (WDP 94/12)
459 # undef HaskellCompileWithSpecifiedFlags
460 # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
461 module.osuf : module.isuf \
462 _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
464 # define compile(module,isuf,extra_flags) \
465 HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
467 # define compile_rec(module,isuf,extra_flags) \
468 HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
472 # define compile(module,isuf,extra_flags) \
473 HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
475 # define compile_rec(module,isuf,extra_flags) \
476 HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
478 # endif /* ... == HC_USE_HC_FILES */
480 #else /* ! booting from C */
482 # define compile(module,isuf,extra_flags) \
483 HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
485 # define compile_rec(module,isuf,extra_flags) \
486 HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
488 #endif /* ! booting from C */
491 #if GhcBuilderVersion >= 26
492 # define if_ghc26(x) x
494 # define if_ghc26(x) /*nothing*/
497 /* OK, here we go: */
499 rename/ParseIface.hs : rename/ParseIface.y
500 $(RM) rename/ParseIface.hs rename/ParseIface.hinfo
501 happy -g -i rename/ParseIface.hinfo rename/ParseIface.y
502 @chmod 444 rename/ParseIface.hs
504 compile(absCSyn/AbsCUtils,lhs,)
505 compile(absCSyn/CStrings,lhs,)
506 compile(absCSyn/CLabel,lhs,)
507 compile(absCSyn/Costs,lhs,)
508 compile(absCSyn/HeapOffs,lhs,)
509 compile(absCSyn/PprAbsC,lhs,)
510 compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
512 compile(hsSyn/HsBinds,lhs,)
513 compile(hsSyn/HsCore,lhs,)
514 compile(hsSyn/HsDecls,lhs,)
515 compile(hsSyn/HsExpr,lhs,)
516 compile(hsSyn/HsImpExp,lhs,)
517 compile(hsSyn/HsLit,lhs,)
518 compile(hsSyn/HsMatches,lhs,)
519 compile(hsSyn/HsPat,lhs,)
520 compile(hsSyn/HsPragmas,lhs,)
521 compile(hsSyn/HsTypes,lhs,)
522 compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
524 compile(basicTypes/FieldLabel,lhs,)
525 compile(basicTypes/Id,lhs,)
526 compile(basicTypes/IdInfo,lhs,-K2m)
527 compile(basicTypes/IdUtils,lhs,)
528 compile(basicTypes/Literal,lhs,)
529 compile(basicTypes/Name,lhs,)
530 compile(basicTypes/PprEnv,lhs,)
531 compile(basicTypes/PragmaInfo,lhs,)
532 compile(basicTypes/SrcLoc,lhs,)
533 compile(basicTypes/UniqSupply,lhs,)
534 compile(basicTypes/Unique,lhs,)
536 compile(codeGen/CgBindery,lhs,)
537 compile(codeGen/CgCase,lhs,)
538 compile(codeGen/CgClosure,lhs,)
539 compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
540 compile(codeGen/CgCon,lhs,)
541 compile(codeGen/CgConTbls,lhs,)
542 compile(codeGen/CgExpr,lhs,)
543 compile(codeGen/CgHeapery,lhs,)
544 compile(codeGen/CgLetNoEscape,lhs,)
545 compile(codeGen/CgMonad,lhs,)
546 compile(codeGen/CgRetConv,lhs,)
547 compile(codeGen/CgStackery,lhs,)
548 compile(codeGen/CgTailCall,lhs,)
549 compile(codeGen/CgUpdate,lhs,)
550 compile(codeGen/CgUsages,lhs,)
551 compile(codeGen/ClosureInfo,lhs,)
552 compile(codeGen/CodeGen,lhs,)
553 compile(codeGen/SMRep,lhs,)
555 compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
556 compile(coreSyn/CoreUtils,lhs,)
557 compile(coreSyn/CoreLift,lhs,)
558 compile(coreSyn/CoreLint,lhs,)
559 compile(coreSyn/CoreSyn,lhs,)
560 compile(coreSyn/PprCore,lhs,)
561 compile(coreSyn/CoreUnfold,lhs,)
562 compile(coreSyn/FreeVars,lhs,)
564 compile(deSugar/Desugar,lhs,)
565 compile(deSugar/DsBinds,lhs,)
566 compile(deSugar/DsCCall,lhs,)
567 compile(deSugar/DsExpr,lhs,)
568 compile(deSugar/DsGRHSs,lhs,)
569 compile(deSugar/DsHsSyn,lhs,)
570 compile(deSugar/DsListComp,lhs,)
571 compile(deSugar/DsMonad,lhs,)
572 compile(deSugar/DsUtils,lhs,)
573 compile(deSugar/Match,lhs,)
574 compile(deSugar/MatchCon,lhs,)
575 compile(deSugar/MatchLit,lhs,)
577 compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C))
578 compile(main/ErrUtils,lhs,)
579 compile(main/Main,lhs,if_ghc(-fvia-C))
580 compile(main/MkIface,lhs,)
582 #if GhcWithNativeCodeGen == YES
583 compile(nativeGen/AbsCStixGen,lhs,)
584 compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
585 compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR))
586 compile(nativeGen/MachCode,lhs,-I$(NATIVEGEN_DIR))
587 compile(nativeGen/MachMisc,lhs,-I$(NATIVEGEN_DIR))
588 compile(nativeGen/MachRegs,lhs,-I$(NATIVEGEN_DIR))
589 compile(nativeGen/PprMach,lhs,-I$(NATIVEGEN_DIR))
590 compile(nativeGen/RegAllocInfo,lhs,-I$(NATIVEGEN_DIR))
591 compile(nativeGen/Stix,lhs,)
592 compile(nativeGen/StixInfo,lhs,)
593 compile(nativeGen/StixInteger,lhs,)
594 compile(nativeGen/StixMacro,lhs,)
595 compile(nativeGen/StixPrim,lhs,)
598 compile(prelude/PrelInfo,lhs,)
599 compile(prelude/PrelMods,lhs,)
600 compile(prelude/PrelVals,lhs,)
601 compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR))
602 compile(prelude/PrimOp,lhs,-K3m -H10m)
603 compile(prelude/TysPrim,lhs,)
604 compile(prelude/TysWiredIn,lhs,)
606 compile(profiling/SCCfinal,lhs,)
607 compile(profiling/CostCentre,lhs,)
609 compile(reader/PrefixSyn,lhs,)
610 compile(reader/PrefixToHs,lhs,)
611 compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"'))
612 compile(reader/RdrHsSyn,lhs,)
614 compile(rename/ParseIface,hs,)
615 compile(rename/ParseUtils,lhs,)
616 compile(rename/RnHsSyn,lhs,)
617 compile(rename/RnMonad,lhs,if_ghc(-fvia-C))
618 compile(rename/Rename,lhs,)
619 compile(rename/RnNames,lhs,)
620 compile(rename/RnSource,lhs,)
621 compile(rename/RnBinds,lhs,)
622 compile(rename/RnExpr,lhs,)
623 compile(rename/RnIfaces,lhs,)
624 compile(rename/RnUtils,lhs,)
626 compile(simplCore/BinderInfo,lhs,)
627 compile(simplCore/ConFold,lhs,)
628 compile(simplCore/FloatIn,lhs,)
629 compile(simplCore/FloatOut,lhs,)
630 compile(simplCore/LiberateCase,lhs,)
631 compile(simplCore/MagicUFs,lhs,)
632 compile(simplCore/OccurAnal,lhs,)
634 compile(simplCore/AnalFBWW,lhs,)
635 compile(simplCore/FoldrBuildWW,lhs,)
637 compile(simplCore/SAT,lhs,)
638 compile(simplCore/SATMonad,lhs,)
639 compile(simplCore/SetLevels,lhs,)
640 compile(simplCore/SimplCase,lhs,)
641 compile(simplCore/SimplCore,lhs,)
642 compile(simplCore/SimplEnv,lhs,)
643 compile(simplCore/SimplMonad,lhs,)
644 compile(simplCore/SimplPgm,lhs,)
645 compile(simplCore/SimplUtils,lhs,)
646 compile(simplCore/SimplVar,lhs,)
647 compile(simplCore/Simplify,lhs,)
649 compile(simplStg/SatStgRhs,lhs,)
650 compile(simplStg/LambdaLift,lhs,)
651 compile(simplStg/StgVarInfo,lhs,)
652 compile(simplStg/UpdAnal,lhs,)
653 compile(simplStg/StgStats,lhs,)
654 compile(simplStg/StgSATMonad,lhs,)
655 compile(simplStg/StgSAT,lhs,)
656 compile(simplStg/SimplStg,lhs,)
658 #if GhcWithDeforester == YES
659 compile(deforest/Core2Def,lhs,)
660 compile(deforest/Cyclic,lhs,)
661 compile(deforest/Def2Core,lhs,)
662 compile(deforest/DefExpr,lhs,)
663 compile(deforest/DefSyn,lhs,)
664 compile(deforest/DefUtils,lhs,)
665 compile(deforest/Deforest,lhs,)
666 compile(deforest/TreelessForm,lhs,)
669 compile(specialise/Specialise,lhs,-H12m if_ghc(-Onot)) /* -Onot for compile-space reasons */
670 compile(specialise/SpecEnv,lhs,)
671 compile(specialise/SpecUtils,lhs,)
673 compile(stgSyn/CoreToStg,lhs,)
674 compile(stgSyn/StgUtils,lhs,)
675 compile(stgSyn/StgLint,lhs,)
676 compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances))
678 compile(stranal/SaAbsInt,lhs,)
679 compile(stranal/SaLib,lhs,)
680 compile(stranal/StrictAnal,lhs,)
681 compile(stranal/WorkWrap,lhs,)
682 compile(stranal/WwLib,lhs,)
684 compile(typecheck/GenSpecEtc,lhs,)
685 compile(typecheck/Inst,lhs,)
686 compile(typecheck/TcHsSyn,lhs,)
687 compile(typecheck/TcBinds,lhs,)
688 compile(typecheck/TcClassDcl,lhs,)
689 compile(typecheck/TcDefaults,lhs,)
690 compile(typecheck/TcDeriv,lhs,)
691 compile(typecheck/TcExpr,lhs,)
692 compile(typecheck/TcGRHSs,lhs,)
693 compile(typecheck/TcGenDeriv,lhs,)
694 compile(typecheck/TcIfaceSig,lhs,)
695 compile(typecheck/TcInstDcls,lhs,)
696 compile(typecheck/TcInstUtil,lhs,)
697 compile(typecheck/TcMatches,lhs,)
698 compile(typecheck/TcModule,lhs,)
699 compile(typecheck/TcMonad,lhs,if_ghc(-fvia-C))
700 compile(typecheck/TcKind,lhs,)
701 compile(typecheck/TcType,lhs,)
702 compile(typecheck/TcEnv,lhs,)
703 compile(typecheck/TcMonoType,lhs,)
704 compile(typecheck/TcPat,lhs,)
705 compile(typecheck/TcPragmas,lhs,)
706 compile(typecheck/TcSimplify,lhs,)
707 compile(typecheck/TcTyClsDecls,lhs,)
708 compile(typecheck/TcTyDecls,lhs,)
709 compile(typecheck/Unify,lhs,)
711 compile(types/Class,lhs,)
712 compile(types/Kind,lhs,)
713 compile(types/PprType,lhs,if_ghc26(-Onot)) /* avoid a 0.26 bug */
714 compile(types/TyCon,lhs,)
715 compile(types/TyVar,lhs,)
716 compile(types/Usage,lhs,)
717 compile(types/Type,lhs,)
719 compile(utils/Argv,lhs,if_ghc(-fvia-C))
720 compile(utils/Bag,lhs,)
721 compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
722 compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
723 compile(utils/Digraph,lhs,)
724 compile(utils/FiniteMap,lhs,)
725 compile(utils/ListSetOps,lhs,)
726 compile(utils/Maybes,lhs,)
727 compile(utils/OrdList,lhs,)
728 compile(utils/Outputable,lhs,)
729 compile(utils/PprStyle,lhs,)
730 compile(utils/Pretty,lhs,)
731 compile(utils/SST,lhs,if_ghc(-fvia-C))
732 compile(utils/UniqFM,lhs,)
733 compile(utils/UniqSet,lhs,)
734 compile(utils/Unpretty,lhs,)
735 compile(utils/MatchEnv,lhs,)
736 compile(utils/Util,lhs,)
738 /* for convenience in cross-compiling */
741 /* *** parser ************************************************* */
744 CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
746 /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
748 XCOMM D_DEBUG = -DDEBUG
750 CPP_DEFINES = $(D_DEBUG)
752 HSP_SRCS_C = parser/constr.c \
757 parser/hsparser.tab.c \
768 parser/type2context.c \
771 HSP_OBJS_O = parser/constr.o \
776 parser/hsparser.tab.o \
787 parser/type2context.o \
790 /* this is for etags */
791 REAL_HSP_SRCS_C = parser/main.c \
797 parser/type2context.c \
801 UgenNeededHere(all depend)
803 /* Most hsp files are in libhsp.a, so we can either make
804 a standalone parser, or incorporate the files into
805 the hsc compiler directly (WDP 94/10)
807 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
809 /* We need the hsp program for hstags to work! */
810 BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
812 #if DoInstallGHCSystem == YES
813 MakeDirectories(install, $(INSTLIBDIR_GHC))
814 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
815 #endif /* DoInstall... */
817 YaccRunWithExpectMsg(parser/hsparser,12,0)
819 parser/hslexer.o : parser/hslexer.c parser/hsparser.tab.h
821 $(CC) $(CFLAGS) -c $<
822 @if [ \( $(@D) != '.' \) -a \( $(@D) != './' \) ] ; then echo mv $(@F) $@ ; mv $(@F) $@ ; else exit 0 ; fi
824 UgenTarget(parser,constr)
825 UgenTarget(parser,binding)
826 UgenTarget(parser,pbinding)
827 UgenTarget(parser,entidt)
828 UgenTarget(parser,list)
829 UgenTarget(parser,literal)
830 UgenTarget(parser,maybe)
831 UgenTarget(parser,either)
832 UgenTarget(parser,qid)
833 UgenTarget(parser,tree)
834 UgenTarget(parser,ttype)
836 UGENS_C = parser/constr.c \
848 /* Putting the -#include"hspincl.h" option into the
849 PARSER_HS_OPTS line really does not work (it depends
850 on the 'make' that you use).
852 PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser)
854 compile(parser/UgenAll,lhs,if_ghc(-fvia-C))
855 compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
856 compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
857 compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
858 compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
859 compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
860 compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
861 compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
862 compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
863 compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
864 compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
865 compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
866 compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
868 /* finished with local macros */
873 /* *** misc *************************************************** */
875 DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
877 #if GhcWithHscBuiltViaC == NO
878 MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
879 #else /* booting from .hc */
880 MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h
881 #endif /* booting from .hc files */
883 #if HaskellCompilerType != HC_USE_HC_FILES
884 /* otherwise, the dependencies jeopardize our .hc files --
885 which are all we have! */
886 depend :: $(DELOOP_HIs)
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)