[project @ 1996-11-15 17:29:21 by sof]
[ghc-hetmet.git] / ghc / mkworld / only4-ghc.jm
index 2279ad1..15b1c0f 100644 (file)
@@ -1,4 +1,12 @@
-# line 8 "only4-ghc.ljm"
+#if 0
+%************************************************************************
+%*                                                                     *
+\section[mkworld-only4-ghc]{Extra things ``only for'' for the @ghc@ project}
+%*                                                                     *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
 /* Project identification - name and version */
 
 #ifndef ProjectName
@@ -6,7 +14,7 @@
 #endif
 /* ProjectVersion is something printable */
 #ifndef ProjectVersion
-#define ProjectVersion  0.26
+#define ProjectVersion  2.01
 #endif
 /* A patchlevel change is something *very minor* */
 #ifndef ProjectPatchLevel
 #endif
 /* GhcBuildeeVersion is something CPP-testable (ProjectVersion * 100) */
 #ifndef GhcBuildeeVersion
-#define GhcBuildeeVersion  26
+#define GhcBuildeeVersion  201
 #endif
-# line 29 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+Make variables that say where the source to main pieces of the system live:
+\begin{code}
+#endif /* 0 */
 /* state of the source world */
 GHC_DRIVERSRC    = $(TOP)/ghc/driver
 GHC_COMPILERSRC  = $(TOP)/ghc/compiler
@@ -25,12 +38,24 @@ GHC_LIBSRC   = $(TOP)/ghc/lib
 GHC_INCLUDESRC   = $(TOP)/ghc/includes
 GHC_UTILSRC     = $(TOP)/ghc/utils
 GHC_BOOKSRC     = $(TOP)/ghc/book
-# line 41 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+Include definitions (usually to go with generated C):
+\begin{code}
+#endif /* 0 */
 #ifndef GhcIncludesDir
 #define GhcIncludesDir $(GHC_INCLUDESRC)
 #endif
 GHC_INCLUDES = GhcIncludesDir
-# line 51 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+A make variable that's occasionally very important: we use \tr{GHC_*}
+when we really mean GHC, rather than \tr{HC*}, which just means ``the
+standard Haskell compiler'' (whatever that is).
+\begin{code}
+#endif /* 0 */
 #ifndef AllProjectsGhcOpts
 #define AllProjectsGhcOpts /*none*/
 #endif
@@ -60,7 +85,23 @@ GHC_RTS_STYLE = 'ghc'
 GenerateOptionsMakeVars(GHC,OPTS,AllProjectsGhcOpts,PlatformGhcOpts,ProjectGhcOpts,SetupGhcOpts)
 
 GHCFLAGS=$(GLUED_CPP_DEFINES) $(GLUED_GHC_OPTS)
-# line 95 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%*                                                                     *
+\subsection{What to build}
+%*                                                                     *
+%************************************************************************
+
+%************************************************************************
+%*                                                                     *
+\subsubsection{Include or leave out these individual ``features''}
+%*                                                                     *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
 /* build York interpreter as well as Glasgow compiler
 */
 #ifndef BuildYorkInterpreter
@@ -73,13 +114,23 @@ GHCFLAGS=$(GLUED_CPP_DEFINES) $(GLUED_GHC_OPTS)
 #ifndef UseSemantiqueStrictnessAnalyser
 #define UseSemantiqueStrictnessAnalyser NO
 #endif
-# line 116 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%*                                                                     *
+\subsection{Installation: whether to, where to, what to}
+%*                                                                     *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
 /* defaults for which pieces should be installed */
 /* ToDo: possibly obsolete */
 #ifndef DoInstallGHCSystem
 #define DoInstallGHCSystem     YES
 #endif /* DoInstallGHCSystem */
-# line 124 "only4-ghc.ljm"
+
 /* ------------------------------------------------------------------ */
 /* compiler-proper subsystem:
     the lib/data bits are installed w/ a version number as well
@@ -114,12 +165,49 @@ INSTBINDIR_GHC    = InstBinDir_GHC
 INSTSCRIPTDIR_GHC = InstScriptDir_GHC
 INSTLIBDIR_GHC    = InstLibDir_GHC
 INSTDATADIR_GHC   = InstDataDir_GHC
-# line 183 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%*                                                                     *
+\subsection{Configuring the driver}
+%*                                                                     *
+%************************************************************************
+
+The driver script is the thing that glues the compilation system
+together.  It needs to know what is/isn't included in the system,
+e.g., what garbage-collectors are catered for.
+
+Mkworld records the needed information in make variables (e.g.,
+\tr{$(GHC_HSCPP)}), and we then `msub' that into the driver (perl)
+script.  Note: ALL configuration info should be HERE (not hacked into
+the script)!
+
+The first chunk of stuff here is mkworld boilerplate and probably
+doesn't need fiddling.  Once we get into what C compiler(s) to use for
+compiling .hc files, what libraries are available, etc., there may be
+something to tweak (but not here -- in a `setup' file, please!)  There
+are further comments where the tweakables begin...
+
+First, the driver can be installed under any old name; here's the default:
+\begin{code}
+#endif /* 0 */
 #ifndef GhcDriverInstallName
 #define GhcDriverInstallName ghc
 #endif /* ! GhcDriverInstallName */
 GHC_DRIVER_INST_NAME = GhcDriverInstallName
