[project @ 1996-07-25 20:43:49 by partain]
[ghc-hetmet.git] / ghc / compiler / Jmakefile
index aecfcbd..925f261 100644 (file)
@@ -25,14 +25,19 @@ SUBDIRS = __ghc_compiler_tests_dir
 */
 SuffixRules_flexish()
 SuffixRule_c_o()
-LitSuffixRule(.lprl,.prl) /* for makeSymbolList.prl */
+
+.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:envs:rename:typecheck:deSugar:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen:nativeGen:absCSyn:main:reader:profiling:deforest:parser
+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
@@ -59,9 +64,7 @@ NATIVEGEN_DIR=$(TOP_PWD)/$(CURRENT_DIR)/nativeGen
 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      \
@@ -76,7 +79,6 @@ parser/U_ttype.hs
 parser/UgenUtil.lhs    \
 parser/UgenAll.lhs     \
 reader/ReadPrefix.lhs  \
-reader/ReadPragmas.lhs \
 \
 reader/PrefixSyn.lhs   \
 reader/PrefixToHs.lhs  \
@@ -95,17 +97,17 @@ 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/FieldLabel.lhs      \
 basicTypes/Id.lhs              \
 basicTypes/IdInfo.lhs          \
 basicTypes/IdUtils.lhs         \
-basicTypes/PragmaInfo.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                 \
@@ -117,20 +119,20 @@ types/Type.lhs                    \
 \
 specialise/SpecEnv.lhs
 
+#define RENAMERSRCS_HS \
+rename/ParseIface.hs
 
 #define RENAMERSRCS_LHS \
-rename/RnPass1.lhs \
-rename/RnPass2.lhs \
-rename/RnPass3.lhs \
-rename/RnPass4.lhs \
+rename/ParseUtils.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
+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 \
@@ -157,7 +159,6 @@ typecheck/TcPat.lhs \
 typecheck/TcSimplify.lhs \
 typecheck/TcTyClsDecls.lhs \
 typecheck/TcTyDecls.lhs \
-typecheck/Typecheck.lhs \
 typecheck/Unify.lhs
 
 /*
@@ -181,6 +182,22 @@ 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 \
@@ -213,32 +230,14 @@ stranal/StrictAnal.lhs \
 stranal/SaLib.lhs \
 stranal/SaAbsInt.lhs \
 stranal/WwLib.lhs \
-stranal/WorkWrap.lhs \
-\
-profiling/SCCauto.lhs \
-profiling/SCCfinal.lhs
+stranal/WorkWrap.lhs DEFORESTER_SRCS_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 \
+#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 \
@@ -247,8 +246,9 @@ simplStg/UpdAnal.lhs \
 simplStg/StgStats.lhs \
 simplStg/StgSATMonad.lhs \
 simplStg/StgSAT.lhs \
-simplStg/SimplStg.lhs \
-\
+simplStg/SimplStg.lhs
+
+#define BACKSRCS_LHS \
 absCSyn/AbsCUtils.lhs \
 absCSyn/AbsCSyn.lhs \
 absCSyn/CLabel.lhs \
@@ -283,36 +283,21 @@ codeGen/CgUpdate.lhs
 # 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/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 \
-__machdep_nativegen_lhs /*arch-specific ones */
+nativeGen/StixMacro.lhs
 #endif
 
 #define UTILSRCS_LHS \
@@ -336,14 +321,10 @@ 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 \
-*/
+main/Main.lhs
 
 #define VBASICSRCS_LHS \
 prelude/PrelMods.lhs \
@@ -364,24 +345,45 @@ profiling/CostCentre.lhs \
 simplCore/BinderInfo.lhs \
 simplCore/MagicUFs.lhs
 
-ALLSRCS_HS = READERSRCS_HS
+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
+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)
 
 /*
-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.
 */
@@ -400,16 +402,17 @@ ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
 #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
+# 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
-#define __unreg_opts_maybe /*none*/
+# 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" */
@@ -417,12 +420,10 @@ ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
 #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
+       -Rghc-timing -I. -i$(SUBDIR_LIST) \
+       use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
 
 #undef __version_sensitive_flags
-#undef __unreg_opts_maybe
 #undef __omit_ncg_maybe
 #undef __omit_deforester_flag
 
