/* 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() .SUFFIXES: .lhi .lhi.hi: $(RM) $@ $(GHC_UNLIT) $< $@ @chmod 444 $@ /* 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: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_entidt.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/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/FieldLabel.lhs \ basicTypes/Id.lhs \ basicTypes/IdInfo.lhs \ basicTypes/IdUtils.lhs \ basicTypes/Literal.lhs \ basicTypes/Name.lhs \ basicTypes/PprEnv.lhs \ basicTypes/PragmaInfo.lhs \ basicTypes/SrcLoc.lhs \ basicTypes/UniqSupply.lhs \ basicTypes/Unique.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_HS \ rename/ParseIface.hs #define RENAMERSRCS_LHS \ rename/ParseUtils.lhs \ rename/RnHsSyn.lhs \ rename/RnMonad.lhs \ rename/Rename.lhs \ rename/RnNames.lhs \ rename/RnSource.lhs \ rename/RnBinds.lhs \ rename/RnExpr.lhs \ rename/RnIfaces.lhs \ rename/RnUtils.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/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 #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 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 DEFORESTER_SRCS_LHS #define STG_SRCS_LHS \ stgSyn/CoreToStg.lhs \ stgSyn/StgSyn.lhs \ stgSyn/StgUtils.lhs \ stgSyn/StgLint.lhs \ profiling/SCCfinal.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 #define BACKSRCS_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*/ # define NATIVEGEN_SRCS_LHS \ nativeGen/AbsCStixGen.lhs \ nativeGen/AsmCodeGen.lhs \ nativeGen/AsmRegAlloc.lhs \ nativeGen/MachCode.lhs \ nativeGen/MachMisc.lhs \ nativeGen/MachRegs.lhs \ nativeGen/PprMach.lhs \ nativeGen/RegAllocInfo.lhs \ nativeGen/Stix.lhs \ nativeGen/StixInfo.lhs \ nativeGen/StixInteger.lhs \ nativeGen/StixPrim.lhs \ nativeGen/StixMacro.lhs #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/CmdLineOpts.lhs \ main/ErrUtils.lhs \ main/MkIface.lhs \ main/Main.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 RENAMERSRCS_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 \ STG_SRCS_LHS \ BACKSRCS_LHS NATIVEGEN_SRCS_LHS #if GhcBuilderVersion >= 200 # define loop_hi(f) CAT3(f,_1_3,.hi) #else # define loop_hi(f) CAT2(f,.hi) #endif DELOOP_HIs = \ loop_hi(utils/Ubiq) \ loop_hi(absCSyn/AbsCLoop) \ loop_hi(basicTypes/IdLoop) \ loop_hi(codeGen/CgLoop1) \ loop_hi(codeGen/CgLoop2) \ loop_hi(deSugar/DsLoop) \ loop_hi(hsSyn/HsLoop) \ loop_hi(nativeGen/NcgLoop) \ loop_hi(prelude/PrelLoop) \ loop_hi(rename/RnLoop) \ loop_hi(simplCore/SmplLoop) \ loop_hi(typecheck/TcMLoop) \ loop_hi(typecheck/TcLoop) \ loop_hi(types/TyLoop) /* \ */ /* 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 # if GhcBuilderVersion >= 200 # define __version_sensitive_flags -O -fshow-import-specs # else # define __version_sensitive_flags -O -fshow-import-specs -fomit-derived-read -fomit-reexported-instances # endif #else # if GhcBuilderVersion >= 200 # define __version_sensitive_flags /*none*/ # else # define __version_sensitive_flags -fomit-derived-read -fomit-reexported-instances # endif #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 \ -Rghc-timing -I. -i$(SUBDIR_LIST) \ use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag #undef __version_sensitive_flags #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) parser/hschooks.o : parser/hschooks.c $(RM) $@ $(HC) -c -o $@ $(HCFLAGS) parser/hschooks.c #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: */ rename/ParseIface.hs : rename/ParseIface.y $(RM) rename/ParseIface.hs rename/ParseIface.hinfo happy -g rename/ParseIface.y @chmod 444 rename/ParseIface.hs 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,if_ghc(-K2m)) 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/FieldLabel,lhs,) compile(basicTypes/Id,lhs,) compile(basicTypes/IdInfo,lhs,-K2m) compile(basicTypes/IdUtils,lhs,) compile(basicTypes/Literal,lhs,) compile(basicTypes/Name,lhs,) compile(basicTypes/PprEnv,lhs,) compile(basicTypes/PragmaInfo,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/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/MachCode,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/MachMisc,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/MachRegs,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/PprMach,lhs,-I$(NATIVEGEN_DIR) if_ghc(-K2m)) compile(nativeGen/RegAllocInfo,lhs,-I$(NATIVEGEN_DIR)) compile(nativeGen/Stix,lhs,) compile(nativeGen/StixInfo,lhs,) compile(nativeGen/StixInteger,lhs,) compile(nativeGen/StixMacro,lhs,) compile(nativeGen/StixPrim,lhs,) #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/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/RdrHsSyn,lhs,) compile(rename/ParseIface,hs,-Onot) /* sigh */ compile(rename/ParseUtils,lhs,) compile(rename/RnHsSyn,lhs,) compile(rename/RnMonad,lhs,if_ghc(-fvia-C)) compile(rename/Rename,lhs,) compile(rename/RnNames,lhs,) compile(rename/RnSource,lhs,-H12m) compile(rename/RnBinds,lhs,) compile(rename/RnExpr,lhs,) compile(rename/RnIfaces,lhs,) compile(rename/RnUtils,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,-H12m if_ghc(-Onot)) /* -Onot for compile-space reasons */ 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,if_ghc(-fvia-C)) 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/Unify,lhs,) compile(types/Class,lhs,) compile(types/Kind,lhs,) compile(types/PprType,lhs,if_ghc26(-Onot)) /* avoid a 0.26 bug */ 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*/ /* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */ CPP_DEFINES = $(D_DEBUG) HSP_SRCS_C = parser/constr.c \ parser/binding.c \ parser/pbinding.c \ parser/entidt.c \ parser/hslexer.c \ parser/hsparser.tab.c \ parser/id.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/entidt.o \ parser/hslexer.o \ parser/hsparser.tab.o \ parser/id.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/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,12,0) parser/hslexer.o : parser/hslexer.c parser/hsparser.tab.h $(RM) $@ $(CC) $(CFLAGS) -c $< @if [ \( $(@D) != '.' \) -a \( $(@D) != './' \) ] ; then echo mv $(@F) $@ ; mv $(@F) $@ ; else exit 0 ; fi UgenTarget(parser,constr) UgenTarget(parser,binding) UgenTarget(parser,pbinding) UgenTarget(parser,entidt) 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/entidt.c \ parser/literal.c \ parser/list.c \ parser/maybe.c \ parser/either.c \ parser/qid.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_entidt,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) #if GhcBuilderVersion < 200 /* this will go away soon enough... (once 1.3 is settled in) */ MKDEPENDHS = mkdependHS-1.2 #endif #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! */ depend :: $(DELOOP_HIs) 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)