-# line 197 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+%************************************************************************
+%*                                                                     *
+\subsubsection{Where to find the programs for the various phases}
+%*                                                                     *
+%************************************************************************
+
+First, the driver itself:
+\begin{code}
+#endif /* 0 */
 /* ghc: std driver for compilation system */
 #ifndef GhcDriverCmd
 #define GhcDriverCmd $(GHC_DRIVERSRC)/ghc
@@ -133,7 +221,16 @@ __SomeUtilNeededHere(target,$(GHC),$(GHC_DRIVERSRC),all)
 
 /* could be GHC_DRIVER, but GHC is its common name */
 GHC = GhcDriverCmd
-# line 218 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{unlit}, to de-literatise a source file, is from the HBC
+distribution.  See utils-ghc.
+
+\tr{hscpp}: runs C pre-processor but converts \tr{#line}s to Haskell pragmas;
+is platform-independent.
+\begin{code}
+#endif /* 0 */
 #ifndef HsCppCmd
 #define HsCppCmd $(GHC_HSCPPSRC)/hscpp
 #endif
@@ -145,7 +242,12 @@ __SomeUtilNeededHere(target,$(GHC_HSCPP),$(GHC_HSCPPSRC),hscpp)
 
 GHC_HSCPP    = HsCppCmd $(ALLPROJ_CPP_DEFINES)
 GHC_HSCPPSRC = $(GHC_UTILSRC)/hscpp
-# line 233 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{hsp}: std Haskell parser.
+\begin{code}
+#endif /* 0 */
 #ifndef HsParserCmd
 #define HsParserCmd $(GHC_HSPSRC)/hsp
 #endif
@@ -157,7 +259,12 @@ __SomeUtilNeededHere(target,$(GHC_HSP),$(GHC_HSPSRC),hsp)
 
 GHC_HSP    = HsParserCmd
 GHC_HSPSRC = $(GHC_HSCSRC)
-# line 248 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{hsc}: std Haskell compiler.
+\begin{code}
+#endif /* 0 */
 #ifndef HsCompilerCmd
 #define HsCompilerCmd $(GHC_HSCSRC)/hsc
 #endif
@@ -169,7 +276,12 @@ __SomeUtilNeededHere(target,$(GHC_HSC),$(GHC_HSCSRC),hsc)
 
 GHC_HSC    = HsCompilerCmd
 GHC_HSCSRC = $(GHC_COMPILERSRC)
-# line 263 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+\tr{SysMan}: PVM-controlling program for parallel Haskell.
+\begin{code}
+#endif /* 0 */
 #ifndef SysManCmd
 #define SysManCmd $(GHC_RUNTIMESRC)/gum/SysMan
 #endif
@@ -181,7 +293,52 @@ __SomeUtilNeededHere(target,$(GHC_SYSMAN),$(GHC_SYSMANSRC),gum/SysMan)
 
 GHC_SYSMAN    = SysManCmd
 GHC_SYSMANSRC = $(GHC_RUNTIMESRC)
-# line 318 "only4-ghc.ljm"
+#if 0
+\end{code}
+
+For an ``assembler'' and a ``linker,'' the driver uses the same
+program as it used for C compilation; this means libraries and things
+are likely to be picked up correctly.
+
+%************************************************************************
+%*                                                                     *
+\subsubsection{Stuff for the C-compiling phase in particular...}
+%*                                                                     *
+%************************************************************************
+
+{\em High-level assembler}: C compiler with which to compile \tr{.hc} files.
+
+There are {\em three} things to set:
+\begin{enumerate}
+\item
+C compilers to use:
+\begin{itemize}
+\item
+compiler to use for ``debugging'' compilation (@GHC_DEBUG_HILEV_ASM@)
+\item
+compiler to use for ``optimising'' compiling (w/ regs magic, etc)
+(@GHC_OPT_HILEV_ASM@)
+This must be GCC; otherwise opt compiling must be turned off.
+\end{itemize}
+
+\item
+Whether or not you can do the ``optimising''-style compilation (set
+@GHC_GCC_IS_AVAILABLE@).
+\end{enumerate}
+
+For options that should always be applied {\em for this project},
+set the @ProjectGhcOpts@ variable...
+      
+Similarly, for a particular {\em setup}, use @SetupGhcOpts@...
+
+%************************************************************************
+%*                                                                     *
+\subsubsubsection{Which C compiler to use (GCC is best)}
+%*                                                                     *
+%************************************************************************
+
+\begin{code}
+#endif /* 0 */
 /*  NON-OPTIMISING C COMPILATION: ==================================
 
     We can use GCC 2.n for the non-optimising (normal) .hc C
@@ -203,7 +360,7 @@ GHC_SYSMANSRC = $(GHC_RUNTIMESRC)
 #endif /* ! gcc */
 #endif /* GhcDebuggingHighLevelAsmCmd */
 GHC_DEBUG_HILEV_ASM = GhcDebuggingHighLevelAsmCmd
-# line 342 "only4-ghc.ljm"
+
 /*  OPTIMISING C COMPILATION (regs, etc): ==========================
 
     Must use GCC 2.n for this
@@ -229,3 +386,6 @@ GHC_GCC_IS_AVAILABLE = 0
 #endif /* ! gcc */
 #endif /* GhcOptHighLevelAsmCmd */
 GHC_OPT_HILEV_ASM = GhcOptHighLevelAsmCmd
+#if 0
+\end{code}
+#endif /* 0 */