/* preliminaries */ /* (only subdir is the test suite) */ #if IncludeTestDirsInBuild == YES # define IHaveSubdirs # define __ghc_compiler_tests_dir tests #else # define __ghc_compiler_tests_dir /* nothing */ #endif SUBDIRS = __ghc_compiler_tests_dir #undef __ghc_compiler_tests_dir #define NoAllTargetForSubdirs #define NoDocsTargetForSubdirs #define NoInstallDocsTargetForSubdirs #define NoDependTargetForSubdirs #define NoInstallTargetForSubdirs #define NoTagTargetForSubdirs /* Suffix rules: we do not use them much at all in GHC. We need some magic stuff (from suffixes-GEN.ljm) for the parser files. */ SuffixRules_flexish() SuffixRule_c_o() LitSuffixRule(.lprl,.prl) /* for makeSymbolList.prl */ /* assume ALL source is in subdirectories one level below they don't have Jmakefiles; this Jmakefile controls everything */ SUBDIR_LIST = \ /* here they are, colon separated (for mkdependHS) */ utils:basicTypes:types:hsSyn:prelude:envs:rename:typecheck:deSugar:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen:nativeGen:absCSyn:main:reader:profiling:deforest:parser #ifdef MainIncludeDir MAIN_INCLUDE_DIR=MainIncludeDir #else MAIN_INCLUDE_DIR=$(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES) #endif /* helps to find GhcConstants.h in codeGen/CgCompInfo.lhs */ #ifdef CompInfoDir COMPINFO_DIR=CompInfoDir #else COMPINFO_DIR=$(TOP_PWD)/$(CURRENT_DIR)/codeGen #endif /* nativeGen, elsewhere */ #ifdef NativeGenDir NATIVEGEN_DIR=NativeGenDir #else NATIVEGEN_DIR=$(TOP_PWD)/$(CURRENT_DIR)/nativeGen #endif /* in order-of-passes order, utility modules at the end */ #define READERSRCS_HS \ parser/U_constr.hs \ parser/U_binding.hs \ parser/U_pbinding.hs \ parser/U_coresyn.hs \ parser/U_entidt.hs \ parser/U_hpragma.hs \ parser/U_list.hs \ parser/U_literal.hs \ parser/U_maybe.hs \ parser/U_either.hs \ parser/U_qid.hs \ parser/U_tree.hs \ parser/U_ttype.hs #define hsp_library libhsp.a #define READERSRCS_LHS \ parser/UgenUtil.lhs \ parser/UgenAll.lhs \ reader/ReadPrefix.lhs \ reader/ReadPragmas.lhs \ \ reader/PrefixSyn.lhs \ reader/PrefixToHs.lhs \ reader/RdrHsSyn.lhs \ \ hsSyn/HsBinds.lhs /* abstract Haskell syntax */ \ hsSyn/HsCore.lhs \ hsSyn/HsDecls.lhs \ hsSyn/HsExpr.lhs \ hsSyn/HsImpExp.lhs \ hsSyn/HsLit.lhs \ hsSyn/HsMatches.lhs \ hsSyn/HsPat.lhs \ hsSyn/HsPragmas.lhs \ hsSyn/HsTypes.lhs \ hsSyn/HsSyn.lhs #define NOT_SO_BASICSRCS_LHS \ basicTypes/Unique.lhs \ basicTypes/UniqSupply.lhs \ basicTypes/ProtoName.lhs \ basicTypes/Name.lhs \ basicTypes/NameTypes.lhs \ basicTypes/SrcLoc.lhs \ basicTypes/Id.lhs \ basicTypes/IdInfo.lhs \ basicTypes/IdUtils.lhs \ basicTypes/PragmaInfo.lhs \ basicTypes/Literal.lhs \ \ types/Class.lhs \ types/Kind.lhs \ types/PprType.lhs \ types/TyCon.lhs \ types/TyVar.lhs \ types/Usage.lhs \ types/Type.lhs \ \ specialise/SpecEnv.lhs #define RENAMERSRCS_LHS \ rename/RnPass1.lhs \ rename/RnPass2.lhs \ rename/RnPass3.lhs \ rename/RnPass4.lhs \ rename/RnHsSyn.lhs \ rename/RnUtils.lhs \ rename/RnMonad12.lhs \ rename/RnMonad3.lhs \ rename/RnMonad4.lhs \ rename/RnBinds4.lhs \ rename/RnExpr4.lhs \ rename/Rename.lhs #define TCSRCS_LHS \ typecheck/TcHsSyn.lhs \ typecheck/GenSpecEtc.lhs \ typecheck/Inst.lhs \ typecheck/TcBinds.lhs \ typecheck/TcClassDcl.lhs \ typecheck/TcDefaults.lhs \ typecheck/TcDeriv.lhs \ typecheck/TcExpr.lhs \ typecheck/TcGenDeriv.lhs \ typecheck/TcGRHSs.lhs \ typecheck/TcIfaceSig.lhs \ typecheck/TcInstDcls.lhs \ typecheck/TcInstUtil.lhs \ typecheck/TcMatches.lhs \ typecheck/TcModule.lhs \ typecheck/TcMonad.lhs \ typecheck/TcEnv.lhs \ typecheck/TcKind.lhs \ typecheck/TcType.lhs \ typecheck/TcMonoType.lhs \ typecheck/TcPat.lhs \ typecheck/TcSimplify.lhs \ typecheck/TcTyClsDecls.lhs \ typecheck/TcTyDecls.lhs \ typecheck/Typecheck.lhs \ typecheck/Unify.lhs /* typecheck/TcPragmas.lhs \ */ #define DSSRCS_LHS \ deSugar/Desugar.lhs \ deSugar/Match.lhs \ deSugar/MatchCon.lhs \ deSugar/MatchLit.lhs \ deSugar/DsBinds.lhs \ deSugar/DsCCall.lhs \ deSugar/DsExpr.lhs \ deSugar/DsGRHSs.lhs \ deSugar/DsHsSyn.lhs \ deSugar/DsListComp.lhs \ deSugar/DsMonad.lhs \ deSugar/DsUtils.lhs \ \ coreSyn/CoreLift.lhs \ coreSyn/CoreLint.lhs #define SIMPL_SRCS_LHS \ coreSyn/AnnCoreSyn.lhs \ coreSyn/FreeVars.lhs \ \ specialise/Specialise.lhs \ specialise/SpecUtils.lhs \ \ simplCore/SimplCase.lhs \ simplCore/SimplEnv.lhs \ simplCore/SimplMonad.lhs \ simplCore/SimplPgm.lhs \ simplCore/SimplUtils.lhs \ simplCore/SimplVar.lhs \ simplCore/Simplify.lhs \ \ simplCore/LiberateCase.lhs \ \ simplCore/ConFold.lhs \ simplCore/FloatIn.lhs \ simplCore/FloatOut.lhs \ simplCore/SAT.lhs \ simplCore/SATMonad.lhs \ simplCore/SetLevels.lhs \ simplCore/SimplCore.lhs \ simplCore/OccurAnal.lhs \ simplCore/FoldrBuildWW.lhs \ simplCore/AnalFBWW.lhs \ \ stranal/StrictAnal.lhs \ stranal/SaLib.lhs \ stranal/SaAbsInt.lhs \ stranal/WwLib.lhs \ stranal/WorkWrap.lhs \ \ profiling/SCCauto.lhs \ profiling/SCCfinal.lhs #if GhcWithDeforester != YES #define __omit_deforester_flag -DOMIT_DEFORESTER=1 #define DEFORESTER_SRCS_LHS /*none*/ #else #define __omit_deforester_flag /*nope*/ #define DEFORESTER_SRCS_LHS \ deforest/DefSyn.lhs \ deforest/Core2Def.lhs \ deforest/Def2Core.lhs \ deforest/Deforest.lhs \ deforest/DefUtils.lhs \ deforest/DefExpr.lhs \ deforest/Cyclic.lhs \ deforest/TreelessForm.lhs #endif /* GhcWithDeforester */ #define BACKSRCS_LHS \ stgSyn/CoreToStg.lhs \ stgSyn/StgSyn.lhs \ stgSyn/StgUtils.lhs \ stgSyn/StgLint.lhs \ \ simplStg/SatStgRhs.lhs \ simplStg/LambdaLift.lhs \ simplStg/StgVarInfo.lhs \ simplStg/UpdAnal.lhs \ simplStg/StgStats.lhs \ simplStg/StgSATMonad.lhs \ simplStg/StgSAT.lhs \ simplStg/SimplStg.lhs \ \ absCSyn/AbsCUtils.lhs \ absCSyn/AbsCSyn.lhs \ absCSyn/CLabel.lhs \ absCSyn/Costs.lhs \ absCSyn/HeapOffs.lhs \ absCSyn/PprAbsC.lhs \ \ codeGen/CodeGen.lhs \ codeGen/ClosureInfo.lhs \ codeGen/SMRep.lhs \ codeGen/CgConTbls.lhs \ codeGen/CgMonad.lhs \ codeGen/CgUsages.lhs \ codeGen/CgHeapery.lhs \ codeGen/CgStackery.lhs \ codeGen/CgExpr.lhs \ codeGen/CgCase.lhs \ codeGen/CgLetNoEscape.lhs \ codeGen/CgTailCall.lhs \ codeGen/CgClosure.lhs \ codeGen/CgCon.lhs \ codeGen/CgRetConv.lhs \ codeGen/CgBindery.lhs \ codeGen/CgUpdate.lhs #if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES /* if building via C, we *assume* that it is the distributed C files, which do not have a native-code generator in them */ # define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1 # define NATIVEGEN_SRCS_LHS /*none*/ #else # define __omit_ncg_maybe /*none*/ # if i386_TARGET_ARCH # define __machdep_nativegen_lhs \ nativeGen/I386Desc.lhs \ nativeGen/I386Code.lhs \ nativeGen/I386Gen.lhs # endif # if sparc_TARGET_ARCH # define __machdep_nativegen_lhs \ nativeGen/SparcDesc.lhs \ nativeGen/SparcCode.lhs \ nativeGen/SparcGen.lhs # endif # if alpha_TARGET_ARCH # define __machdep_nativegen_lhs \ nativeGen/AlphaDesc.lhs \ nativeGen/AlphaCode.lhs \ nativeGen/AlphaGen.lhs # endif # define NATIVEGEN_SRCS_LHS \ nativeGen/AbsCStixGen.lhs \ nativeGen/AsmCodeGen.lhs \ nativeGen/AsmRegAlloc.lhs \ nativeGen/MachDesc.lhs \ nativeGen/Stix.lhs \ nativeGen/StixInfo.lhs \ nativeGen/StixInteger.lhs \ nativeGen/StixPrim.lhs \ nativeGen/StixMacro.lhs \ __machdep_nativegen_lhs /*arch-specific ones */ #endif #define UTILSRCS_LHS \ utils/Argv.lhs \ utils/Bag.lhs \ utils/BitSet.lhs \ utils/CharSeq.lhs \ utils/Digraph.lhs \ utils/FiniteMap.lhs \ utils/ListSetOps.lhs \ utils/MatchEnv.lhs \ utils/Maybes.lhs \ utils/OrdList.lhs \ utils/Outputable.lhs \ utils/PprStyle.lhs \ utils/Pretty.lhs \ utils/SST.lhs \ utils/UniqFM.lhs \ utils/UniqSet.lhs \ utils/Unpretty.lhs \ utils/Util.lhs #define MAIN_SRCS_LHS \ main/MainMonad.lhs \ main/CmdLineOpts.lhs \ main/ErrUtils.lhs \ main/Main.lhs /* main/MkIface.lhs \ */ #define VBASICSRCS_LHS \ prelude/PrelMods.lhs \ prelude/PrimRep.lhs \ prelude/PrimOp.lhs \ prelude/TysPrim.lhs \ prelude/TysWiredIn.lhs \ prelude/PrelVals.lhs \ prelude/PrelInfo.lhs \ \ absCSyn/CStrings.lhs \ codeGen/CgCompInfo.lhs \ coreSyn/CoreSyn.lhs \ coreSyn/CoreUnfold.lhs \ coreSyn/CoreUtils.lhs \ coreSyn/PprCore.lhs \ profiling/CostCentre.lhs \ simplCore/BinderInfo.lhs \ simplCore/MagicUFs.lhs ALLSRCS_HS = READERSRCS_HS ALLSRCS_LHS = /* all pieces of the compiler */ \ VBASICSRCS_LHS \ NOT_SO_BASICSRCS_LHS \ UTILSRCS_LHS \ MAIN_SRCS_LHS \ READERSRCS_LHS \ RENAMERSRCS_LHS \ TCSRCS_LHS \ DSSRCS_LHS /* SIMPL_SRCS_LHS BACKSRCS_LHS */ /* NATIVEGEN_SRCS_LHS DEFORESTER_SRCS_LHS */ /* NB: all the ones that may be empty (e.g., NATIVEGEN_SRCS_LHS) need to be on the last line. */ /* should't use these fancy `make' things, really */ ALLHCS =$(ALLSRCS_LHS:.lhs=.hc) $(ALLSRCS_HS:.hs=.hc) ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o) ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi) .PRECIOUS: $(ALLINTS) #if GhcWithHscDebug == YES # define use_DDEBUG -DDEBUG #else # define use_DDEBUG /*nothing*/ #endif #if GhcWithHscOptimised == YES #define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs #else #define __version_sensitive_flags -fomit-reexported-instances #endif #if GhcWithRegisterised == NO /* doing a raw boot from .hc files, presumably */ #define __unreg_opts_maybe -O -unregisterised #else #define __unreg_opts_maybe /*none*/ #endif /* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */ #undef AllProjectsHcOpts #define AllProjectsHcOpts /**/ HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \ -fomit-derived-read \ -I. -i$(SUBDIR_LIST) \ use_DDEBUG __version_sensitive_flags __unreg_opts_maybe __omit_ncg_maybe #undef __version_sensitive_flags #undef __unreg_opts_maybe #undef __omit_ncg_maybe #undef __omit_deforester_flag #if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */ hcs:: $(ALLHCS) # if HaskellCompilerType == HC_USE_HC_FILES HC = $(GHC) /* uses the driver herein */ # endif #endif /* using .hc files */ /* -DCOMPILING_GHC Used when compiling GHC. Some GHC utility modules are *also* part of the GHC library. There are a few bits of those modules that only apply to GHC itself and should not be in the library stuff. We use this CPP thing to isolate those bits. */ BuildPgmFromHaskellModules(hsc,$(ALLOBJS) parser/hsclink.o parser/hschooks.o,,libhsp.a) #if DoInstallGHCSystem == YES MakeDirectories(install, $(INSTLIBDIR_GHC)) InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC)) #endif /* set up for going either to .hc or to .o files */ #if GhcWithHscBuiltViaC == YES /*OLD:SuffixRule_hc_o() */ # if HaskellCompilerType == HC_USE_HC_FILES /* if we do not, we never try to compile .lhs files; we *blast* the macro we would normally use (HACK) (WDP 94/12) */ # undef HaskellCompileWithSpecifiedFlags # define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\ module.osuf : module.isuf \ _body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags) # define compile(module,isuf,extra_flags) \ HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags) # define compile_rec(module,isuf,extra_flags) \ HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags) # else /* we do! */ # define compile(module,isuf,extra_flags) \ HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags) # define compile_rec(module,isuf,extra_flags) \ HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags) # endif /* ... == HC_USE_HC_FILES */ #else /* ! booting from C */ # define compile(module,isuf,extra_flags) \ HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags) # define compile_rec(module,isuf,extra_flags) \ HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags) #endif /* ! booting from C */ #define if_ghc(x) x #if GhcBuilderVersion >= 26 # define if_ghc26(x) x #else # define if_ghc26(x) /*nothing*/ #endif /* OK, here we go: */ utils/Ubiq.hi : utils/Ubiq.lhi $(GHC_UNLIT) utils/Ubiq.lhi utils/Ubiq.hi basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi basicTypes/NameLoop.hi : basicTypes/NameLoop.lhi $(GHC_UNLIT) basicTypes/NameLoop.lhi basicTypes/NameLoop.hi deSugar/DsLoop.hi : deSugar/DsLoop.lhi $(GHC_UNLIT) deSugar/DsLoop.lhi deSugar/DsLoop.hi hsSyn/HsLoop.hi : hsSyn/HsLoop.lhi $(GHC_UNLIT) hsSyn/HsLoop.lhi hsSyn/HsLoop.hi prelude/PrelLoop.hi : prelude/PrelLoop.lhi $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.hi reader/RdrLoop.hi : reader/RdrLoop.lhi $(GHC_UNLIT) reader/RdrLoop.lhi reader/RdrLoop.hi rename/RnLoop.hi : rename/RnLoop.lhi $(GHC_UNLIT) rename/RnLoop.lhi rename/RnLoop.hi simplCore/SmplLoop.hi : simplCore/SmplLoop.lhi $(GHC_UNLIT) simplCore/SmplLoop.lhi simplCore/SmplLoop.hi typecheck/TcMLoop.hi : typecheck/TcMLoop.lhi $(GHC_UNLIT) typecheck/TcMLoop.lhi typecheck/TcMLoop.hi typecheck/TcLoop.hi : typecheck/TcLoop.lhi $(GHC_UNLIT) typecheck/TcLoop.lhi typecheck/TcLoop.hi types/TyLoop.hi : types/TyLoop.lhi $(GHC_UNLIT) types/TyLoop.lhi types/TyLoop.hi compile(absCSyn/AbsCUtils,lhs,) compile(absCSyn/CStrings,lhs,) compile(absCSyn/CLabel,lhs,) compile(absCSyn/Costs,lhs,) compile(absCSyn/HeapOffs,lhs,) compile(absCSyn/PprAbsC,lhs,) compile(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances)) compile(hsSyn/HsBinds,lhs,) compile(hsSyn/HsCore,lhs,) compile(hsSyn/HsDecls,lhs,) compile(hsSyn/HsExpr,lhs,) compile(hsSyn/HsImpExp,lhs,) compile(hsSyn/HsLit,lhs,) compile(hsSyn/HsMatches,lhs,) compile(hsSyn/HsPat,lhs,) compile(hsSyn/HsPragmas,lhs,) compile(hsSyn/HsTypes,lhs,) compile(hsSyn/HsSyn,lhs,if_ghc(-fno-omit-reexported-instances)) compile(basicTypes/Id,lhs,) compile(basicTypes/IdInfo,lhs,-K2m) compile(basicTypes/IdUtils,lhs,) compile(basicTypes/Literal,lhs,) compile(basicTypes/Name,lhs,) compile(basicTypes/NameTypes,lhs,) compile(basicTypes/PragmaInfo,lhs,) compile(basicTypes/ProtoName,lhs,) compile(basicTypes/SrcLoc,lhs,) compile(basicTypes/UniqSupply,lhs,) compile(basicTypes/Unique,lhs,) compile(codeGen/CgBindery,lhs,) compile(codeGen/CgCase,lhs,) compile(codeGen/CgClosure,lhs,) compile(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR)) compile(codeGen/CgCon,lhs,) compile(codeGen/CgConTbls,lhs,) compile(codeGen/CgExpr,lhs,) compile(codeGen/CgHeapery,lhs,) compile(codeGen/CgLetNoEscape,lhs,) compile(codeGen/CgMonad,lhs,) compile(codeGen/CgRetConv,lhs,) compile(codeGen/CgStackery,lhs,) compile(codeGen/CgTailCall,lhs,) compile(codeGen/CgUpdate,lhs,) compile(codeGen/CgUsages,lhs,) compile(codeGen/ClosureInfo,lhs,) compile(codeGen/CodeGen,lhs,) compile(codeGen/SMRep,lhs,) compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances)) compile(coreSyn/CoreUtils,lhs,) compile(coreSyn/CoreLift,lhs,) compile(coreSyn/CoreLint,lhs,) compile(coreSyn/CoreSyn,lhs,) compile(coreSyn/PprCore,lhs,) compile(coreSyn/CoreUnfold,lhs,) compile(coreSyn/FreeVars,lhs,) compile(deSugar/Desugar,lhs,) compile(deSugar/DsBinds,lhs,) compile(deSugar/DsCCall,lhs,) compile(deSugar/DsExpr,lhs,) compile(deSugar/DsGRHSs,lhs,) compile(deSugar/DsHsSyn,lhs,) compile(deSugar/DsListComp,lhs,) compile(deSugar/DsMonad,lhs,) compile(deSugar/DsUtils,lhs,) compile(deSugar/Match,lhs,) compile(deSugar/MatchCon,lhs,) compile(deSugar/MatchLit,lhs,) compile(main/CmdLineOpts,lhs,if_ghc(-fvia-C)) compile(main/ErrUtils,lhs,) compile(main/Main,lhs,if_ghc(-fvia-C)) compile(main/MainMonad,lhs,) compile(main/MkIface,lhs,) #if GhcWithNativeCodeGen == YES compile(nativeGen/AbsCStixGen,lhs,) compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR)) compile(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR)) compile(nativeGen/MachDesc,lhs,) compile(nativeGen/Stix,lhs,) compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/StixInteger,lhs,) compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/StixPrim,lhs,) # if i386_TARGET_ARCH compile(nativeGen/I386Desc,lhs,) compile(nativeGen/I386Code,lhs,-I$(NATIVEGEN_DIR) if_ghc(-monly-4-regs)) compile(nativeGen/I386Gen,lhs,) # endif # if sparc_TARGET_ARCH compile(nativeGen/SparcDesc,lhs,) compile(nativeGen/SparcCode,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/SparcGen,lhs,) # endif # if alpha_TARGET_ARCH compile(nativeGen/AlphaDesc,lhs,) compile(nativeGen/AlphaCode,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/AlphaGen,lhs,) # endif #endif compile(prelude/PrelInfo,lhs,) compile(prelude/PrelMods,lhs,) compile(prelude/PrelVals,lhs,) compile(prelude/PrimRep,lhs,-I$(COMPINFO_DIR)) compile(prelude/PrimOp,lhs,-K3m -H10m) compile(prelude/TysPrim,lhs,) compile(prelude/TysWiredIn,lhs,) compile(profiling/SCCauto,lhs,) compile(profiling/SCCfinal,lhs,) compile(profiling/CostCentre,lhs,) compile(reader/PrefixSyn,lhs,) compile(reader/PrefixToHs,lhs,) compile(reader/ReadPrefix,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser '-#include"hspincl.h"')) compile(reader/ReadPragmas,lhs,) compile(reader/RdrHsSyn,lhs,) compile(rename/Rename,lhs,) compile(rename/RnPass1,lhs,) compile(rename/RnPass2,lhs,) compile(rename/RnPass3,lhs,) compile(rename/RnPass4,lhs,) compile(rename/RnUtils,lhs,) compile(rename/RnHsSyn,lhs,) compile(rename/RnBinds4,lhs,) compile(rename/RnExpr4,lhs,) compile(rename/RnMonad12,lhs,) compile(rename/RnMonad3,lhs,) compile(rename/RnMonad4,lhs,) compile(simplCore/BinderInfo,lhs,) compile(simplCore/ConFold,lhs,) compile(simplCore/FloatIn,lhs,) compile(simplCore/FloatOut,lhs,) compile(simplCore/LiberateCase,lhs,) compile(simplCore/MagicUFs,lhs,) compile(simplCore/OccurAnal,lhs,) compile(simplCore/AnalFBWW,lhs,) compile(simplCore/FoldrBuildWW,lhs,) compile(simplCore/SAT,lhs,) compile(simplCore/SATMonad,lhs,) compile(simplCore/SetLevels,lhs,) compile(simplCore/SimplCase,lhs,) compile(simplCore/SimplCore,lhs,) compile(simplCore/SimplEnv,lhs,) compile(simplCore/SimplMonad,lhs,) compile(simplCore/SimplPgm,lhs,) compile(simplCore/SimplUtils,lhs,) compile(simplCore/SimplVar,lhs,) compile(simplCore/Simplify,lhs,) compile(simplStg/SatStgRhs,lhs,) compile(simplStg/LambdaLift,lhs,) compile(simplStg/StgVarInfo,lhs,) compile(simplStg/UpdAnal,lhs,) compile(simplStg/StgStats,lhs,) compile(simplStg/StgSATMonad,lhs,) compile(simplStg/StgSAT,lhs,) compile(simplStg/SimplStg,lhs,) #if GhcWithDeforester == YES compile(deforest/Core2Def,lhs,) compile(deforest/Cyclic,lhs,) compile(deforest/Def2Core,lhs,) compile(deforest/DefExpr,lhs,) compile(deforest/DefSyn,lhs,) compile(deforest/DefUtils,lhs,) compile(deforest/Deforest,lhs,) compile(deforest/TreelessForm,lhs,) #endif compile(specialise/Specialise,lhs,) compile(specialise/SpecEnv,lhs,) compile(specialise/SpecUtils,lhs,) compile(stgSyn/CoreToStg,lhs,) compile(stgSyn/StgUtils,lhs,) compile(stgSyn/StgLint,lhs,) compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances)) compile(stranal/SaAbsInt,lhs,) compile(stranal/SaLib,lhs,) compile(stranal/StrictAnal,lhs,) compile(stranal/WorkWrap,lhs,) compile(stranal/WwLib,lhs,) compile(typecheck/GenSpecEtc,lhs,) compile(typecheck/Inst,lhs,) compile(typecheck/TcHsSyn,lhs,) compile(typecheck/TcBinds,lhs,) compile(typecheck/TcClassDcl,lhs,) compile(typecheck/TcDefaults,lhs,) compile(typecheck/TcDeriv,lhs,) compile(typecheck/TcExpr,lhs,) compile(typecheck/TcGRHSs,lhs,) compile(typecheck/TcGenDeriv,lhs,) compile(typecheck/TcIfaceSig,lhs,) compile(typecheck/TcInstDcls,lhs,) compile(typecheck/TcInstUtil,lhs,) compile(typecheck/TcMatches,lhs,) compile(typecheck/TcModule,lhs,) compile(typecheck/TcMonad,lhs,) compile(typecheck/TcKind,lhs,) compile(typecheck/TcType,lhs,) compile(typecheck/TcEnv,lhs,) compile(typecheck/TcMonoType,lhs,) compile(typecheck/TcPat,lhs,) compile(typecheck/TcPragmas,lhs,) compile(typecheck/TcSimplify,lhs,) compile(typecheck/TcTyClsDecls,lhs,) compile(typecheck/TcTyDecls,lhs,) compile(typecheck/Typecheck,lhs,) compile(typecheck/Unify,lhs,) compile(types/Class,lhs,) compile(types/Kind,lhs,) compile(types/PprType,lhs,) compile(types/TyCon,lhs,) compile(types/TyVar,lhs,) compile(types/Usage,lhs,) compile(types/Type,lhs,) compile(utils/Argv,lhs,if_ghc(-fvia-C)) compile(utils/Bag,lhs,) compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs)) compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */ compile(utils/Digraph,lhs,) compile(utils/FiniteMap,lhs,) compile(utils/ListSetOps,lhs,) compile(utils/Maybes,lhs,) compile(utils/OrdList,lhs,) compile(utils/Outputable,lhs,) compile(utils/PprStyle,lhs,) compile(utils/Pretty,lhs,) compile(utils/SST,lhs,if_ghc(-fvia-C)) compile(utils/UniqFM,lhs,) compile(utils/UniqSet,lhs,) compile(utils/Unpretty,lhs,) compile(utils/MatchEnv,lhs,) compile(utils/Util,lhs,) /* for convenience in cross-compiling */ objs:: $(ALLOBJS) /* *** parser ************************************************* */ YACC_OPTS = -d CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */ XCOMM D_DEBUG = -DDEBUG CPP_DEFINES = $(D_DEBUG) HSP_SRCS_C = parser/constr.c \ parser/binding.c \ parser/pbinding.c \ parser/coresyn.c \ parser/entidt.c \ parser/hpragma.c \ parser/hslexer.c \ parser/hsparser.tab.c \ parser/id.c \ parser/import_dirlist.c \ parser/infix.c \ parser/list.c \ parser/literal.c \ parser/maybe.c \ parser/either.c \ parser/qid.c \ parser/syntax.c \ parser/tree.c \ parser/ttype.c \ parser/type2context.c \ parser/util.c HSP_OBJS_O = parser/constr.o \ parser/binding.o \ parser/pbinding.o \ parser/coresyn.o \ parser/entidt.o \ parser/hpragma.o \ parser/hslexer.o \ parser/hsparser.tab.o \ parser/id.o \ parser/import_dirlist.o \ parser/infix.o \ parser/list.o \ parser/literal.o \ parser/maybe.o \ parser/either.o \ parser/qid.o \ parser/syntax.o \ parser/tree.o \ parser/ttype.o \ parser/type2context.o \ parser/util.o /* this is for etags */ REAL_HSP_SRCS_C = parser/main.c \ parser/hschooks.c \ parser/hsclink.c \ parser/id.c \ parser/util.c \ parser/syntax.c \ parser/type2context.c \ parser/import_dirlist.c \ parser/infix.c \ parser/printtree.c UgenNeededHere(all depend) /* Most hsp files are in libhsp.a, so we can either make a standalone parser, or incorporate the files into the hsc compiler directly (WDP 94/10) */ NormalLibraryTarget(hsp,$(HSP_OBJS_O)) /* We need the hsp program for hstags to work! */ BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a) #if DoInstallGHCSystem == YES MakeDirectories(install, $(INSTLIBDIR_GHC)) InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC)) #endif /* DoInstall... */ YaccRunWithExpectMsg(parser/hsparser,16,0) UgenTarget(parser/constr) UgenTarget(parser/binding) UgenTarget(parser/pbinding) UgenTarget(parser/coresyn) UgenTarget(parser/entidt) UgenTarget(parser/hpragma) UgenTarget(parser/list) UgenTarget(parser/literal) UgenTarget(parser/maybe) UgenTarget(parser/either) UgenTarget(parser/qid) UgenTarget(parser/tree) UgenTarget(parser/ttype) UGENS_C = parser/constr.c \ parser/binding.c \ parser/pbinding.c \ parser/coresyn.c \ parser/entidt.c \ parser/literal.c \ parser/list.c \ parser/maybe.c \ parser/either.c \ parser/qid.c \ parser/hpragma.c \ parser/tree.c \ parser/ttype.c /* Putting the -#include"hspincl.h" option into the PARSER_HS_OPTS line really does not work (it depends on the 'make' that you use). */ PARSER_HS_OPTS = if_ghc(-fvia-C -I$(COMPINFO_DIR) -Iparser) compile(parser/UgenAll,lhs,if_ghc(-fvia-C)) compile(parser/UgenUtil,lhs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_constr,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_binding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_pbinding,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_coresyn,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_entidt,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_hpragma,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_list,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_literal,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_maybe,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_either,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_qid,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_tree,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"') /* finished with local macros */ #undef compile #undef compile_rec #undef if_ghc /* *** misc *************************************************** */ DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS) SIMPL_SRCS_LHS #if GhcWithHscBuiltViaC == NO MKDEPENDHS_OPTS= -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h #else /* booting from .hc */ MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR) -x HsVersions.h #endif /* booting from .hc files */ #if HaskellCompilerType != HC_USE_HC_FILES /* otherwise, the dependencies jeopardize our .hc files -- which are all we have! */ HaskellDependTarget( $(DEPSRCS) ) #endif ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) ) #if GhcWithHscBuiltViaC == YES ExtraStuffToClean( $(ALLHCS) ) #endif ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) ) ClearTagsFile() HsTagsTarget( $(ALLSRCS_LHS) ) HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR) /* count the number of lines in the source files */ count_lines :: ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS) /* accumulate similar info about the sizes of object files */ count_bytes :: ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)