@@ -447,6 +448,10 @@ HC = $(GHC) /* uses the driver herein */
 
 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))
@@ -502,31 +507,10 @@ HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
 
 /* 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
+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,)
@@ -539,7 +523,7 @@ 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/HsExpr,lhs,if_ghc(-K2m))
 compile(hsSyn/HsImpExp,lhs,)
 compile(hsSyn/HsLit,lhs,)
 compile(hsSyn/HsMatches,lhs,)
@@ -548,14 +532,14 @@ 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/NameTypes,lhs,)
+compile(basicTypes/PprEnv,lhs,)
 compile(basicTypes/PragmaInfo,lhs,)
-compile(basicTypes/ProtoName,lhs,)
 compile(basicTypes/SrcLoc,lhs,)
 compile(basicTypes/UniqSupply,lhs,)
 compile(basicTypes/Unique,lhs,)
@@ -604,34 +588,22 @@ 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/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,-I$(NATIVEGEN_DIR))
+compile(nativeGen/StixInfo,lhs,)
 compile(nativeGen/StixInteger,lhs,)
-compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
+compile(nativeGen/StixMacro,lhs,)
 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,)
@@ -642,28 +614,25 @@ 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/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/RnPass1,lhs,)
-compile(rename/RnPass2,lhs,)
-compile(rename/RnPass3,lhs,)
-compile(rename/RnPass4,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(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,)
@@ -708,7 +677,7 @@ compile(deforest/Deforest,lhs,)
 compile(deforest/TreelessForm,lhs,)
 #endif
 
-compile(specialise/Specialise,lhs,)
+compile(specialise/Specialise,lhs,-H12m if_ghc(-Onot)) /* -Onot for compile-space reasons */
 compile(specialise/SpecEnv,lhs,)
 compile(specialise/SpecUtils,lhs,)
 
@@ -738,22 +707,21 @@ compile(typecheck/TcInstDcls,lhs,)
 compile(typecheck/TcInstUtil,lhs,)
 compile(typecheck/TcMatches,lhs,)
 compile(typecheck/TcModule,lhs,)
-compile(typecheck/TcMonad,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/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/PprType,lhs,if_ghc26(-Onot)) /* avoid a 0.26 bug */
 compile(types/TyCon,lhs,)
 compile(types/TyVar,lhs,)
 compile(types/Usage,lhs,)
@@ -784,24 +752,19 @@ objs:: $(ALLOBJS)
 /* *** parser ************************************************* */
 
 YACC_OPTS = -d
-CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
+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 */
 
-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        \
@@ -817,13 +780,10 @@ HSP_SRCS_C =    parser/constr.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        \
@@ -844,7 +804,6 @@ REAL_HSP_SRCS_C = parser/main.c     \
                parser/util.c           \
                parser/syntax.c         \
                parser/type2context.c   \
-               parser/import_dirlist.c \
                parser/infix.c          \
                parser/printtree.c
 
@@ -857,40 +816,41 @@ UgenNeededHere(all depend)
 NormalLibraryTarget(hsp,$(HSP_OBJS_O))
 
 /* We need the hsp program for hstags to work! */
-BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a)
+/* BuildPgmFromCFiles(hsp,parser/printtree.o parser/main.o,,libhsp.a) */
 
 #if DoInstallGHCSystem == YES
-MakeDirectories(install, $(INSTLIBDIR_GHC))
-InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
+/* 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)
+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/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
 
@@ -905,9 +865,7 @@ 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"')
@@ -923,7 +881,12 @@ compile(parser/U_ttype,hs,$(PARSER_HS_OPTS) '-#include"hspincl.h"')
 
 /* *** misc *************************************************** */
 
-DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS) SIMPL_SRCS_LHS
+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
@@ -934,6 +897,7 @@ MKDEPENDHS_OPTS= -o .hc -I$(MAIN_INCLUDE_DIR) -I$(COMPINFO_DIR)  -x HsVersions.h
 #if HaskellCompilerType != HC_USE_HC_FILES
     /* otherwise, the dependencies jeopardize our .hc files --
        which are all we have! */
+depend :: $(DELOOP_HIs)
 HaskellDependTarget( $(DEPSRCS) )
 #endif