%************************************************************************
%*									*
\section[mkworld-plat-TRIGGERS]{Detecting the ``trigger symbol'' for this platform}
%*									*
%************************************************************************

See the end of this section for how to add support for another platform.

Note: Only a handful of platforms have been tested with these
configuration files (ToDo).

You do basically three things here:
\begin{enumerate}
\item
Set @PlatformFile@, etc.
\item
Turn {\em off} any vendor-supplied ``this-is-a-BLAH'' symbol(s).
\item
Turn {\em on} our own ``this-is-a-FOO-Architecture'' symbol(s).
\end{enumerate}

%************************************************************************
%*									*
\subsection[trigger-Sun]{Trigger stuff for Suns}
%*									*
%************************************************************************

\begin{code}
#ifdef sun
#define PlatformFile plat-sun.jm
#define PlatformIncludeFile <plat-sun.jm>

#undef sun
#define SunArchitecture
#endif /* sun */
\end{code}

%************************************************************************
%*									*
\subsection[trigger-Linux]{Trigger stuff for Linux}
%*									*
%************************************************************************

\begin{code}
#ifdef linux
#define PlatformFile plat-linux.jm
#define PlatformIncludeFile <plat-linux.jm>

#undef linux
#define LinuxArchitecture
#endif /* linux */
\end{code}

%************************************************************************
%*									*
\subsection[trigger-Alpha]{Trigger stuff for DEC Alpha running OSF1}
%*									*
%************************************************************************

\begin{code}
#if defined(__alpha) && defined(__osf__)
#define PlatformFile plat-alpha.jm
#define PlatformIncludeFile <plat-alpha.jm>

#undef __alpha
#undef __osf__
#define AlphaArchitecture
#endif /* alpha */
\end{code}

%************************************************************************
%*									*
\subsection[trigger-MIPS-RiscOS]{Trigger stuff for MIPS machines running RISCos}
%*									*
%************************************************************************

OLD: OLD: OLD:

@mipsriscos@ used instead of @riscos@ because another company (Acorn
Computers Ltd in the UK) has a RISC OS...  MIPS RISC/os cpp has no
unique symbol:	build @jmake@ with
@BOOTSTRAPCFLAGS=-Dmipsriscos@

\begin{code}
#ifdef mipsriscos
#define PlatformFile plat-mipsriscos.jm
#define PlatformIncludeFile <plat-mipsriscos.jm>

#undef mipsriscos
#undef mips
#define MipsRiscosArchitecture	/* for OS type */
#define MipsArchitecture	/* for chipset type */
/* now a dubious HostPlatform definition (there are various "mips" machines) ... */

/* ToDo: I admit these are done to suit the Glasgow /bin/arch */
/* It should probably be "umips" or "umipse[bl]", as appropriate */
#ifdef SYSTYPE_SYSV
#define HostPlatform	mips3000
#else
#define HostPlatform	mips
#endif
#endif /* mipsriscos */
\end{code}

%************************************************************************
%*									*
\subsection[triggers-UNTESTED]{Untested trigger stuff for other machines}
%*									*
%************************************************************************

COMPLETELY UNTESTED (and so commented out):

\begin{pseudocode}
#ifdef ultrix
#define PlatformIncludeFile <ultrix.cf>
#define PlatformFile ultrix.cf
#ifdef vax
#undef vax
#define VaxArchitecture
/* hypothetical HostPlatform; we do not have one */
#define HostPlatform	vax
#endif /* vax */
#ifdef mips
#undef mips
#define MipsArchitecture
/* hypothetical HostPlatform; we do not have one */
#define HostPlatform	pmax
#endif /* mips */
#undef ultrix
#define UltrixArchitecture
#endif /* ultrix */

#if defined(vax) && !defined(UltrixArchitecture)
#define PlatformIncludeFile <bsd.cf>
#define PlatformFile bsd.cf
#undef vax
#define VaxArchitecture
#endif
\end{pseudocode}

\begin{pseudocode}
#ifdef hpux
#define PlatformIncludeFile <hp.cf>
#define PlatformFile hp.cf
#undef hpux
#define HPArchitecture
#endif /* hpux */

