[project @ 1996-06-11 13:18:54 by partain]
[ghc-hetmet.git] / ghc / compiler / Jmakefile
index 8498896..a47b639 100644 (file)
@@ -27,6 +27,12 @@ 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
 */
@@ -114,8 +120,11 @@ 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 \
@@ -151,7 +160,6 @@ typecheck/TcPat.lhs \
 typecheck/TcSimplify.lhs \
 typecheck/TcTyClsDecls.lhs \
 typecheck/TcTyDecls.lhs \
-typecheck/Typecheck.lhs \
 typecheck/Unify.lhs
 
 /*
@@ -316,14 +324,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 \
@@ -344,7 +348,7 @@ 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   \
@@ -358,6 +362,28 @@ 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 =           \
+utils/Ubiq.hi          \
+absCSyn/AbsCLoop.hi    \
+basicTypes/IdLoop.hi   \
+codeGen/CgLoop1.hi     \
+codeGen/CgLoop2.hi     \
+deSugar/DsLoop.hi      \
+hsSyn/HsLoop.hi                \
+nativeGen/NcgLoop.hi   \
+prelude/PrelLoop.hi    \
+rename/RnLoop.hi       \
+simplCore/SmplLoop.hi  \
+typecheck/TcMLoop.hi   \
+typecheck/TcLoop.hi    \
+types/TyLoop.hi
+
 /*
 \
 */
@@ -379,7 +405,7 @@ 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
+#define __version_sensitive_flags -O /*-DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs*/ -fomit-reexported-instances -fshow-import-specs
 #else
 #define __version_sensitive_flags -fomit-reexported-instances
 #endif
@@ -473,35 +499,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
-
-absCSyn/AbsCLoop.hi : absCSyn/AbsCLoop.lhi
-       $(GHC_UNLIT) absCSyn/AbsCLoop.lhi absCSyn/AbsCLoop.hi
-basicTypes/IdLoop.hi : basicTypes/IdLoop.lhi
-       $(GHC_UNLIT) basicTypes/IdLoop.lhi basicTypes/IdLoop.hi
-codeGen/CgLoop1.hi : codeGen/CgLoop1.lhi
-       $(GHC_UNLIT) codeGen/CgLoop1.lhi codeGen/CgLoop1.hi
-codeGen/CgLoop2.hi : codeGen/CgLoop2.lhi
-       $(GHC_UNLIT) codeGen/CgLoop2.lhi codeGen/CgLoop2.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
-nativeGen/NcgLoop.hi : nativeGen/NcgLoop.lhi
-       $(GHC_UNLIT) nativeGen/NcgLoop.lhi nativeGen/NcgLoop.hi
-prelude/PrelLoop.hi : prelude/PrelLoop.lhi
-       $(GHC_UNLIT) prelude/PrelLoop.lhi prelude/PrelLoop.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 -i rename/ParseIface.hinfo rename/ParseIface.y
+       @chmod 444 rename/ParseIface.hs
 
 compile(absCSyn/AbsCUtils,lhs,)
 compile(absCSyn/CStrings,lhs,)
@@ -579,22 +580,21 @@ 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/MachCode,lhs,)
-compile(nativeGen/MachMisc,lhs,)
-compile(nativeGen/MachRegs,lhs,)
-compile(nativeGen/PprMach,lhs,)
-compile(nativeGen/RegAllocInfo,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))
+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,)
 #endif
 
@@ -615,8 +615,10 @@ 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,)
+compile(rename/ParseUtils,lhs,)
 compile(rename/RnHsSyn,lhs,)
-compile(rename/RnMonad,lhs,)
+compile(rename/RnMonad,lhs,if_ghc(-fvia-C))
 compile(rename/Rename,lhs,)
 compile(rename/RnNames,lhs,)
 compile(rename/RnSource,lhs,)
@@ -668,7 +670,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,)
 
@@ -698,7 +700,7 @@ 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,)
@@ -708,12 +710,11 @@ 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,)
@@ -759,7 +760,6 @@ HSP_SRCS_C =    parser/constr.c             \
                parser/hslexer.c        \
                parser/hsparser.tab.c   \
                parser/id.c             \
-               parser/import_dirlist.c \
                parser/infix.c          \
                parser/list.c           \
                parser/literal.c        \
@@ -779,7 +779,6 @@ HSP_OBJS_O =    parser/constr.o             \
                parser/hslexer.o        \
                parser/hsparser.tab.o   \
                parser/id.o             \
-               parser/import_dirlist.o \
                parser/infix.o          \
                parser/list.o           \
                parser/literal.o        \
@@ -800,7 +799,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
 
@@ -820,19 +818,19 @@ MakeDirectories(install, $(INSTLIBDIR_GHC))
 InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
 #endif /* DoInstall... */
 
-YaccRunWithExpectMsg(parser/hsparser,14,0)
+YaccRunWithExpectMsg(parser/hsparser,12,0)
 
-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)
+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        \
@@ -884,6 +882,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