#ifdef att
#define PlatformIncludeFile <att.cf>
#define PlatformFile att.cf
#undef att
#define ATTArchitecture
#endif /* att */

#ifdef apollo
#define PlatformIncludeFile <apollo.cf>
#define PlatformFile apollo.cf
#undef apollo
#define ApolloArchitecture
#endif /* apollo */

#ifdef sony
#define PlatformIncludeFile <sony.cf>
#define PlatformFile sony.cf
#undef sony
#define SonyArchitecture
#endif /* sony */

#ifdef M4310
#define PlatformIncludeFile <pegasus.cf>
#define PlatformFile pegasus.cf
#undef M4310
#define PegasusArchitecture
#endif /* M4310 */

#ifdef M4330
#define PlatformIncludeFile <m4330.cf>
#define PlatformFile m4330.cf
#undef	M4330
#define M4330Architecture
#endif /* M4330 */

#ifdef macII
/* A/UX cpp has no unique symbol:  build jmake with BOOTSTRAPCFLAGS=-DmacII */
#define PlatformIncludeFile <macII.cf>
#define PlatformFile macII.cf
#undef	macII
#define MacIIArchitecture
#endif /* macII */

#ifdef CRAY
#define PlatformIncludeFile <cray.cf>
#define PlatformFile cray.cf
#undef cray
#undef CRAY
#define CrayArchitecture
#endif /* CRAY */

#ifdef sgi
#define PlatformIncludeFile <sgi.cf>
#define PlatformFile sgi.cf
#undef sgi
#define SGIArchitecture
#undef mips
#define MipsArchitecture
#endif

#ifdef stellar
#define PlatformIncludeFile <stellar.cf>
#define PlatformFile stellar.cf
#undef stellar
#define StellarArchitecture
#endif

/*
 * A convenience for people running on rt's since they define ibm032, and for
 * people running AIX (note that AOS will no longer be supported by IBM).
 */
#if defined(ibm032) && !defined(ibm)
#define ibm
#endif

#if defined(aix) && !defined(ibm)
#define ibm
#endif

#if defined(ibm)
#define PlatformIncludeFile <ibm.cf>
#define PlatformFile ibm.cf
#undef ibm
#define IBMArchitecture
#ifdef i386
#undef i386
#define PS2Architecture
#endif
#ifdef ibm032
#undef ibm032
#define RtArchitecture
#endif
#ifdef aix
#undef aix
#define AIXArchitecture
#endif
#endif /* ibm */
\end{pseudocode}

%************************************************************************
%*									*
\subsection[triggers-failed]{If no trigger symbol worked...}
%*									*
%************************************************************************

We don't allow guessing at the platform: this will bomb gruesomely in
short order; it might mean that @BOOTSTRAPCFLAGS@ was not set when
building @jmake@.
\begin{code}
#ifndef PlatformIncludeFile
#define PlatformFile could-not-determine-the-platform-from-trigger-symbols
#define PlatformIncludeFile PlatformFile
#endif
\end{code}

%************************************************************************
%*									*
\subsection[triggers-adding-platform]{To add support for another platform...}
%*									*
%************************************************************************

\begin{enumerate}
\item
Identify a machine-specific CPP (``trigger'') symbol.  If your preprocessor 
doesn't have any built in, you'll need to add the symbol to the
@cpp_argv@ table in \tr{utils/jmake/jmake.c} and rebuild @jmake@ with the
@BOOTSTRAPCFLAGS@ variable set (see the macII for an example).
  
\item
Add all machine-specific CPP symbols (either defined by you or by
the preprocessor or compiler) to the @predefs@ table in 
@util/makedepend/main.c@.
  
\item
Put a new \tr{#ifdef} block above that defines @PlatformIncludeFile@,
@PlatformFile@, etc., for your new platform and then @#undefs@ the
machine-specific preprocessor symbols (to avoid problems with file
names).
  
\item
Create suitable \tr{*.jm} files (or ``literate'' equivalents).
\end{enumerate}