head     1.9883;
access   ;
symbols  ;
locks    ;comment  @@;


1.9883
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9882;

1.9882
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9881;

1.9881
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9880;

1.9880
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9879;

1.9879
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9878;

1.9878
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9877;

1.9877
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9876;

1.9876
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9875;

1.9875
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9874;

1.9874
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9873;

1.9873
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9872;

1.9872
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9871;

1.9871
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9870;

1.9870
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9869;

1.9869
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9868;

1.9868
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9867;

1.9867
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9866;

1.9866
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9865;

1.9865
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9864;

1.9864
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9863;

1.9863
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9862;

1.9862
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9861;

1.9861
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9860;

1.9860
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9859;

1.9859
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9858;

1.9858
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9857;

1.9857
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.9856;

1.9856
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.3070;

1.3070
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.3005;

1.3005
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2852;

1.2852
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2850;

1.2850
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2849;

1.2849
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2615;

1.2615
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2566;

1.2566
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2565;

1.2565
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2564;

1.2564
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2561;

1.2561
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2557;

1.2557
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2513;

1.2513
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2503;

1.2503
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2497;

1.2497
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2496;

1.2496
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2485;

1.2485
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2483;

1.2483
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2480;

1.2480
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1577;

1.1577
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1572;

1.1572
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1571;

1.1571
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1570;

1.1570
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1539;

1.1539
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1488;

1.1488
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1355;

1.1355
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1344;

1.1344
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.1319;

1.1319
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.486;

1.486
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.211;

1.211
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.67;

1.67
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.5;

1.5
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.4;

1.4
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     1.2;

1.2
date     2014.08.08.10.25.48;  author p4;  state Exp;
branches ;
next     ;


desc
@@


1.9883
log
@@
text
@#
# /+\
# +\	Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
# \+/
#
# This file is part of Jam - see jam.c for Copyright information.
#

#
# JAMBASE - jam 2.5 ruleset providing make(1)-like functionality
#
# Supports UNIX, NT, and VMS.
#
# 12/27/93 (seiwald) - purturb library sources with SOURCE_GRIST
# 04/18/94 (seiwald) - use '?=' when setting OS specific vars
# 04/21/94 (seiwald) - do RmTemps together
# 05/05/94 (seiwald) - all supported C compilers support -o: relegate
#		       RELOCATE as an option; set Ranlib to "" to disable it
# 06/01/94 (seiwald) - new 'actions existing' to do existing sources
# 08/25/94 (seiwald) - new ObjectCcFlags rule to append to per-target CCFLAGS
# 08/29/94 (seiwald) - new ObjectHdrs rule to append to per-target HDRS
# 09/19/94 (seiwald) - LinkLibraries and Undefs now append
#		     - Rule names downshifted.
# 10/06/94 (seiwald) - Dumb yyacc stuff moved into Jamfile.
# 10/14/94 (seiwald) - (Crude) support for .s, .C, .cc, .cpp, and .f files.
# 01/08/95 (seiwald) - Shell now handled with awk, not sed
# 01/09/95 (seiwald) - Install* now take dest directory as target
# 01/10/95 (seiwald) - All entries sorted.
# 01/10/95 (seiwald) - NT support moved in, with LauraW's help.
# 01/10/95 (seiwald) - VMS support moved in.
# 02/06/95 (seiwald) - ObjectC++Flags and SubDirC++Flags added.
# 02/07/95 (seiwald) - Iron out when HDRSEARCH uses "" or SEARCH_SOURCE.
# 02/08/95 (seiwald) - SubDir works on VMS.
# 02/14/95 (seiwald) - MkDir and entourage.
# 04/30/95 (seiwald) - Use install -c flag so that it copies, not moves.
# 07/10/95 (taylor) - Support for Microsoft C++.
# 11/21/96 (peterk) - Support for BeOS
# 07/19/99 (sickel) - Support for Mac OS X Server (and maybe client)
# 02/18/00 (belmonte)- Support for Cygwin.
# 12/08/03 (seiwald) - New YaccHdr to attribute #includes to generated .c.
# 11/22/13 (brett)   - Support for Darwin.

# Special targets defined in this file:
#
# all		- parent of first, shell, files, lib, exe
# first		- first dependent of 'all', for potential initialization
# shell		- parent of all Shell targets
# files		- parent of all File targets
# lib		- parent of all Library targets
# exe		- parent of all Main targets
# dirs		- parent of all MkDir targets
# clean		- removes all Shell, File, Library, and Main targets
# uninstall	- removes all Install targets
#

# Rules defined by this file:
#
# as obj.o : source.s ;			.s -> .o
# Bulk dir : files ;			populate directory with many files
# Cc obj.o : source.c ;			.c -> .o
# C++ obj.o : source.cc ;		.cc -> .o
# Clean clean : sources ;		remove sources with 'jam clean'
# File dest : source ;			copy file
# Fortran obj.o : source.f ;		.f -> .o
# GenFile source.c : program args ;	make custom file
# HardLink target : source ;		make link from source to target
# HdrRule source : headers ;		handle #includes
# InstallInto dir : sources ;		install any files
# InstallBin dir : sources ;		install binaries
# InstallLib dir : sources ;		install files
# InstallFile dir : sources ;		install files
# InstallMan dir : sources ;		install man pages
# InstallShell dir : sources ;		install shell scripts
# Lex source.c : source.l ;		.l -> .c
# Library lib : source ;		archive library from compiled sources
# LibraryFromObjects lib : objects ;	archive library from objects
# LinkLibraries images : libraries ;	bag libraries onto Mains
# Main image : source ;			link executable from compiled sources
# MainFromObjects image : objects ;	link executable from objects
# MkDir dir ;				make a directory, if not there
# Object object : source ;		compile object from source
# ObjectCcFlags source : flags ;	add compiler flags for object
# ObjectC++Flags source : flags ;	add compiler flags for object
# ObjectHdrs source : dirs ;		add include directories for object
# Objects sources ;			compile sources
# RmTemps target : sources ;		remove temp sources after target made
# Setuid images ;			mark executables Setuid
# SoftLink target : source ;		make symlink from source to target
# SubDir TOP d1 d2 ... ;		start a subdirectory Jamfile
# SubDirCcFlags flags ;			add compiler flags until next SubDir
# SubDirC++Flags flags ;		add compiler flags until next SubDir
# SubDirHdrs d1 d2 ... ;		add include dir until next SubDir
# SubInclude TOP d1 d2 ... ;		include a subdirectory Jamfile
# Shell exe : source ;			make a shell executable
# Undefines images : symbols ;		save undef's for linking
# UserObject object : source ;		handle unknown suffixes for Object
# Yacc source.c : source.y ;		.y -> .c
#
# Utility rules that have no side effects (not supported):
#
# FAppendSuffix f1 f2 ... : $(SUF) ; 	return $(<) with suffixes
# FDirName d1 d2 ... ;			return path from root to dir
# FGrist d1 d2 ... ;			return d1!d2!...
# FGristFiles value ;			return $(value:G=$(SOURCE_GRIST))
# FGristSourceFiles value ;		return $(value:G=$(SOURCE_GRIST))
# FStripCommon v1 : v2 ; 		strip common initial parts of v1 v2
# FReverse a1 a2 ... ;			return ... a2 a1
# FRelPath d1 : d2 ;			return rel path from d1 to d2
# FSubDir d1 d2 ... ;			return path to root
#


# Brief review of the jam language:
#
# Statements:
#	rule RULE - statements to process a rule
#	actions RULE - system commands to carry out target update
#
# Modifiers on actions:
#	together - multiple instances of same rule on target get executed
#		   once with their sources ($(>)) concatenated
#	updated - refers to updated sources ($(>)) only
#	ignore - ignore return status of command
#	quietly - don't trace its execution unless verbose
#	piecemeal - iterate command each time with a small subset of $(>)
#	existing - refers to currently existing sources ($(>)) only
#	bind vars - subject to binding before expanding in actions
#
# Special rules:
#	Always - always build a target
#	Depends - builds the dependency graph
#	Echo - blurt out targets on stdout
#	Exit - blurt out targets and exit
#	Includes - marks sources as headers for target (a codependency)
#	NoCare - don't panic if the target can't be built
#	NoUpdate - create the target if needed but never update it
#	NotFile - ignore the timestamp of the target (it's not a file)
#	Temporary - target need not be present if sources haven't changed
#
# Special variables set by jam:
#	$(<) - targets of a rule (to the left of the :)
#	$(>) - sources of a rule (to the right of the :)
#	$(xxx) - true on xxx (UNIX, VMS, NT, OS2, MAC)
#	$(OS) - name of OS - varies wildly
#	$(JAMVERSION) - version number (2.5)
#
# Special variables used by jam:
#	SEARCH - where to find something (used during binding and actions)
#	LOCATE - where to plop something not found with SEARCH
#	HDRRULE - rule to call to handle include files
#	HDRSCAN - egrep regex to extract include files
#
# Special targets:
#	all - default if none given on command line
#

# for perforce use -- jambase version

JAMBASEDATE = 2012.10.04  ;

# Initialize variables
#

#
# OS specific variable settings
#

if $(NT)
{
	MV			?= move /y ;
	CP			?= copy ;
	RM			?= del /f/q ;
	RMDIR		?= rmdir /s/q ;
	SLASH		?= \\ ;
	SUFLIB		?= .lib ;
	SUFOBJ		?= .obj ;
	SUFEXE		?= .exe ;

	if $(BCCROOT)	# Borland
	{
		AR			?= tlib /C /P64 ;
		CC			?= bcc32 ;
		CCFLAGS		?= -v -w- -q -DWIN -tWR -tWM -tWC ;
		C++			?= $(CC) ;
		C++FLAGS	?= $(CCFLAGS) -P ;
		LINK		?= $(CC) ;
		LINKFLAGS	?= $(CCFLAGS) ;
		STDLIBPATH	?= $(BCCROOT)\\lib ;
		STDHDRS		?= $(BCCROOT)\\include ;
		NOARSCAN	?= true ;
	}
	else			# Visual Studio 8 or later
	{
		local mflags ;
		switch $(OSPLAT)
		{
		case X86  :	AS ?= ml     ;
		case X64  :	AS ?= ml64   ;	mflags = -D_M_AMD64 /favor:blend ;
		case IA64 :	AS ?= ias    ;	mflags = -D_M_IA64 ;
		case ARM  :	AS ?= armasm ;  mflags = -D_M_ARM -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE ;
		}

		AR			?= lib /MACHINE:$(OSPLAT) ;
		CC			?= cl /nologo ;
		CCFLAGS		?= $(mflags) -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
		C++			?= $(CC) ;
		C++FLAGS	?= $(CCFLAGS) ;
		OPTIM		?= "" ;
		LINK		?= link /nologo ;
		LINKFLAGS	?= /MACHINE:$(OSPLAT) ;
		LINKLIBS	?= libcmt.lib oldnames.lib kernel32.lib ;
		STDHDRS     ?= ;
		UNDEFFLAG	?= "/u _" ;
	}
}
else if $(MINGW)
{
	CC			?= gcc ;
	C++			?= g++ ;
	LINK		?= gcc ;
	CCFLAGS 	+= -DMINGW ;
	RANLIB		?= ranlib ;

	MV			?= move /y ;
	CP			?= copy ;
	RM			?= del /f/q ;
	RMDIR		?= rmdir /s/q ;
	SLASH		?= \\ ;
	SUFEXE		?= .exe ;
}
else if $(OS2)
{
	WATCOM		?= $(watcom) ;

	if ! $(WATCOM)
	{
	    Exit On OS2, set WATCOM to the root of the Watcom directory. ;
	}

	AR			?= wlib ;
	BINDIR		?= \\os2\\apps ;
	CC			?= wcc386 ;
	CCFLAGS		?= /zq /DOS2 /I$(WATCOM)\\h ; # zq=quiet
	C++			?= wpp386 ;
	C++FLAGS	?= $(CCFLAGS) ;
	CP			?= copy ;
	DOT			?= . ;
	DOTDOT		?= .. ;
	LINK		?= wcl386 ;
	LINKFLAGS	?= /zq ; # zq=quiet
	LINKLIBS	?= ;
	MV			?= move ;
	NOARSCAN	?= true ;
	OPTIM		?= ;
	RM			?= del /f ;
	SLASH		?= \\ ;
	STDHDRS		?= $(WATCOM)\\h ;
	SUFEXE		?= .exe ;
	SUFLIB		?= .lib ;
	SUFOBJ		?= .obj ;
	UNDEFFLAG	?= "/u _" ;

}
else if $(AS400)
{
	C++			?= icc ;
	C++FLAGS	?= -DAS400 ;
	CC			?= icc ;
	CCFLAGS		?= -DAS400 ;
	LINK		?= icc ;
	LINKFLAGS	?= -qDUPPROC ;
	NOARSCAN	?= true ;
	AR			?= qar -cru ;
	RM			?= del ;
	CRELIB		?= true ;

	# QSYS Library to use for build output
	QSYSLIB 	?= jam ;
}
else if $(VMS)
{
	C++			?= cxx ;
	C++FLAGS	?= ;
	CC			?= cc ;
	CCFLAGS		?= ;
	CHMOD		?= set file/prot= ;
	CP			?= copy/replace ;
	CRELIB		?= true ;
	DOT			?= [] ;
	DOTDOT		?= [-] ;
	EXEMODE		?= (w:e) ;
	FILEMODE	?= (w:r) ;
	HDRS		?= ;
	LINK		?= link ;
	LINKFLAGS	?= "" ;
	LINKLIBS	?= ;
	MKDIR		?= create/dir ;
	MV			?= rename ;
	OPTIM		?= "" ;
	RM			?= delete ;
	RUNVMS		?= mcr ;
	SHELLMODE	?= (w:er) ;
	SLASH		?= . ;
	STDHDRS		?= decc$library_include ;
	SUFEXE		?= .exe ;
	SUFLIB		?= .olb ;
	SUFOBJ		?= .obj ;

}
else if $(MAC)
{
	local OPT ;

	CW	?= "{CW}" ;

	MACHDRS ?=
		"$(UMACHDRS):Universal:Interfaces:CIncludes"
		"$(CW):MSL:MSL_C:MSL_Common:Include"
		"$(CW):MSL:MSL_C:MSL_MacOS:Include" ;

	MACLIBS ?=
		"$(CW):MacOS Support:Universal:Libraries:StubLibraries:Interfacelib"
		"$(CW):MacOS Support:Universal:Libraries:StubLibraries:Mathlib" ;

	MPWLIBS ?=
		"$(CW):MacOS Support:Libraries:Runtime:Libs:MSL_MPWCRuntime_PPC.lib"
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL_C_PPC_MPW.Lib" ;

	MPWNLLIBS ?=
		"$(CW):MacOS Support:Libraries:Runtime:Libs:MSL_MPWCRuntime_PPC.lib"
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL_C_PPC_MPW(NL).Lib" ;

	SIOUXHDRS ?= ;

	SIOUXLIBS ?=
		"$(CW):MacOS Support:Libraries:Runtime:Libs:MSL_Runtime_PPC.lib"
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL_SIOUX_PPC.Lib"
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL_C_PPC.Lib" ;

	C++			?= mwcppc ;
	C++FLAGS	?= -w off ;
	CC			?= mwcppc ;
	CCFLAGS		?= -w off ;
	CP			?= duplicate -y ;
	DOT			?= ":" ;
	DOTDOT		?= "::" ;
	HDRS 		?= $(MACHDRS) $(MPWHDRS) ;
	LINK		?= mwlinkppc ;
	LINKFLAGS	?= -mpwtool -warn ;
	LINKLIBS 	?= $(MACLIBS) $(MPWLIBS) ;
	MKDIR		?= newfolder ;
	MV			?= rename -y ;
	NOARSCAN	?= true ;
	OPTIM		?= ;
	RM			?= delete -y ;
	SLASH		?= ":" ;
	STDHDRS		?= ;
	SUFLIB		?= .lib ;
	SUFOBJ		?= .o ;
}
else if $(OS) = BEOS && $(OSPLAT) = PPC
{
	AR			?= mwld -xml -o ;
	BINDIR		?= /boot/home/config/bin ;
	CC			?= mwcc ;
	CCFLAGS		?= -nosyspath ;
	C++			?= $(CC) ;
	C++FLAGS	?= -nosyspath ;
	CHMOD		?= chmod ;
	CHGRP		?= chgrp ;
	CHOWN		?= chown ;
	FORTRAN		?= "" ;
	LEX			?= flex ;
	LIBDIR		?= /boot/home/config/lib ;
	LINK		?= mwld ;
	LINKFLAGS	?= "" ;
	MANDIR		?= /boot/home/config/man ;
	NOARSCAN	?= true ;
	RANLIB		?= ranlib ;
	STDHDRS		?= /boot/develop/headers/posix ;
	YACC		?= bison -y ;
	YACCGEN		?= .c ;
	YACCFILES	?= y.tab ;
	YACCFLAGS	?= -d ;
}
else if $(OS) = BEOS
{
	BINDIR		?= /boot/home/config/bin ;
	CC			?= gcc ;
	C++			?= $(CC) ;
	CHMOD		?= chmod ;
	CHGRP		?= chgrp ;
	CHOWN		?= chown ;
	FORTRAN		?= "" ;
	LEX			?= flex ;
	LIBDIR		?= /boot/home/config/lib ;
	LINK		?= gcc ;
	MANDIR		?= /boot/home/config/man ;
	NOARSCAN	?= true ;
	RANLIB		?= ranlib ;
	STDHDRS		?= /boot/develop/headers/posix ;
	YACC		?= bison -y ;
	YACCGEN		?= .c ;
	YACCFILES	?= y.tab ;
	YACCFLAGS	?= -d ;
}
else if $(UNIX)
{
	switch $(OS)
	{
	case AIX :
	C++			?= g++ ;
	CC			?= gcc ;
	CCFLAGS 	+= -D_AIX ;
	LINKLIBS	?= -lbsd ;

	case AMIGA :
	CC			?= gcc ;
	YACC		?= bison -y ;

	case CYGWIN :
	CC			?= gcc ;
	CCFLAGS 	+= -D__cygwin__ ;
	LEX			?= flex ;
	JAMSHELL	?= sh -c ;
	RANLIB		?= "" ;
	SUFEXE		?= .exe ;
	YACC		?= bison -y ;

	case DGUX :
	RANLIB		?= "" ;
	RELOCATE 	?= true ;

	case HPUX :
	RANLIB		?= "" ;

	case INTERIX :
	CC			?= gcc ;
	JAMSHELL	?= sh -c ;
	RANLIB		?= "" ;

	case IRIX :
	RANLIB		?= "" ;

	case MPEIX :
	CC			?= gcc ;
	C++			?= gcc ;
	CCFLAGS		+= -D_POSIX_SOURCE ;
	HDRS		+= /usr/include ;
	RANLIB		?= "" ;
	NOARSCAN	?= true ;
	NOARUPDATE	?= true ;

	case MVS :
	RANLIB		?= "" ;
	YACC		?= "" ;

	case NEXT :
	AR		?= libtool -o ;
	RANLIB		?= "" ;

	case MACOSX :
	C++			?= c++ ;
	MANDIR		?= /usr/local/share/man ;

	case DARWIN :
	C++			?= g++ ;
	CC			?= gcc ;
	CCFLAGS		+= -D__DARWIN__ ;
	C++FLAGS		+= -D__DARWIN__ ;
	MANDIR		?= /usr/local/share/man ;

	case NCR :
	RANLIB		?= "" ;

	case PTX :
	RANLIB		?= "" ;

	case QNX :
	AR			?= wlib ;
	CC			?= cc ;
	CCFLAGS		?= -Q ;	# quiet
	C++			?= $(CC) ;
	C++FLAGS	?= -Q ;	# quiet
	LINK		?= $(CC) ;
	LINKFLAGS	?= -Q ;	# quiet
	NOARSCAN	?= true ;
	RANLIB		?= "" ;

	case SCO :
	RANLIB		?= "" ;
	RELOCATE 	?= true ;

	case SINIX :
	RANLIB		?= "" ;

	case SOLARIS :
	RANLIB		?= "" ;
	AR			?= /usr/ccs/bin/ar ru ;

	case UNICOS :
	NOARSCAN 	?= true ;
	OPTIM 		?= -O0 ;

	case UNIXWARE :
	RANLIB		?= "" ;
	RELOCATE 	?= true ;
	}

	# UNIX defaults

	CCFLAGS		?= ;
	C++FLAGS	?= $(CCFLAGS) ;
	CHMOD		?= chmod ;
	CHGRP		?= chgrp ;
	CHOWN		?= chown ;
	LEX			?= lex ;
	LINKFLAGS	?= $(CCFLAGS) ;
	LINKLIBS	?= ;
	OPTIM		?= -O ;
	RANLIB		?= ranlib ;
	YACC		?= yacc ;
	YACCGEN		?= .c ;
	YACCFILES	?= y.tab ;
	YACCFLAGS	?= -d ;
}

#
# General defaults; a lot like UNIX
#

	AR			?= ar ru ;
	AS			?= as ;
	ASFLAGS		?= ;
	AWK			?= awk ;
	BINDIR		?= /usr/local/bin ;
	C++			?= cc ;
	C++FLAGS	?= ;
	CC			?= cc ;
	CCFLAGS		?= ;
	CP			?= cp -f ;
	CRELIB		?= ;
	DOT			?= . ;
	DOTDOT		?= .. ;
	EXEMODE		?= 711 ;
	FILEMODE	?= 644 ;
	FORTRAN		?= f77 ;
	FORTRANFLAGS	?= ;
	HDRS		?= ;
	INSTALLGRIST	?= installed ;
	JAMFILE		?= Jamfile ;
	JAMRULES	?= Jamrules ;
	LEX			?= ;
	LIBDIR		?= /usr/local/lib ;
	LINK		?= $(CC) ;
	LINKFLAGS	?= ;
	LINKLIBS	?= ;
	LN			?= ln ;
	MANDIR		?= /usr/local/man ;
	MKDIR		?= mkdir ;
	MV			?= mv -f ;
	OPTIM		?= ;
	RCP			?= rcp ;
	RM			?= rm -f ;
	RMDIR		?= $(RM) ;
	RSH			?= rsh ;
	SED			?= sed ;
	SHELLHEADER	?= "#!/bin/sh" ;
	SHELLMODE	?= 755 ;
	SLASH		?= / ;
	STDHDRS		?= ;
	SUBDIRRULES ?= ;
	SUBDIRRESET ?= ASFLAGS HDRS C++FLAGS CCFLAGS ;
	SUFEXE		?= "" ;
	SUFLIB		?= .a ;
	SUFOBJ		?= .o ;
	UNDEFFLAG	?= "-u _" ;
	YACC		?= ;
	YACCGEN		?= ;
	YACCFILES	?= ;
	YACCFLAGS	?= ;

	HDRPATTERN =
	    	"^[ 	]*#[ 	]*include[ 	]*[<\"]([^\">]*)[\">].*$" ;

	OSFULL = $(OS)$(OSVER)$(OSPLAT) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ;


#
# Base dependencies - first for "bootstrap" kinds of rules
#

Depends all : shell files lib exe obj ;
Depends all shell files lib exe obj : first ;
NotFile all first shell files lib exe obj dirs clean uninstall ;
Always clean uninstall ;

#
# Rules
#

rule As
{
	Depends $(<) : $(>) ;
	ASFLAGS on $(<) += $(ASFLAGS) $(SUBDIRASFLAGS) ;
	ASHDRS on $(<) = [ FIncludes $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ] ;
}

rule Bulk
{
	local i ;

	for i in $(>)
	{
	    File $(i:D=$(<)) : $(i) ;
	}
}


rule GetTargetVar
{
	on $(<) { return $($(>)) ; }
}

rule Cc
{
	local _s ;
	local _o ;

	_s = [ GetTargetVar $(<) : SUBDIRCCFLAGS ] ;
	_o = [ GetTargetVar $(<) : OPTIM ] ;

	Depends $(<) : $(>) ;

	# If the compiler's -o flag doesn't work, relocate the .o

	if $(RELOCATE)
	{
	    CcMv $(<) : $(>) ;
	}

	# Just to clarify here: this sets the per-target CCFLAGS to
	# be the current value of (global) CCFLAGS and SUBDIRCCFLAGS.
	# CCHDRS and CCDEFS must be reformatted each time for some
	# compiles (VMS, NT) that malign multiple -D or -I flags.

	CCFLAGS on $(<) += $(CCFLAGS) $(_s) $(_o) ;

	CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
	CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
}

rule C++
{
	local _s ;
	local _o ;

	_s = [ GetTargetVar $(<) : SUBDIRC++FLAGS ] ;
	_o = [ GetTargetVar $(<) : OPTIM ] ;

	Depends $(<) : $(>) ;

	if $(RELOCATE)
	{
	    CcMv $(<) : $(>) ;
	}

	C++FLAGS on $(<) += $(C++FLAGS) $(_s) $(_o) ;

	CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
	CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
}

rule Chmod
{
	if $(CHMOD) { Chmod1 $(<) ; }
}

rule File
{
	Depends files : $(<) ;
	Depends $(<) : $(>) ;
	SEARCH on $(>) = $(SEARCH_SOURCE) ;
	MODE on $(<) = $(FILEMODE) ;
	Chmod $(<) ;
}

rule Fortran
{
	Depends $(<) : $(>) ;
}

rule GenFile
{
	local _t = [ FGristSourceFiles $(<) ] ;
	local _s = [ FAppendSuffix $(>[1]) : $(SUFEXE) ] ;
	Depends $(_t) : $(_s) $(>[2-]) ;
	GenFile1 $(_t) : $(_s) $(>[2-]) ;
	Clean clean : $(_t) ;
}

rule GenFile1
{
	MakeLocate $(<) : $(LOCATE_SOURCE) ;
	SEARCH on $(>) = $(SEARCH_SOURCE) ;
}

rule HardLink
{
	Depends files : $(<) ;
	Depends $(<) : $(>) ;
	SEARCH on $(>) = $(SEARCH_SOURCE) ;
}

rule HdrRule
{
	# HdrRule source : headers ;

	# N.B.	This rule is called during binding, potentially after
	# the fate of many targets has been determined, and must be
	# used with caution: don't add dependencies to unrelated
	# targets, and don't set variables on $(<).

	# Tell Jam that anything depending on $(<) also depends on $(>),
	# set SEARCH so Jam can find the headers, but then say we don't
	# care if we can't actually find the headers (they may have been
	# within ifdefs),

	local s = $(>:G=$(HDRGRIST:E)) ;

	Includes $(<) : $(s) ;
	NoCare $(s) ;

	# Propagate on $(<) to $(>)

	HDRSCAN on $(s) = $(HDRSCAN) ;
	HDRRULE on $(s) = $(HDRRULE) ;
	HDRGRIST on $(s) = $(HDRGRIST) ;
	HDRSEARCH on $(s) = $(HDRSEARCH) ;
	SEARCH on $(s) = $(HDRSEARCH) ;

	# If the including file has a hard-coded directory path $(<:D),
	# we need to add that, as a subdirectory of the existing header
	# search path, to SEARCH/HDRSEARCH.  We try to be careful not to
	# add duplicates.

	local d = $(<:D) ;
	local h ;

	if $(d)
	{
	    # Build unique list h = $(HDRSEARCH)/$(<:D)

	    for i in $(d:R=$(HDRSEARCH))
	    {
	    	if ! $(i) in $(HDRSEARCH) $(h) { h += $(i) ; }
	    }

	    # For each included file whose directory doesn't match the
	    # including file, add new subdirectories h to the search.

	    for i in $(s)
	    {
		if $(d) != $(i:D)
		{
		    HDRSEARCH on $(i) += $(h) ;
		    SEARCH on $(i) += $(h) ;
		}
	    }
	}
}

rule InstallInto
{
	# InstallInto dir : sources ;

	local i t ;

	t = $(>:G=$(INSTALLGRIST)) ;

	# Arrange for jam install
	# Arrange for jam uninstall
	# sources are in SEARCH_SOURCE
	# targets are in dir

	Depends install : $(t) ;
	Clean uninstall : $(t) ;
	SEARCH on $(>) = $(SEARCH_SOURCE) ;
	MakeLocate $(t) : $(<) ;

	# For each source, make gristed target name
	# and Install, Chmod, Chown, and Chgrp

	for i in $(>)
	{
	    local tt = $(i:G=$(INSTALLGRIST)) ;

	    Depends $(tt) : $(i) ;
	    Install $(tt) : $(i) ;
	    Chmod $(tt) ;

	    if $(OWNER) && $(CHOWN)
	    {
		Chown $(tt) ;
		OWNER on $(tt) = $(OWNER) ;
	    }

	    if $(GROUP) && $(CHGRP)
	    {
		Chgrp $(tt) ;
		GROUP on $(tt) = $(GROUP) ;
	    }
	}
}

rule InstallBin
{
	local _t = [ FAppendSuffix $(>) : $(SUFEXE) ] ;

	InstallInto $(<) : $(_t) ;
	MODE on $(_t:G=$(INSTALLGRIST)) = $(EXEMODE) ;
}

rule InstallFile
{
	InstallInto $(<) : $(>) ;
	MODE on $(>:G=$(INSTALLGRIST)) = $(FILEMODE) ;
}

rule InstallLib
{
	InstallInto $(<) : $(>) ;
	MODE on $(>:G=$(INSTALLGRIST)) = $(FILEMODE) ;
}

rule InstallMan
{
	# Really this just strips the . from the suffix

	local i s d ;

	for i in $(>)
	{
	    switch $(i:S)
	    {
	    case .1 : s = 1 ; case .2 : s = 2 ; case .3 : s = 3 ;
	    case .4 : s = 4 ; case .5 : s = 5 ; case .6 : s = 6 ;
	    case .7 : s = 7 ; case .8 : s = 8 ; case .l : s = l ;
	    case .n : s = n ; case .man : s = 1 ;
	    }

	    d = man$(s) ;

	    InstallInto $(d:R=$(<)) : $(i) ;
	}

	MODE on $(>:G=$(INSTALLGRIST)) = $(FILEMODE) ;
}

rule InstallShell
{
	InstallInto $(<) : $(>) ;
	MODE on $(>:G=$(INSTALLGRIST)) = $(SHELLMODE) ;
}

rule Lex
{
	LexMv $(<) : $(>) ;
	Depends $(<) : $(>) ;
	MakeLocate $(<) : $(LOCATE_SOURCE) ;
	Clean clean : $(<) ;
}

rule Library
{
	LibraryFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
	Objects $(>) ;
}

rule LibraryFromObjects
{
	local _i _l _s ;

	# Add grist to file names

	_s = [ FGristFiles $(>) ] ;
	_l = $(<:S=$(SUFLIB)) ;

	# library depends on its member objects

	if $(KEEPOBJS)
	{
	    Depends obj : $(_s) ;
	}
	else
	{
	    Depends lib : $(_l) ;
	}

	# Set LOCATE for the library and its contents.  The bound
	# value shows up as $(NEEDLIBS) on the Link actions.
	# For compatibility, we only do this if the library doesn't
	# already have a path.

	if ! $(_l:D)
	{
	    MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;
	}

	if $(NOARSCAN)
	{
	    # If we can't scan the library to timestamp its contents,
	    # we have to just make the library depend directly on the
	    # on-disk object files.

	    Depends $(_l) : $(_s) ;
	}
	else
	{
	    # If we can scan the library, we make the library depend
	    # on its members and each member depend on the on-disk
	    # object file.

	    Depends $(_l) : $(_l)($(_s:BS)) ;

	    for _i in $(_s)
	    {
		Depends $(_l)($(_i:BS)) : $(_i) ;
	    }
	}

	Clean clean : $(_l) ;

	if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; }

	Archive $(_l) : $(_s) ;

	if $(RANLIB) { Ranlib $(_l) ; }

	# If we can't scan the library, we have to leave the .o's around.

	if ! ( $(NOARSCAN) || $(NOARUPDATE) ) { RmTemps $(_l) : $(_s) ; }
}

rule Link
{
	MODE on $(<) = $(EXEMODE) ;
	Chmod $(<) ;
}

rule LinkLibraries
{
	# make library dependencies of target
	# set NEEDLIBS variable used by 'actions Main'

	local _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;

	Depends $(_t) : $(>:S=$(SUFLIB)) ;
	NEEDLIBS on $(_t) += $(>:S=$(SUFLIB)) ;
}

rule Main
{
	MainFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
	Objects $(>) ;
}

rule MainFromObjects
{
	local _s _t ;

	# Add grist to file names
	# Add suffix to exe

	_s = [ FGristFiles $(>) ] ;
	_t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;

	# so 'jam foo' works when it's really foo.exe

	if $(_t) != $(<)
	{
	    Depends $(<) : $(_t) ;
	    NotFile $(<) ;
	}

	# make compiled sources a dependency of target

	Depends exe : $(_t) ;
	Depends $(_t) : $(_s) ;
	MakeLocate $(_t) : $(LOCATE_TARGET) ;

	Clean clean : $(_t) ;

	Link $(_t) : $(_s) ;
}

rule MakeLocate
{
	# MakeLocate targets : directory ;

	# Sets special variable LOCATE on targets, and arranges
	# with MkDir to create target directory.

	# Note we grist the directory name with 'dir',
	# so that directory path components and other
	# targets don't conflict.

	if $(>)
	{
	    LOCATE on $(<) = $(>) ;
	    Depends $(<) : $(>[1]:G=dir) ;
	    MkDir $(>[1]:G=dir) ;
	}
}

rule MkDir
{
	# MkDir directory ;

	# Make a directory and all its parent directories.

	# Ignore timestamps on directories: we only care if they
	# exist.

	NoUpdate $(<) ;

	# Don't create . or any directory already created.

	if $(<:G=) != $(DOT) && ! $($(<)-mkdir)
	{
	    # Cheesy gate to prevent multiple invocations on same dir
	    # Arrange for jam dirs
	    # MkDir1 has the actions

	    $(<)-mkdir = true ;
	    Depends dirs : $(<) ;
	    MkDir1 $(<) ;

	    # Recursively make parent directories.
	    # $(<:P) = $(<)'s parent, & we recurse until root

	    local s = $(<:P) ;

	    # Don't try to create A: or A:\ on windows

	    if $(NT)
	    {
	        switch $(s)
		{
		case *:   : s = ;
		case *:\\ : s = ;
		}
	    }

	    if $(s) = $(<)
	    {
		# The parent is the same as the dir.
		# We're at the root, which some OS's can't stat, so we mark
		# it as NotFile.

	        NotFile $(s) ;
	    }
	    else if $(s:G=)
	    {
		# There's a parent; recurse.

		Depends $(<) : $(s) ;
		MkDir $(s) ;
	    }
	}
}

rule Object
{
	# locate object and search for source, if wanted

	Clean clean : $(<) ;

	MakeLocate $(<) : $(LOCATE_TARGET) ;
	SEARCH on $(>) = $(SEARCH_SOURCE) ;

	# Save HDRS for -I$(HDRS) on compile.
	# We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers
	# in the .c file's directory, but generated .c files (from
	# yacc, lex, etc) are located in $(LOCATE_TARGET), possibly
	# different from $(SEARCH_SOURCE).

	HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ;

	# handle #includes for source: Jam scans for headers with
	# the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
	# with the scanned file as the target and the found headers
	# as the sources.  HDRSEARCH is the value of SEARCH used for
	# the found header files.  Finally, if jam must deal with
	# header files of the same name in different directories,
	# they can be distinguished with HDRGRIST.

	# $(SEARCH_SOURCE:E) is where cc first looks for #include
	# "foo.h" files.  If the source file is in a distant directory,
	# look there.  Else, look in "" (the current directory).

	HDRRULE on $(>) = HdrRule ;
	HDRSCAN on $(>) = $(HDRPATTERN) ;
	HDRSEARCH on $(>) =
		$(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;

	HDRGRIST on $(>) = $(HDRGRIST) ;

	# propagate target specific-defines

	DEFINES on $(<) += $(DEFINES) ;

	# if source is not .c, generate .c with specific rule

	switch $(>:S)
	{
	    case .asm : As $(<) : $(>) ;
	    case .c :	Cc $(<) : $(>) ;
	    case .C :	C++ $(<) : $(>) ;
	    case .cc :	C++ $(<) : $(>) ;
	    case .cpp : C++ $(<) : $(>) ;
	    case .f :	Fortran $(<) : $(>) ;
	    case .l :	Cc $(<) : $(<:S=.c) ;
		            Lex $(<:S=.c) : $(>) ;
	    case .m :	Cc $(<) : $(>) ;
	    case .mm :	Cc $(<) : $(>) ;
	    case .s :	As $(<) : $(>) ;
	    case .y :	Cc $(<) : $(<:S=$(YACCGEN)) ;
		            Yacc $(<:S=$(YACCGEN)) : $(>) ;
	    case * :	UserObject $(<) : $(>) ;
	}
}

rule ObjectCcFlags
{
	CCFLAGS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;
}

rule ObjectC++Flags
{
	C++FLAGS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;
}

rule ObjectDefines
{
	# must reformat CCDEFS according to current defines

	local s = [ FGristFiles $(<:S=$(SUFOBJ)) ] ;

	DEFINES on $(s) += $(>) ;
	CCDEFS on $(s) = [ on $(s) FDefines $(DEFINES) ] ;
}

rule ObjectHdrs
{
	# Add to HDRS for HdrScan's benefit.
	# must reformat CCHDRS according to headers

	local s = [ FGristFiles $(<:S=$(SUFOBJ)) ] ;

	HDRS on $(s) += $(>) ;
	CCHDRS on $(s) = [ on $(s) FIncludes $(HDRS) ] ;
}

rule Objects
{
	local _i ;

	for _i in [ FGristFiles $(<) ]
	{
		Object $(_i:S=$(SUFOBJ)) : $(_i) ;
		Depends obj : $(_i:S=$(SUFOBJ)) ;
	}
}

rule RmTemps
{
	Temporary $(>) ;
}

rule Setuid
{
	MODE on [ FAppendSuffix $(<) : $(SUFEXE) ] = 4711 ;
}

rule Shell
{
	Depends shell : $(<) ;
	Depends $(<) : $(>) ;
	SEARCH on $(>) = $(SEARCH_SOURCE) ;
	MODE on $(<) = $(SHELLMODE) ;
	Clean clean : $(<) ;
	Chmod $(<) ;
}

rule SoftLink
{
	Depends files : $(<) ;
	Depends $(<) : $(>) ;
	SEARCH on $(>) = $(SEARCH_SOURCE) ;
	Clean clean : $(<) ;
}

rule SubDir
{
	#
	# SubDir TOP d1 d2 ... ;
	#
	# Support for a project tree spanning multiple directories.
	#
	# SubDir declares a Jamfile's location in a project tree, setting
	# Jambase variables (SEARCH_SOURCE, LOCATE_TARGET) so that source
	# files can be found.
	#
	# TOP is a user-select variable name for root of the tree, and
	# d1 d2 ...  are the directory elements that lead from the root
	# of the tree to the directory of the Jamfile.
	#
	# TOP can be set externally, but normally the first SubDir call
	# computes TOP as the path up from the current directory; the
	# path contains one ../ for each of d1 d2 ...
	#
	# SubDir reads once the project-specific rules file Jamrules
	# in the TOP directory, if present.  This can be overridden
	# with the variable TOPRULES.
	#
	# SubDir supports multiple, overlaid project trees:  SubDir
	# invocations with different TOPs can appear in the same Jamfile.
	# The location established by the first SubDir call is used set
	# the TOPs for the subsequent SubDir calls.
	#
	# SubDir's public variables:
	#
	#	$(TOP) = path from CWD to root.
	#	$(SUBDIR) = path from CWD to the directory SubDir names.
	#	$(SUBDIR_TOKENS) = path from $(TOP) to $(SUBDIR) as dir names
	#	$(SEARCH_SOURCE) = $(SUBDIR)
	#	$(LOCATE_SOURCE) = $(ALL_LOCATE_TARGET) $(SUBDIR)
	#	$(LOCATE_TARGET) = $(ALL_LOCATE_TARGET) $(SUBDIR)
	#	$(SOURCE_GRIST) = $(SUBDIR_TOKENS) with !'s
	#

	local _top = $(<[1]) ;
	local _tokens = $(<[2-]) ;

	#
	# First time through sets up relative root and includes Jamrules.
	#

	if ! $(_top)
	{
	    Exit SubDir syntax error ;
	}

	if ! $($(_top)-SET)
	{
	    $(_top)-SET = true ;

	    # First time we've seen this TOP.
	    # We'll initialize a number of internal variables:
	    #
	    #	$(TOP-UP) = directories from ROOT to a common point
	    #	$(TOP-DOWN) = directories from common point to TOP
	    #	$(TOP-ROOT) = root directory for UP/DOWN -- normally CWD
	    #	$(SUBDIR_UP) = current value of $(TOP-UP)
	    #	$(SUBDIR_DOWN) = current value of $(TOP-DOWN)
	    #	$(SUBDIR_ROOT) = current value of $(TOP-ROOT)
	    #

	    if $($(_top))
	    {
		# TOP externally set.
		# We'll ignore the relative (UP/DOWN) path that
		# got us here, and instead remember the hard ROOT.

		$(_top)-UP = ;
		$(_top)-DOWN = ;
		$(_top)-ROOT = $($(_top)) ;
	    }
	    else
	    {
		# TOP not preset.

		# Establishing a new TOP.  In the simplest case,
		# (SUBDIR_UP/SUBDIR_DOWN/SUBDIR_ROOT unset), it's
		# merely a certain number of directories down from
		# the current directory, and FSubDirPath will set
		# TOP to a path consisting of ../ for each of the
		# elements of _tokens, because that represents how
		# far below TOP the current directory sits.
		#
		# In the more complicated case, the starting directory
		# isn't the directory of jam's invocation but an
		# location established by previous SubDir call.  The
		# starting directory is SUBDIR_UP directories up from
		# SUBDIR_ROOT, and then SUBDIR_DOWN directories down
		# from that.   If SUBDIR_ROOT is not set, that means
		# SUBDIR_DOWN and SUBDIR_UP represent the path from
		# the directory of jam's invocation.
		#
		# In the most complicated case, the _tokens also
		# represents directories down, because TOP is being
		# estalished in a directory other than TOP's root.
		# Hopefully, _tokens and SUBDIR_DOWN represent the
		# same final directory, relative to the new TOP and
		# the previous SubDIr's TOP.  To find the new TOP,
		# we have to chop off any common directories from
		# then ends of _tokens and SUBDIR_DOWN.  To do so,
		# we reverse each of them, call FStripCommon to
		# remove the initial common elements, and then
		# reverse them again.  After this process, if
		# both _tokens and SUBDIR_DOWN have elements, it
		# means the directory names estalished by the two
		# SubDir calls don't match, and a warning is issued.
		# All hell will likely break loose at this point,
		# since the whole SubDir scheme relies on the SubDir
		# calls accurately naming the current directory.

		# Strip common trailing elements of _tokens and SUBDIR_DOWN.

		_tokens = [ FReverse $(_tokens) ] ;
		SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
		FStripCommon _tokens : SUBDIR_DOWN ;
		SUBDIR_DOWN = [ FReverse $(SUBDIR_DOWN) ] ;
		_tokens = [ FReverse $(_tokens) ] ;

		if $(SUBDIR_DOWN) && $(_tokens)
		{
		    Echo Warning: SubDir $(<) misplaced! ;
		}

		# We'll remember the relative (UP/DOWN) path that
		# got us here, plus any hard ROOT starting point
		# for the UP/DOWN.  If TOP is never set externally,
		# ROOT will always be "" (directory of jam's invocation).

		$(_top)-UP = $(SUBDIR_UP) $(_tokens) ;
		$(_top)-DOWN = $(SUBDIR_DOWN) ;
		$(_top)-ROOT = $(SUBDIR_ROOT:E="") ;
		$(_top) = [ FSubDirPath $(_top) ] ;
	    }

	    # Set subdir vars for the inclusion of the Jamrules,
	    # just in case they have SubDir rules of their own.
	    # Note that SUBDIR_DOWN is empty: it's all the way
	    # up where the Jamrules live.  These gets overrided
	    # just after the inclusion.

	    SUBDIR_UP = $($(_top)-UP) ;
	    SUBDIR_DOWN = ;
	    SUBDIR_ROOT = $($(_top)-ROOT) ;

	    # Include $(TOPRULES) or $(TOP)/Jamrules.
	    # Include $(TOPRULES) if set.
	    # Otherwise include $(TOP)/Jamrules if present.

	    if $($(_top)RULES) {
		include $($(_top)RULES) ;
	    } else {
		NoCare $(JAMRULES:R=$($(_top)):G=$(_top)) ;
		include $(JAMRULES:R=$($(_top)):G=$(_top)) ;
	    }
	}

	# Get path from $(TOP) to named directory.
	# Save dir tokens for other potential uses.

	SUBDIR_UP = $($(_top)-UP) ;
	SUBDIR_DOWN = $($(_top)-DOWN) $(_tokens) ;
	SUBDIR_ROOT = $($(_top)-ROOT) ;
	SUBDIR_TOKENS = $(SUBDIR_DOWN) ;

	SUBDIR = [ FSubDirPath $(<) ] ;

	# Now set up SEARCH_SOURCE, LOCATE_TARGET, SOURCE_GRIST
	# These can be reset if needed.	 For example, if the source
	# directory should not hold object files, LOCATE_TARGET can
	# subsequently be redefined.

	SEARCH_SOURCE = $(SUBDIR) ;
	LOCATE_SOURCE = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
	LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
	SOURCE_GRIST = [ FGrist $(SUBDIR_TOKENS) ] ;

	# Reset per-directory ccflags, hdrs, etc,
	# listed in SUBDIRRESET.
	# Note use of variable expanded assignment var

	SUBDIR$(SUBDIRRESET) = ;

	# Invoke user-specific SubDir extensions,
	# rule names listed in SUBDIRRULES.
	# Note use of variable expanded rule invocation

	$(SUBDIRRULES) $(<) ;
}

rule FSubDirPath
{
	# FSubDirPath TOP d1 ... ;

	# Returns path to named directory.

	# If jam is invoked in a subdirectory of the TOP, then we
	# need to prepend a ../ for every level we must climb up
	# (TOP-UP), and then append the directory names we must
	# climb down (TOP-DOWN), plus the named directories d1 ...
	# If TOP was set externally, or computed from another TOP
	# that was, we'll have to reroot the whole thing at TOP-ROOT.

	local _r = [ FRelPath $($(<[1])-UP) : $($(<[1])-DOWN) $(<[2-]) ] ;

	return $(_r:R=$($(<[1])-ROOT)) ;
}

rule SubDirCcFlags
{
	SUBDIRCCFLAGS += $(<) ;
}

rule SubDirC++Flags
{
	SUBDIRC++FLAGS += $(<) ;
}

rule SubDirHdrs
{
	SUBDIRHDRS += [ FDirName $(<) ] ;
}

rule SubInclude
{
	# SubInclude TOP d1 ... ;
	#
	# Include a subdirectory's Jamfile.

	# We use SubDir to get there, in case the included Jamfile
	# either doesn't have its own SubDir (naughty) or is a subtree
	# with its own TOP.

	if ! $($(<[1]))
	{
	    Exit SubInclude $(<[1]) without prior SubDir $(<[1]) ;
	}

	SubDir $(<) ;

	include $(JAMFILE:D=$(SUBDIR)) ;
}

rule SubRules
{
	# SubRules TOP d1 ... : Other-TOP ;
	#
	# Read another tree's Jamrules, by giving it's path according
	# to this tree and it's own name.

	if ! $($(<[1]))
	{
	    Exit SubRules $(<[1]) without prior SubDir $(<[1]) ;
	}

	SubDir $(<) ;
	SubDir $(>) ;
}

rule Undefines
{
	UNDEFS on [ FAppendSuffix $(<) : $(SUFEXE) ] += $(UNDEFFLAG)$(>) ;
}

rule UserObject
{
	Exit "Unknown suffix on" $(>) "- see UserObject rule in Jamfile(5)." ;
}

rule Yacc
{
	local _h ;

	_h = $(<:BS=.h) ;

	# Some places don't have a yacc.

	MakeLocate $(<) $(_h) : $(LOCATE_SOURCE) ;

	if $(YACC)
	{
	    Depends $(<) $(_h) : $(>) ;
	    Yacc1 $(<) $(_h) : $(>) ;
	    YaccMv $(<) $(_h) : $(>) ;
	    Clean clean : $(<) $(_h) ;
	}

	# make sure someone includes $(_h) else it will be
	# a deadly independent target

	Includes $(<) : $(_h) ;

	# Handle #includes in .y file

	HDRRULE on $(>) = YaccHdr ;
}

rule YaccHdr
{
	# YaccHdr .y : hdrs ;
	# For yacc, includes are actually on the generated
	# .c file, not on the source .y.

	HdrRule $(<:S=$(YACCGEN)) : $(>) ;
}

#
# Utility rules; no side effects on these
#

rule FGrist
{
	return $(<:J=!) ;

}

rule FGristFiles
{
	return $(<:G=$(SOURCE_GRIST:E)) ;
}

rule FGristSourceFiles
{
	# Produce source file name name with grist in it,
	# if SOURCE_GRIST is set.

	# Leave header files alone, because they have a global
	# visibility.

	if ! $(SOURCE_GRIST)
	{
	    return $(<) ;
	}
	else
	{
	    local _i _o ;

	    for _i in $(<)
	    {
		switch $(_i)
		{
		case *.h :	_o += $(_i) ;
		case * : 	_o += $(_i:G=$(SOURCE_GRIST)) ;
		}
	    }

	    return $(_o) ;
	}
}

rule FReverse
{
	# FReverse a1 a2 a3 ... ;
	# return ... a3 a2 a1 ;

	if $(1) { return [ FReverse $(1[2-]) ] $(1[1]) ; }
}

rule FSubDir
{
	# If $(>) is the path to the current directory, compute the
	# path (using ../../ etc) back to that root directory.
	# Sets result in $(<)

	if ! $(<[1])
	{
	    return $(DOT) ;
	}
	else
	{
	    local _i _d ;

	    _d = $(DOTDOT) ;

	    for _i in $(<[2-])
	    {
		_d = $(_d:R=$(DOTDOT)) ;
	    }

	    return $(_d) ;
	}
}

rule FStripCommon
{
	# FStripCommon v1 : v2 ;

	# Strip common initial elements of variables v1 and v2.
	# Modifies the variable values themselves.

	if $($(<)[1]) && $($(<)[1]) = $($(>)[1])
	{
	    $(<) = $($(<)[2-]) ;
	    $(>) = $($(>)[2-]) ;
	    FStripCommon $(<) : $(>) ;
	}
}

rule FRelPath
{
	local _l _r ;

	# first strip off common parts

	_l = $(<) ;
	_r = $(>) ;

	FStripCommon _l : _r ;

	# now make path to root and path down

	_l = [ FSubDir $(_l) ] ;
	_r = [ FDirName $(_r) ] ;

	# Concatenate and save

	# XXX This should be better

	if $(_r) = $(DOT) {
	    return $(_l) ;
	} else {
	    return $(_r:R=$(_l)) ;
	}
}

rule FAppendSuffix
{
	# E.g., "FAppendSuffix yacc lex foo.bat : $(SUFEXE) ;"
	# returns (yacc,lex,foo.bat) on Unix and
	# (yacc.exe,lex.exe,foo.bat) on NT.

	if $(>)
	{
	    local _i _o ;

	    for _i in $(<)
	    {
		if $(_i:S)
		{
		    _o += $(_i) ;
		}
		else
		{
		    _o += $(_i:S=$(>)) ;
		}
	    }
	    return $(_o) ;
	}
	else
	{
	    return $(<) ;
	}
}

#
# Operating system specific utility rules
# First, the (generic) UNIX versions
#

rule FQuote { return \\\"$(<)\\\" ; }
rule FDefines { return -D$(<) ; }
rule FIncludes { return -I$(<) ; }

rule FDirName
{
	# Turn individual elements in $(<) into a usable path.

	local _i ;
	local _s = $(DOT) ;

	for _i in $(<)
	{
	    _s = $(_i:R=$(_s)) ;
	}

	return $(_s) ;
}

if $(OS2)
{
	rule FQuote { return \"$(<)\" ; }
	rule FIncludes { return /I$(<) ; }
}

else if $(NT)
{
	rule FDefines { return /D$(<) ; }
	rule FIncludes { return /I$(<) ; }
}

else if $(MAC)
{
	rule FQuote { return \"$(<)\" ; }
	rule FDefines { return "-define '$(<)'" ; }
	rule FIncludes { return \"$(<:J=,)\" ; }
}

else if $(VMS)
{
	rule FQuote { return \"\"\"$(<)\"\"\" ; }
	rule FDefines { return "/define=( $(<:J=,) )" ; }
	rule FIncludes { return "/inc=( $(<:J=,) )" ; }

	rule FDirName
	{
		local _s _i ;

		# Turn individual elements in $(<) into a usable path.

		if ! $(<)
		{
		    _s = $(DOT) ;
		}
		else
		{
		    # This handles the following cases:
		    # 	a -> [.a]
		    # 	a b c -> [.a.b.c]
		    # 	x: -> x:
		    # 	x: a -> x:[a]
		    # 	x:[a] b -> x:[a.b]

		    switch $(<[1])
		    {
		    case *:* : _s = $(<[1]) ;
		    case \\[*\\] : _s = $(<[1]) ;
		    case * : _s = [.$(<[1])] ;
		    }

		    for _i in [.$(<[2-])]
		    {
			_s = $(_i:R=$(_s)) ;
		    }
		}

		return $(_s) ;
	}
}

#
# Actions
#

#
# First the defaults
#

actions updated together piecemeal Archive
{
	$(AR) $(<) $(>)
}

actions As
{
	$(AS) $(ASFLAGS) $(ASHDRS) -o $(<) $(>)
}

actions C++
{
	$(C++) -c -o $(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)
}

actions Cc
{
	$(CC) -c -o $(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
}

actions Chgrp
{
	$(CHGRP) $(GROUP) $(<)
}

actions Chmod1
{
	$(CHMOD) $(MODE) $(<)
}

actions Chown
{
	$(CHOWN) $(OWNER) $(<)
}

actions piecemeal together existing Clean
{
	$(RM) $(>)
}

actions File
{
	$(CP) $(>) $(<)
}

actions GenFile1
{
	$(>[1]) $(<) $(>[2-])
}

actions Fortran
{
	$(FORTRAN) $(FORTRANFLAGS) -o $(<) $(>)
}

actions HardLink
{
	$(RM) $(<) && $(LN) $(>) $(<)
}

actions Install
{
	$(CP) $(>) $(<)
}

actions Lex
{
	$(LEX) $(>)
}

actions LexMv
{
	$(MV) lex.yy.c $(<)
}

actions Link bind NEEDLIBS
{
	$(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
}

actions MkDir1
{
	$(MKDIR) $(<)
}

actions together Ranlib
{
	$(RANLIB) $(<)
}

actions quietly updated piecemeal together RmTemps
{
	$(RM) $(>)
}

actions Shell
{
	$(AWK) '
		NR == 1 { print "$(SHELLHEADER)" }
		NR == 1 && /^[#:]/ { next }
		/^##/ { next }
		{ print }
	' < $(>) > $(<)
}

actions SoftLink
{
	$(RM) $(<) && $(LN) -s $(>) $(<)
}

actions Yacc1
{
	$(YACC) $(YACCFLAGS) $(>)
}

actions YaccMv
{
	$(MV) $(YACCFILES).c $(<[1])
	$(MV) $(YACCFILES).h $(<[2])
}

#
# RELOCATE - for compilers with broken -o flags
#

if $(RELOCATE)
{
	actions C++
	{
	$(C++) -c $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions Cc
	{
	$(CC) -c $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions ignore CcMv
	{
	[ $(<) != $(>:BS=$(SUFOBJ)) ] && $(MV) $(>:BS=$(SUFOBJ)) $(<)
	}
}

#
# NOARUPDATE - can't update an archive
#

if $(NOARUPDATE)
{
	actions Archive
	{
	$(AR) $(<) $(>)
	}
}

#
# UNIX specific actions
#

if $(UNIX)
{
	actions GenFile1
	{
	PATH="$PATH:."
	$(>[1]) $(<) $(>[2-])
	}
}

if $(AS400)
{
	#
	# AS/400's unix-style compiler, linker and archiver use the OUTPUTDIR
	# environment variable to decide which QSYS library the output file
	# should be placed in. These actions make sure that variable is
	# set when the command is run.
	#

	actions updated piecemeal Archive
	{
	    OUTPUTDIR=$(QSYSLIB) $(AR) $(<) $(>)
	}

	actions Cc
	{
	    OUTPUTDIR=$(QSYSLIB) $(CC) -c -o $(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions C++
	{
	    OUTPUTDIR=$(QSYSLIB) $(C++) -c -o $(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions Link bind NEEDLIBS
	{
	    OUTPUTDIR=$(QSYSLIB) $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
	}

	#
	# On AS/400 we pre-create libraries by creating a symlink to a
	# Bound Directory in the QSYS library where the output goes. This
	# helps qar get the library name right.
	#

	actions CreLib
	{
	    dest=`echo $(<) | sed -e 's#.*/\([^/]*\)\.a$#/qsys.lib/$(QSYSLIB).lib/\1.bnddir#'`
	    [ -h $(<) ] || ln -s $dest $(<)
	}

}

#
# NT specific actions
#

if $(NT) && $(BCCROOT)
{
	actions updated together piecemeal Archive
	{
	$(AR) $(<) -+$(>)
	}

	actions Link bind NEEDLIBS
	{
	$(LINK) -e$(<) $(LINKFLAGS) $(UNDEFS) -L$(LINKLIBS) $(NEEDLIBS) $(>)
	}

	actions C++
	{
	$(C++) -c -o$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions Cc
	{
	$(CC) -c -o$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}
}
else if $(NT)
{
	actions updated together piecemeal Archive
	{
	if exist $(<) set _$(<:B)_=$(<)
	$(AR) /out:$(<) %_$(<:B)_% $(>)
	}

	actions As
	{
	$(AS) /Ml /p /v /w2 $(>) $(<) ,nul,nul;
	}

	actions Cc
	{
	$(CC) /c /Fo$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) /I"$(STDHDRS)" $(>)
	}

	actions C++
	{
	$(C++) /c /Fo$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) /I"$(STDHDRS)" /Tp$(>)
	}

	actions Link bind NEEDLIBS
	{
	$(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) "$(LINKLIBS)"
	}
}

#
# OS2 specific actions
#

else if $(OS2) && $(WATCOM)
{
	actions together piecemeal Archive
	{
	$(AR) $(<) +-$(>)
	}

	actions Cc
	{
	$(CC) /Fo=$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions C++
	{
	$(C++) /Fo=$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions Link bind NEEDLIBS
	{
	$(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
	}

	actions Shell
	{
	$(CP) $(>) $(<)
	}
}

#
# VMS specific actions
#

else if $(VMS)
{
	actions updated together piecemeal Archive
	{
	lib/replace $(<) $(>[1]) ,$(>[2-])
	}

	actions Cc
	{
	$(CC)/obj=$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions C++
	{
	$(C++)/obj=$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions piecemeal together existing Clean
	{
	$(RM) $(>[1]);* ,$(>[2-]);*
	}

	actions together quietly CreLib
	{
	if f$search("$(<)") .eqs. "" then lib/create $(<)
	}

	actions GenFile1
	{
	mcr $(>[1]) $(<) $(>[2-])
	}

	actions Link bind NEEDLIBS
	{
	$(LINK)/exe=$(<) $(LINKFLAGS) $(>:J=,) ,$(NEEDLIBS)/lib ,$(LINKLIBS)
	}

	actions quietly updated piecemeal together RmTemps
	{
	$(RM) $(>[1]);* ,$(>[2-]);*
	}

	actions Shell
	{
	$(CP) $(>) $(<)
	}
}

#
# Mac specifc actions
#

else if $(MAC)
{
	actions together Archive
	{
	$(LINK) -library -o $(<) $(>)
	}

	actions Cc
	{
	set -e MWCincludes $(CCHDRS)
	$(CC) -o $(<) $(CCFLAGS) $(CCDEFS) $(>)
	}

	actions C++
	{
	set -e MWCincludes $(CCHDRS)
	$(CC) -o $(<) $(C++FLAGS) $(CCDEFS) $(>)
	}

	actions Link bind NEEDLIBS
	{
	$(LINK) -o $(<) $(LINKFLAGS) $(>) $(NEEDLIBS) "$(LINKLIBS)"
	}
}

if $(WIN98)
{
	actions existing Clean
	{
	del $(>)
	}
}

#
# Backwards compatibility with jam 1, where rules were uppercased.
#

rule BULK      { Bulk          $(<) : $(>) ; }
rule FILE      { File          $(<) : $(>) ; }
rule HDRRULE   { HdrRule       $(<) : $(>) ; }
rule INSTALL   { Install       $(<) : $(>) ; }
rule LIBRARY   { Library       $(<) : $(>) ; }
rule LIBS      { LinkLibraries $(<) : $(>) ; }
rule LINK      { Link          $(<) : $(>) ; }
rule MAIN      { Main          $(<) : $(>) ; }
rule SETUID    { Setuid        $(<) ; }
rule SHELL     { Shell         $(<) : $(>) ; }
rule UNDEFINES { Undefines     $(<) : $(>) ; }

# Old INSTALL* didn't take dest directory.

rule INSTALLBIN { InstallBin $(BINDIR) : $(<) ; }
rule INSTALLLIB { InstallLib $(LIBDIR) : $(<) ; }
rule INSTALLMAN { InstallMan $(MANDIR) : $(<) ; }

# Compatibility with jam 2.2.

rule addDirName      { $(<) += [ FDirName $(>) ] ; }
rule makeCommon      { FStripCommon $(<) : $(>) ; }
rule _makeCommon     { FStripCommon $(<) : $(>) ; }
rule makeDirName     { $(<) = [ FDirName $(>) ] ; }
rule makeGrist       { $(<) = [ FGrist $(>) ] ; }
rule makeGristedName { $(<) = [ FGristSourceFiles $(>) ] ; }
rule makeRelPath     { $(<[1]) = [ FRelPath $(<[2-]) : $(>) ] ; }
rule makeString      { $(<) = $(>:J) ; }
rule makeSubDir      { $(<) = [ FSubDir $(>) ] ; }
rule makeSuffixed    { $(<[1]) = [ FAppendSuffix $(>) : $(<[2]) ] ; }

#
# Now include the user's Jamfile.
#

include $(JAMFILE) ;
@


1.9882
log
@@
text
@d41 1
d466 7
@


1.9881
log
@@
text
@d411 3
@


1.9880
log
@@
text
@d29 1
a29 1
# 01/10/95 (seiwald) - NT support moved in, with LauraW's help.  
d46 1
a46 1
# shell		- parent of all Shell targets 
d53 1
a53 1
#	
d106 1
a106 1
# FReverse a1 a2 ... ;			return ... a2 a1 
d135 1
a135 1
#	NoUpdate - create the target if needed but never update it 
d169 3
a171 3
    	MV		?= move /y ;
    	CP		?= copy ;
    	RM		?= del /f/q ;
d173 4
a176 117
    	SLASH		?= \\ ;
    	SUFLIB		?= .lib ;
    	SUFOBJ		?= .obj ;
    	SUFEXE		?= .exe ;

    if $(MSVCDir)
    {
	MSVCDIR		?= $(MSVCDir) ;
    }
     
    if $(BCCROOT)
    {
	# Borland

	AR		?= tlib /C /P64 ;
	CC		?= bcc32 ;
	CCFLAGS		?= -v -w- -q -DWIN -tWR -tWM -tWC ;
	C++		?= $(CC) ;
	C++FLAGS	?= $(CCFLAGS) -P ;
	LINK		?= $(CC) ;
	LINKFLAGS	?= $(CCFLAGS) ;
	STDLIBPATH	?= $(BCCROOT)\\lib ;
	STDHDRS		?= $(BCCROOT)\\include ;
	NOARSCAN	?= true ;
    }
    else if $(MSVC)
    {
	AR		?= lib /nologo ;
	CC		?= cl /nologo ;
	CCFLAGS		?= /D \"WIN\" ;
	C++		?= $(CC) ;
	C++FLAGS	?= $(CCFLAGS) ;
	LINK		?= $(CC) ;
	LINKFLAGS	?= $(CCFLAGS) ;
	LINKLIBS	?= 
				$(MSVC:J=" ")\\lib\\mlibce.lib
				$(MSVC:J=" ")\\lib\\oldnames.lib
				;
	LINKLIBS	?= ;
	NOARSCAN	?= true ;
	OPTIM		?=  ;
	STDHDRS		?= $(MSVC:J=" ")\\include ;
	UNDEFFLAG	?= "/u _" ;
    }
    else if $(MSVCNT) && $(OSPLAT) = IA64
    {
    	# IA64 SDK based on VS8 (but not 100% compatible)

	AR		?= lib /MACHINE:IA64 ;
	AS		?= ias ;
	CC		?= cl /nologo ;
	CCFLAGS		?= -D_M_IA64 -DNT /wd4996 ;
	C++		?= $(CC) ;
	C++FLAGS	?= $(CCFLAGS) ;
	LINK		?= link /nologo ;
	LINKFLAGS	?= /MACHINE:IA64 ;
	LINKLIBS	?= libcmt.lib kernel32.lib bufferoverflowU.lib ;
	OPTIM		?= "" ;
	STDHDRS		?= $(MSVCNT:J=" ")\\include ;
	UNDEFFLAG	?= "/u _" ;
    }
    else if $(MSVCNT) && $(OSPLAT) = X64
    {
	# X64 .NET 2005

	AR		?= lib /MACHINE:X64 ;
	AS		?= masm386 ;
	CC		?= cl /nologo ;
	
	CCFLAGS		?= /favor:blend -D_M_AMD64 -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
	C++		?= $(CC) ;
	C++FLAGS	?= $(CCFLAGS) ;
	LINK		?= link /nologo ;
	LINKFLAGS	?= /MACHINE:X64 ;
	LINKLIBS	?= libcmt.lib oldnames.lib kernel32.lib ;
	OPTIM		?= "" ;
	STDHDRS		?= $(MSVCNT:J=" ")\\include ;
	UNDEFFLAG	?= "/u _" ;
    }
    else if $(MSVCNT) && $(OSPLAT) = ARM
    {
	AR		?= lib /MACHINE:ARM ;
	AS		?= armasm ;
	CC		?= cl /nologo ;
	
	CCFLAGS		?= -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
	C++		?= $(CC) ;
	C++FLAGS	?= $(CCFLAGS) ;
	LINK		?= link /nologo ;
	LINKFLAGS	?= /MACHINE:ARM ;
	LINKLIBS	?= libcmt.lib oldnames.lib kernel32.lib ;
	OPTIM		?= "" ;
	STDHDRS		?= $(MSVCNT:J=" ")\\include ;
	UNDEFFLAG	?= "/u _" ;
    }
    else if $(MSVCDIR) && $(OSPLAT) = X86
    {
	# Visual C++ 6.0 and .NET 2003 uses MSVCDIR

	MSVCNT		?= $(MSVCDIR) ;	

	AR		?= lib ;
	AS		?= masm386 ;
	CC		?= cl /nologo ;
	CCFLAGS		?= "" ;
	C++		?= $(CC) ;
	C++FLAGS	?= $(CCFLAGS) ;
	LINK		?= link /nologo ;
	LINKFLAGS	?= "" ;
	LINKLIBS	?= libc.lib oldnames.lib kernel32.lib ;
	OPTIM		?= "" ;
	STDHDRS		?= $(MSVCNT:J=" ")\\include ;
	UNDEFFLAG	?= "/u _" ;
    }
    else if $(MSVCNT) && $(OSPLAT) = X86
    {
	# X86 .NET 2005
d178 23
a200 19
	AR		?= lib /MACHINE:X86 ;
	AS		?= masm386 ;
	CC		?= cl /nologo ;
	
	CCFLAGS		?= -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
	C++		?= $(CC) ;
	C++FLAGS	?= $(CCFLAGS) ;
	LINK		?= link /nologo ;
	LINKFLAGS	?= /MACHINE:X86 ;
	LINKLIBS	?= libcmt.lib oldnames.lib kernel32.lib ;
	OPTIM		?= "" ;
	STDHDRS		?= $(MSVCNT:J=" ")\\include ;
	UNDEFFLAG	?= "/u _" ;
    }
    else
    {
	EXIT On NT, set BCCROOT, MSVCDIR, MSVCNT, or MSVC to the root
		of the Borland or Microsoft directories. ;
    }
d202 12
d223 3
a225 3
   	MV			?= move /y ;
   	CP			?= copy ;
   	RM			?= del /f/q ;
d227 2
a228 2
   	SLASH		?= \\ ;
   	SUFEXE		?= .exe ;
d233 1
a233 1
	 
d239 1
a239 1
	AR		?= wlib ;
d241 1
a241 1
	CC		?= wcc386 ;
d243 1
a243 1
	C++		?= wpp386 ;
d245 2
a246 2
	CP		?= copy ;
	DOT		?= . ;
d251 1
a251 1
	MV		?= move ;
d254 1
a254 1
	RM		?= del /f ;
d265 1
a265 1
	C++		?= icc ;
d267 1
a267 1
	CC		?= icc ;
d272 2
a273 2
	AR		?= qar -cru ;
	RM		?= del ;
d281 1
a281 1
	C++		?= cxx ;
d283 1
a283 1
	CC		?= cc ;
d286 1
a286 1
	CP		?= copy/replace ;
d288 1
a288 1
	DOT		?= [] ;
d297 1
a297 1
	MV		?= rename ;
d299 1
a299 1
	RM		?= delete ;
d312 1
a312 1
	
d324 1
a324 1
	MPWLIBS ?= 
d328 1
a328 1
	MPWNLLIBS ?= 
d331 1
a331 1
		
d333 2
a334 2
	
	SIOUXLIBS ?= 
d336 1
a336 1
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL_SIOUX_PPC.Lib" 
d339 1
a339 1
	C++		?= mwcppc ;
d341 1
a341 1
	CC		?= mwcppc ;
d343 2
a344 2
	CP		?= duplicate -y ;
	DOT		?= ":" ;
d348 2
a349 2
	LINKFLAGS	?= -mpwtool -warn ;				
	LINKLIBS 	?= $(MACLIBS) $(MPWLIBS) ;				
d351 1
a351 1
	MV		?= rename -y ;
d354 1
a354 1
	RM		?= delete -y ;
d356 1
a356 1
	STDHDRS		?= ; 
d362 1
a362 1
	AR		?= mwld -xml -o ;
d364 1
a364 1
	CC		?= mwcc ;
d366 1
a366 1
	C++		?= $(CC) ;
d372 1
a372 1
	LEX		?= flex ;
d385 1
a385 1
else if $(OS) = BEOS 
d388 2
a389 2
	CC		?= gcc ;
	C++		?= $(CC) ;
d394 1
a394 1
	LEX		?= flex ;
d408 3
a410 3
    switch $(OS)
    {
    case AIX :
d413 2
a414 2
    case AMIGA :
	CC		?= gcc ;
d417 2
a418 2
    case CYGWIN :	
	CC		?= gcc ;
d420 1
a420 1
	LEX		?= flex ;
d426 1
a426 1
    case DGUX :
d430 1
a430 1
    case HPUX :
d433 2
a434 2
    case INTERIX :
	CC		?= gcc ;
d438 1
a438 1
    case IRIX :
d441 3
a443 3
    case MPEIX :
	CC		?= gcc ;
	C++		?= gcc ;
d446 1
a446 1
	RANLIB		?= "" ; 
d450 2
a451 2
    case MVS :
	RANLIB		?= "" ; 
d453 2
a454 2
	
    case NEXT :
d458 2
a459 2
    case MACOSX :
	C++		?= c++ ;
d462 1
a462 1
    case NCR :
d465 1
a465 1
    case PTX :
d468 3
a470 3
    case QNX :
	AR		?= wlib ;
	CC		?= cc ;
d472 1
a472 1
	C++		?= $(CC) ;
d479 1
a479 1
    case SCO :
d483 1
a483 1
    case SINIX :
d486 1
a486 1
    case SOLARIS :
d488 1
a488 1
	AR		?= "/usr/ccs/bin/ar ru" ;
d490 1
a490 1
    case UNICOS :
d494 1
a494 1
    case UNIXWARE :
d497 1
a497 1
    }
d506 1
a506 1
	LEX		?= lex ;
d521 2
a522 2
	AR		?= ar ru ;
	AS		?= as ;
d524 1
a524 1
	AWK		?= awk ;
d526 1
a526 1
	C++		?= cc ;
d528 1
a528 1
	CC		?= cc ;
d530 1
a530 1
	CP		?= cp -f ;
d532 1
a532 1
	DOT		?= . ;
d542 1
a542 1
	LEX		?= ;
d547 1
a547 1
	LN		?= ln ;
d550 1
a550 1
	MV		?= mv -f ;
d552 2
a553 2
	RCP		?= rcp ;
	RM		?= rm -f ;
d555 2
a556 2
	RSH		?= rsh ;
	SED		?= sed ;
d560 3
a562 3
	STDHDRS		?= /usr/include ;
	SUBDIRRULES 	?= ;
	SUBDIRRESET 	?= ASFLAGS HDRS C++FLAGS CCFLAGS ;
d572 1
a572 1
	HDRPATTERN = 
d682 1
a682 1
rule GenFile 
d736 1
a736 1
	local d = $(<:D) ; 
d739 1
a739 1
	if $(d) 
d743 1
a743 1
	    for i in $(d:R=$(HDRSEARCH)) 
d745 1
a745 1
	    	if ! $(i) in $(HDRSEARCH) $(h) { h += $(i) ; } 
d791 2
a792 2
	    if $(OWNER) && $(CHOWN) 
	    { 
d797 2
a798 2
	    if $(GROUP) && $(CHGRP) 
	    { 
d899 2
a900 2
	if $(NOARSCAN) 
	{ 
d903 1
a903 1
	    # on-disk object files.  
d1011 1
a1011 1
	# Ignore timestamps on directories: we only care if they 
d1018 1
a1018 1
	if $(<:G=) != $(DOT) && ! $($(<)-mkdir) 
d1022 1
a1022 1
	    # MkDir1 has the actions 
d1083 1
a1083 1
	# the found header files.  Finally, if jam must deal with 
d1087 2
a1088 2
	# $(SEARCH_SOURCE:E) is where cc first looks for #include 
	# "foo.h" files.  If the source file is in a distant directory, 
d1093 1
a1093 1
	HDRSEARCH on $(>) = 
d1113 1
a1113 1
			Lex $(<:S=.c) : $(>) ;
d1118 1
a1118 1
			Yacc $(<:S=$(YACCGEN)) : $(>) ;
d1212 1
a1212 1
	# SubDir reads once the project-specific rules file Jamrules 
d1229 1
a1229 1
	#	$(SOURCE_GRIST) = $(SUBDIR_TOKENS) with !'s 
d1278 1
a1278 1
		# elements of _tokens, because that represents how 
d1282 1
a1282 1
		# isn't the directory of jam's invocation but an 
d1290 1
a1290 1
		# In the most complicated case, the _tokens also 
d1316 3
a1318 3
		if $(SUBDIR_DOWN) && $(_tokens) 
		{ 
		    Echo Warning: SubDir $(<) misplaced! ; 
d1346 1
a1346 1
	    if $($(_top)RULES) { 
d1348 1
a1348 1
	    } else { 
d1358 1
a1358 1
        SUBDIR_DOWN = $($(_top)-DOWN) $(_tokens) ;
d1360 1
a1360 1
        SUBDIR_TOKENS = $(SUBDIR_DOWN) ;
d1395 1
a1395 1
	# (TOP-UP), and then append the directory names we must 
d1397 1
a1397 1
	# If TOP was set externally, or computed from another TOP 
d1513 1
a1513 1
rule FGristFiles 
d1520 1
a1520 1
	# Produce source file name name with grist in it, 
d1530 1
a1530 1
	else 
d1547 1
a1547 1
rule FReverse 
d1561 1
a1561 1
	if ! $(<[1]) 
d1564 1
a1564 1
	} 
d1624 3
a1626 3
       # E.g., "FAppendSuffix yacc lex foo.bat : $(SUFEXE) ;"
       # returns (yacc,lex,foo.bat) on Unix and 
       # (yacc.exe,lex.exe,foo.bat) on NT.
d1710 1
a1710 1
		else 
d1806 1
a1806 1
	$(CP) $(>) $(<) 
d1821 1
a1821 1
	$(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) 
d1947 1
a1947 1
	actions CreLib 
d1959 1
a1959 1
if $(NT) && $(MSVCNT)
d1963 1
a1963 7
	if exist $(<) set _$(<:B)_=$(<)
	$(AR) /out:$(<) %_$(<:B)_% $(>)
	}

	actions As
	{
	$(AS) /Ml /p /v /w2 $(>) $(<) ,nul,nul;
d1966 1
a1966 1
	actions Cc
d1968 1
a1968 1
	$(CC) /c /Fo$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) /I"$(STDHDRS)" $(>)
d1973 1
a1973 1
	$(C++) /c /Fo$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) /I"$(STDHDRS)" /Tp$(>)
d1976 1
a1976 1
	actions Link bind NEEDLIBS
d1978 1
a1978 1
	$(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) "$(LINKLIBS)"
d1981 1
a1981 1
else if $(NT) && $(MSVC)
d1985 2
a1986 11
	$(AR) $(<) -+$(>)
	}

	actions Cc
	{
	$(CC) /c /Fo$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
	}

	actions C++
	{
	$(C++) /c /Fo$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) /Tp$(>)
d1989 1
a1989 8
	actions Link bind NEEDLIBS
	{
	$(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) "$(LINKLIBS)"
	}
}
else if $(NT) && $(BCCROOT)
{
	actions updated together piecemeal Archive
d1991 1
a1991 1
	$(AR) $(<) -+$(>)
d1994 1
a1994 1
	actions Link bind NEEDLIBS
d1996 1
a1996 1
	$(LINK) -e$(<) $(LINKFLAGS) $(UNDEFS) -L$(LINKLIBS) $(NEEDLIBS) $(>)
d2001 1
a2001 1
	$(C++) -c -o$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)
d2004 1
a2004 1
	actions Cc
d2006 1
a2006 1
	$(CC) -c -o$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)
d2018 1
a2018 1
	$(AR) $(<) +-$(>) 
d2048 2
a2049 2
    actions updated together piecemeal Archive 
    {
d2051 1
a2051 1
    }
d2053 4
a2056 4
    actions Cc
    { 
	$(CC)/obj=$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>) 
    }
d2058 4
a2061 4
    actions C++
    { 
	$(C++)/obj=$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>) 
    }
d2063 2
a2064 2
    actions piecemeal together existing Clean
    {
d2066 1
a2066 1
    }
d2068 2
a2069 2
    actions together quietly CreLib
    {
d2071 1
a2071 1
    }
d2073 2
a2074 2
    actions GenFile1
    {
d2076 1
a2076 1
    }
d2078 2
a2079 2
    actions Link bind NEEDLIBS
    {
d2081 1
a2081 1
    }
d2083 2
a2084 2
    actions quietly updated piecemeal together RmTemps
    {
d2086 1
a2086 1
    }
d2088 2
a2089 2
    actions Shell
    {
d2091 1
a2091 1
    }
d2100 2
a2101 2
    actions together Archive 
    {
d2103 1
a2103 1
    }
d2105 2
a2106 2
    actions Cc
    {
d2108 2
a2109 2
	$(CC) -o $(<) $(CCFLAGS) $(CCDEFS) $(>) 
    }
d2111 2
a2112 2
    actions C++
    {
d2114 2
a2115 2
	$(CC) -o $(<) $(C++FLAGS) $(CCDEFS) $(>) 
    }
d2117 2
a2118 2
    actions Link bind NEEDLIBS
    {
d2120 1
a2120 1
    }
d2125 2
a2126 2
    actions existing Clean
    {
d2128 1
a2128 1
    }
d2135 11
a2145 11
rule BULK { Bulk $(<) : $(>) ; }
rule FILE { File $(<) : $(>) ; }
rule HDRRULE { HdrRule $(<) : $(>) ; }
rule INSTALL { Install $(<) : $(>) ; }
rule LIBRARY { Library $(<) : $(>) ; }
rule LIBS { LinkLibraries $(<) : $(>) ; }
rule LINK { Link $(<) : $(>) ; }
rule MAIN { Main $(<) : $(>) ; }
rule SETUID { Setuid $(<) ; }
rule SHELL { Shell $(<) : $(>) ; }
rule UNDEFINES { Undefines $(<) : $(>) ; }
d2155 5
a2159 5
rule addDirName { $(<) += [ FDirName $(>) ] ; }
rule makeCommon { FStripCommon $(<) : $(>) ; }
rule _makeCommon { FStripCommon $(<) : $(>) ; }
rule makeDirName { $(<) = [ FDirName $(>) ] ; }
rule makeGrist { $(<) = [ FGrist $(>) ] ; }
d2161 4
a2164 4
rule makeRelPath { $(<[1]) = [ FRelPath $(<[2-]) : $(>) ] ; }
rule makeString { $(<) = $(>:J) ; }
rule makeSubDir { $(<) = [ FSubDir $(>) ] ; }
rule makeSuffixed { $(<[1]) = [ FAppendSuffix $(>) : $(<[2]) ] ; }
@


1.9879
log
@@
text
@d158 1
a158 1
JAMBASEDATE = 2011.01.17  ;
d252 16
@


1.9878
log
@@
text
@d224 1
a224 1
	CCFLAGS		?= -D_M_IA64 -DNT /MT /wd4996 ;
d242 1
a242 1
	CCFLAGS		?= /favor:blend -D_M_AMD64 -DNT -D_CRT_SECURE_NO_DEPRECATE /MT /wd4996 ;
d279 1
a279 1
	CCFLAGS		?= -DNT -D_CRT_SECURE_NO_DEPRECATE /MT /wd4996 ;
@


1.9877
log
@@
text
@d247 1
a247 4
	LINKLIBS	?= 
				$(MSVCNT:J=" ")\\lib\\libcmt.lib
				$(MSVCNT:J=" ")\\lib\\oldnames.lib
				$(MSVCNT:J=" ")\\lib\\kernel32.lib ;
d266 1
a266 4
	LINKLIBS	?= 
				$(MSVCNT:J=" ")\\lib\\libc.lib
				$(MSVCNT:J=" ")\\lib\\oldnames.lib
				$(MSVCNT:J=" ")\\lib\\kernel32.lib ;
d284 1
a284 4
	LINKLIBS	?= 
				$(MSVCNT:J=" ")\\lib\\libcmt.lib
				$(MSVCNT:J=" ")\\lib\\oldnames.lib
				$(MSVCNT:J=" ")\\lib\\kernel32.lib ;
@


1.9876
log
@@
text
@d698 6
d706 6
d726 1
a726 1
	CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) $(OPTIM) ;
d734 6
d747 1
a747 1
	C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) $(OPTIM) ;
@


1.9875
log
@@
text
@d158 1
a158 1
JAMBASEDATE = 2008.01.31  ;
d307 3
a309 4
	Echo		"MingW32" ;

	CC		?= gcc ;
	C++		?= g++ ;
d311 8
a318 2
	RANLIB		?= "ranlib" ;
	SUFEXE		?= .exe ;
@


1.9874
log
@@
text
@d1181 2
@


1.9873
log
@@
text
@d537 2
a538 1

@


1.9872
log
@@
text
@d229 1
a229 4
	LINKLIBS	?= 
				$(MSVCNT:J=" ")\\lib\\libcmt.lib
				$(MSVCNT:J=" ")\\lib\\oldnames.lib
				$(MSVCNT:J=" ")\\lib\\kernel32.lib ;
@


1.9871
log
@@
text
@d219 1
a219 1
    	# IA64 .NET 2005
d224 1
a224 1
	CCFLAGS		?= -D_M_IA64 -DNT -D_CRT_SECURE_NO_DEPRECATE /MT /wd4996 ;
@


1.9870
log
@@
text
@d158 1
a158 1
JAMBASEDATE = 2007.12.21  ;
d185 2
d219 17
a235 1
    	# No settings yet for IA64 .NET 2005.
d245 1
a245 1
	CCFLAGS		?= /favor:blend -D_M_AMD64 -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
d251 3
a253 3
				$(MSVCNT:J=" ")\\lib\\$(I)libcmt.lib
				$(MSVCNT:J=" ")\\lib\\$(I)oldnames.lib
				$(MSVCNT:J=" ")\\lib\\$(I)kernel32.lib ;
a263 4
	# bury IA64 in the path for the SDK

	local I ; if $(OSPLAT) = IA64 { I = ia64\\ ; } else { I = "" ; }

d273 3
a275 3
				$(MSVCNT:J=" ")\\lib\\$(I)libc.lib
				$(MSVCNT:J=" ")\\lib\\$(I)oldnames.lib
				$(MSVCNT:J=" ")\\lib\\$(I)kernel32.lib ;
d288 1
a288 1
	CCFLAGS		?= -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
d294 3
a296 3
				$(MSVCNT:J=" ")\\lib\\$(I)libcmt.lib
				$(MSVCNT:J=" ")\\lib\\$(I)oldnames.lib
				$(MSVCNT:J=" ")\\lib\\$(I)kernel32.lib ;
@


1.9869
log
@@
text
@d158 1
a158 1
JAMBASEDATE = 2007.07.12  ;
d177 5
d240 1
a240 1
    else if $(MSVCNT) && $(OSPLAT) = X86
d242 1
a242 1
	# X86 .NET 2005
d244 7
a250 1
	AR		?= lib /MACHINE:X86 ;
d253 1
a253 2
	
	CCFLAGS		?= -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
d257 1
a257 1
	LINKFLAGS	?= /MACHINE:X86 ;
d259 1
a259 1
				$(MSVCNT:J=" ")\\lib\\$(I)libcmt.lib
d266 1
a266 1
    else if $(MSVCNT) || $(MSVCDIR)
d268 1
a268 7
	# Visual C++ 6.0 and .NET 2003 uses MSVCDIR

	MSVCNT		?= $(MSVCDIR) ;	

	# bury IA64 in the path for the SDK

	local I ; if $(OSPLAT) = IA64 { I = ia64\\ ; } else { I = "" ; }
d270 1
a270 1
	AR		?= lib ;
d273 2
a274 1
	CCFLAGS		?= "" ;
d278 1
a278 1
	LINKFLAGS	?= "" ;
d280 1
a280 1
				$(MSVCNT:J=" ")\\lib\\$(I)libc.lib
@


1.9868
log
@@
text
@d222 1
a222 1
	CCFLAGS		?= /favor:blend -D_M_AMD64 /MT -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
d243 1
a243 1
	CCFLAGS		?= /MT -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
@


1.9867
log
@@
text
@d216 1
a216 1
	# .NET 2005
d222 1
a222 1
	CCFLAGS		?= /favor:blend -D_M_AMD64 -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
d226 22
a247 1
	LINKFLAGS	?= /MACHINE:X64 /NODEFAULTLIB:libc.lib ;
@


1.9866
log
@@
text
@d158 1
a158 1
JAMBASEDATE = 2005.05.05 ;
@


1.9865
log
@@
text
@d201 2
a202 2
				$(MSVC)\\lib\\mlibce.lib
				$(MSVC)\\lib\\oldnames.lib
d207 1
a207 1
	STDHDRS		?= $(MSVC)\\include ;
d228 3
a230 3
				$(MSVCNT)\\lib\\$(I)libcmt.lib
				$(MSVCNT)\\lib\\$(I)oldnames.lib
				$(MSVCNT)\\lib\\$(I)kernel32.lib ;
d232 1
a232 1
	STDHDRS		?= $(MSVCNT)\\include ;
d254 3
a256 3
				$(MSVCNT)\\lib\\$(I)libc.lib
				$(MSVCNT)\\lib\\$(I)oldnames.lib
				$(MSVCNT)\\lib\\$(I)kernel32.lib ;
d258 1
a258 1
	STDHDRS		?= $(MSVCNT)\\include ;
d2001 1
a2001 1
	$(CC) /c /Fo$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) /I$(STDHDRS) $(>)
d2006 1
a2006 1
	$(C++) /c /Fo$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) /I$(STDHDRS) /Tp$(>)
d2011 1
a2011 1
	$(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
d2033 1
a2033 1
	$(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
@


1.9864
log
@@
text
@a355 5
	switch $(OS) 
	{
	case OPENVMS : CCFLAGS ?= /stand=vaxc ;
	case VMS     : LINKLIBS ?= sys$library:vaxcrtl.olb/lib ;
	}
@


1.9863
log
@@
text
@d222 1
a222 1
	CCFLAGS		?= /favor:blend /MT -D_M_AMD64 -DNT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
@


1.9862
log
@@
text
@a751 4
	# If the including file has a hard-coded directory path $(<:D),
	# we need to add that, as a subdirectory of the existing header
	# search path, to SEARCH/HDRSEARCH.

a752 2
	local h = $(HDRSEARCH) ;
	local d = $(<:D) ; 
a753 2
	if $(d) { h += $(d:R=$(h)) ; }

a754 1
	SEARCH on $(s) = $(h) ;
a758 1
	HDRSEARCH on $(s) = $(h) ;
d762 32
@


1.9861
log
@@
text
@d210 5
a214 1
    else if $(MSVCVer) = x64
d222 1
a222 1
	CCFLAGS		?= /favor:AMD64 -D_M_AMD64 -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
@


1.9860
log
@@
text
@d217 2
a218 1
	CCFLAGS		?= /favor:AMD64 -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
@


1.9859
log
@@
text
@d217 1
a217 1
	CCFLAGS		?= /favor:AMD64 /MT -D_CRT_SECURE_NO_DEPRECATE /wd4996 ;
@


1.9858
log
@@
text
@d210 20
d232 1
a232 1
	# Visual C++ 6.0 uses MSVCDIR
@


1.9857
log
@@
text
@d286 16
d1897 43
@


1.9856
log
@@
text
@d158 1
a158 1
JAMBASEDATE = 2002.05.09 ;
d711 4
d716 4
d722 1
a722 1
	SEARCH on $(s) = $(HDRSEARCH) ;
d727 1
a727 1
	HDRSEARCH on $(s) = $(HDRSEARCH) ;
@


1.3070
log
@@
text
@d40 1
d1449 13
@


1.3005
log
@@
text
@d571 2
d1292 10
d1334 3
a1336 1
	# Reset per-directory ccflags, hdrs
d1338 7
a1344 3
	SUBDIRCCFLAGS = ;
	SUBDIRC++FLAGS = ;
	SUBDIRHDRS = ;
@


1.2852
log
@@
text
@d383 1
d389 1
d405 1
@


1.2850
log
@@
text
@d104 2
d1151 1
a1151 1
	# SubDir TOP d1 ... ;
d1155 3
a1157 4
	# SubDir introduces a Jamfile that is part of a project tree whose
	# root is $(TOP).  TOP is a user-selected variable name for the
	# tree; d1 ... are the directory elements that lead from the root
	# of the tree to the directory of the Jamfile.
d1159 3
a1161 4
	# When jam reads the Jamfile in the current working directory
	# (CWD), the first SubDir call sets $(TOP) to the back path to
	# the project root for use by subsequent SubDir calls.  The path
	# contains one ../ for each directory from the root.
d1163 3
a1165 4
	# Each SubDir call sets the (fixed) variable $(SUBDIR) to the path
	# from the CWD to the named directory.  SubDir also sets other
	# Jambase variables (SEARCH_SOURCE, LOCATE_TARGET) to $(SUBDIR),
	# so that file names within the Jamfile refer to $(SUBDIR).
d1167 3
a1169 4
	# The first invocation of SubDir for TOP includes the
	# project-specific rules files $(TOPRULES).  If $(TOPRULES) is
	# not set SubDir looks for a Jamrules in $(TOP) and includes that
	# if present.
d1171 4
a1174 3
	# SubDir supports different TOPs for separate project trees; it
	# simply uses the last value of $(SUBDIR) instead of the CWD when 
	# computing the path to $(TOP).
a1185 6
	# SubDir's private variables:
	#
	#	$(SUBDIR_UP) = directories from CWD to a common point
	#	$(SUBDIR_DOWN) = directories from common point to SUBDIR
	#	$(TOP-UP) = directories from CWD to a common point
	#	$(TOP-DOWN) = directories from common point to TOP
d1199 1
a1199 1
	if ! $($(_top))
d1201 1
a1201 1
	    # Get path from SUBDIR (or CWD) to $(TOP)
d1203 10
a1212 1
	    SUBDIR_UP += $(_tokens) ;
d1214 5
a1218 3
	    $(_top)-UP = $(SUBDIR_UP) ;
	    $(_top)-DOWN = $(SUBDIR_DOWN) ;
	    $(_top) = [ FSubDirPath $(_top) ] ;
d1220 68
a1287 1
	    # File is $(TOPRULES) or $(TOP)/Jamrules.
d1289 1
a1289 1
	    # Only include default $(TOP)/Jamrules if present.
d1304 1
d1330 1
a1330 2
	# Returns path to named directory, assuming TOP has been set by
	# a previous call to SubDir.
d1332 10
a1341 1
	return [ FRelPath $($(<[1])-UP) : $($(<[1])-DOWN) $(<[2-]) ] ;
d1473 8
d1506 1
a1506 1
rule _makeCommon
d1508 4
a1511 1
	# strip common initial elements
d1517 1
a1517 1
	    _makeCommon $(<) : $(>) ;
d1530 1
a1530 1
	_makeCommon _l : _r ;
d2061 2
a2062 1
rule makeCommon { _makeCommon $(<) : $(>) ; }
@


1.2849
log
@@
text
@d334 2
a335 2
		"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW.Lib" ;
d338 2
a339 2
		"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW(NL).Lib" ;
d344 3
a346 3
		"$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.lib"
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib" 
		"$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC.Lib" ;
d349 1
a349 1
	C++FLAGS	?= -w off -nomapcr ;
d351 1
a351 1
	CCFLAGS		?= -w off -nomapcr ;
a1625 1
	PATH="$PATH:."
d1735 13
@


1.2615
log
@@
text
@d209 1
a209 1
			# Visual C++ 6.0 uses MSVCDIR
d213 4
d226 3
a228 3
				$(MSVCNT)\\lib\\libc.lib
				$(MSVCNT)\\lib\\oldnames.lib
				$(MSVCNT)\\lib\\kernel32.lib ;
@


1.2566
log
@@
text
@a1513 1
	rule FQuote { return \"$(<)\" ; }
@


1.2565
log
@@
text
@d1514 1
@


1.2564
log
@@
text
@d1622 1
@


1.2561
log
@@
text
@d207 1
a207 1
    else if $(MSVCNT)
d209 4
d231 2
a232 2
	Exit On NT, set BCCROOT, MSVCNT, or MSVC to the root of the
		Borland or Microsoft directories. ;
@


1.2557
log
@@
text
@d169 1
d551 1
@


1.2513
log
@@
text
@d1213 2
a1214 1
		include [ Glob $($(_top)) : $(JAMRULES) ] ;
@


1.2503
log
@@
text
@d10 1
a10 1
# JAMBASE - jam 2.3 ruleset providing make(1)-like functionality
d141 1
a141 1
#	$(JAMVERSION) - version number (2.3)
@


1.2497
log
@@
text
@a196 2
				#$(MSVC)\\lib\\advapi32.lib
				#$(MSVC)\\lib\\libcmt.lib
a197 1
				#$(MSVC)\\lib\\slibce.lib
a198 1
				#$(MSVC)\\lib\\kernel32.lib 
d216 1
a216 1
	LINKLIBS	?= $(MSVCNT)\\lib\\advapi32.lib
@


1.2496
log
@@
text
@a175 2
	Echo "Compiler is Borland C++" ;

a188 2
	Echo "Compiler is Microsoft Visual C++ 16 bit" ;

a211 2
	Echo "Compiler is Microsoft Visual C++" ;

@


1.2485
log
@@
text
@d1290 1
a1290 1
	    Exit Top level of source tree has not been set with $(_top) ;
d1307 1
a1307 1
	    Exit Top level of source tree has not been set with $(_top) ;
@


1.2483
log
@@
text
@d370 1
a370 1
else if $(OS) = BEOS && $(METROWERKS)
d373 1
a373 1
	BINDIR		?= /boot/apps ;
d378 3
d382 1
a382 1
	LIBDIR		?= /boot/develop/libraries ;
d385 1
a385 1
	MANDIR		?= /boot/documentation/"Shell Tools"/HTML ;
d388 4
d395 1
a395 1
	BINDIR		?= /boot/apps ;
d398 3
d402 1
a402 1
	LIBDIR		?= /boot/develop/libraries ;
d404 1
a404 1
	LINKLIBS	?= -lnet ;
d406 1
d408 4
@


1.2480
log
@@
text
@a449 1
	AR		?= libtool -o ;
a451 1
	RANLIB		?= "" ;
d871 1
a871 1
	if ! ( $(NOARSCAN) || $(KEEPOBJS) ) { RmTemps $(_l) : $(_s) ; }
@


1.1577
log
@@
text
@d153 4
d930 9
d942 2
a943 2
	    Depends $(<) : $(>[1]) ;
	    MkDir $(>[1]) ;
d949 6
a954 2
	# If dir exists, don't update it
	# Do this even for $(DOT).
d958 1
a958 3
	if $(<) != $(DOT) && ! $($(<)-mkdir) 
	{
	    local s ;
d960 2
a962 1
	    # MkDir1 has the actions 
d964 1
a966 1
	    MkDir1 $(<) ;
d968 1
d973 1
a973 1
	    s = $(<:P) ;
d975 2
d986 1
a986 6
	    if $(s) && $(s) != $(<)
	    {
		Depends $(<) : $(s) ;
		MkDir $(s) ;
	    }
	    else if $(s)
d988 4
d994 3
d998 3
d1136 1
a1136 1
	# SubDir TOP d1 [ ... ]
d1138 1
a1138 3
	# This introduces a Jamfile that is part of a project tree 
	# rooted at $(TOP).  It (only once) includes the project-specific
	# rules file $(TOP)/Jamrules and then sets search & locate stuff.
d1140 4
a1143 2
	# If the variable $(TOPRULES) is set (where TOP is the first arg 
	# to SubDir), that file is included instead of $(TOP)/Jamrules.
d1145 35
a1179 4
	# d1 ... are the directory elements that lead to this directory 
	# from $(TOP).  We construct the system dependent path from these
	# directory elements in order to set search&locate stuff.
	# 
d1182 1
a1182 10

	if ! $($(_top))
	{
	    if ! $(_top)
	    {
		Exit SubDir syntax error ;
	    }

	    $(_top) = [ FSubDir $(<[2-]) ] ;
	}
d1185 1
a1185 1
	# If $(TOP)/Jamrules hasn't been included, do so.
d1188 1
a1188 1
	if ! $($(_top)-included)
d1190 2
a1191 1
	    # Gated entry.
d1193 5
a1197 1
	    $(_top)-included = TRUE ;
d1199 4
d1204 2
d1207 5
a1211 1
	    include $($(_top)RULES:E=$(JAMRULES:R=$($(_top)))) ;
d1214 1
a1214 1
	# Get path to current directory from root using SubDir.
d1217 5
a1221 3
	local _s = [ FDirName $(<[2-]) ] ;
	SUBDIR = $(_s:R=$($(_top))) ;
        SUBDIR_TOKENS = $(<[2-]) ;
d1231 1
a1231 1
	SOURCE_GRIST = [ FGrist $(<[2-]) ] ;
d1240 10
d1267 3
a1269 1
	local _s ;
d1271 17
a1287 2
	# That's
	#	SubInclude TOP d1 [ d2 [ d3 [ d4 ] ] ]
d1289 2
a1290 1
	# to include a subdirectory's Jamfile.
d1294 1
a1294 1
	    Exit Top level of source tree has not been set with $(<[1]) ;
d1297 2
a1298 3
	_s = [ FDirName $(<[2-]) ] ;
	
	include $(JAMFILE:D=$(_s):R=$($(<[1]))) ;
@


1.1572
log
@@
text
@d748 1
a748 1
	MODE on $(_t:G=installed) = $(EXEMODE) ;
d754 1
a754 1
	MODE on $(>:G=installed) = $(FILEMODE) ;
d760 1
a760 1
	MODE on $(>:G=installed) = $(FILEMODE) ;
d784 1
a784 1
	MODE on $(>:G=installed) = $(FILEMODE) ;
d790 1
a790 1
	MODE on $(>:G=installed) = $(SHELLMODE) ;
@


1.1571
log
@@
text
@d493 2
d528 1
d702 2
d706 6
a711 1
	t = $(>:G=installed) ;
d714 1
a714 1
	Depends $(t) : $(>) ;
d718 2
a719 3
	# Arrange for jam uninstall

	Clean uninstall : $(t) ;
d723 1
a723 2
	    Install $(i:G=installed) : $(i) ;
	}
d725 3
a727 1
	Chmod $(t) ;
d729 11
a739 4
	if $(UNIX)
	{
	    if $(OWNER) { Chown $(t) ; OWNER on $(t) = $(OWNER) ; }
	    if $(GROUP) { Chgrp $(t) ; GROUP on $(t) = $(GROUP) ; }
d1497 1
a1497 1
	chgrp $(GROUP) $(<)
d1507 1
a1507 1
	chown $(OWNER) $(<)
@


1.1570
log
@@
text
@d237 10
@


1.1539
log
@@
text
@d64 1
a64 1
# Hardlink target : source ;		make link from source to target
d86 1
d1074 8
d1553 5
@


1.1488
log
@@
text
@d1373 1
a1373 1
	rule FInclude { return -I$(<) ; }
d1378 2
a1379 1
	rule FInclude { return -I$(<) ; }
@


1.1355
log
@@
text
@d1816 1
a1816 1
rule makeString { $(<) = [ FConcat $(>) ] ; }
@


1.1344
log
@@
text
@@


1.1319
log
@@
text
@d161 1
@


1.486
log
@@
text
@d3 1
a3 1
# +\	Copyright 1993, 2000 Christopher Seiwald.
d89 1
a89 1
# SubDirHdrs dirs ;			add include dirs until next SubDir
a98 1
# FConcat value ... ;          		return contatenated values
d125 9
a133 9
#	ALWAYS - always build a target
#	DEPENDS - builds the dependency graph
#	ECHO - blurt out targets on stdout
#	EXIT - blurt out targets and exit
#	INCLUDES - marks sources as headers for target (a codependency)
#	NOCARE - don't panic if the target can't be built
#	NOUPDATE - create the target if needed but never update it 
#	NOTFILE - ignore the timestamp of the target (it's not a file)
#	TEMPORARY - target need not be present if sources haven't changed
d170 1
a170 1
	ECHO "Compiler is Borland C++" ;
d174 3
a176 3
	CCFLAGS		?= -v -w- -q ;
	C++		?= bcc32 ;
	C++FLAGS	?= -v -w- -q -P ;
d185 1
a185 1
	ECHO "Compiler is Microsoft Visual C++ 16 bit" ;
d210 1
a210 1
	ECHO "Compiler is Microsoft Visual C++" ;
d230 1
a230 1
	EXIT On NT, set BCCROOT, MSVCNT, or MSVC to the root of the
d241 1
a241 1
	    EXIT On OS2, set WATCOM to the root of the Watcom directory. ;
d391 1
a391 1
	YACC		?= bison ;
d400 1
a400 1
	YACC		?= bison ;
d487 1
d539 1
d553 4
a556 4
DEPENDS all : shell files lib exe obj ;
DEPENDS all shell files lib exe obj : first ;
NOTFILE all first shell files lib exe obj dirs clean uninstall ;
ALWAYS clean uninstall ;
d564 1
a564 1
	DEPENDS $(<) : $(>) ;
d566 1
d581 1
a581 8
	local _h ;

	DEPENDS $(<) : $(>) ;

	# Just to clarify here: this sets the per-target CCFLAGS to
	# be the current value of (global) CCFLAGS and SUBDIRCCFLAGS.

	CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
d590 4
a593 1
	_h = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;
d595 4
a598 14
	if $(VMS) && $(_h)
	{
	    SLASHINC on $(<) = "/inc=(" $(_h[1]) ,$(_h[2-]) ")" ;
	}
	else if $(MAC) && $(_h)
	{
	    local _i _j ;
	    _j = $(_h[1]) ;
	    for _i in $(_h[2-])
	    {
	    	_j = $(_j),$(_i) ;
	    }
	    MACINC on $(<) = \"$(_j)\" ;
	}
d603 1
a603 4
	local _h ;

	DEPENDS $(<) : $(>) ;
	C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) ;
d610 1
a610 1
	_h = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;
d612 2
a613 14
	if $(VMS) && $(_h)
	{
	    SLASHINC on $(<) = "/inc=(" $(_h[1]) ,$(_h[2-]) ")" ;
	}
	else if $(MAC) && $(_h)
	{
	    local _i _j ;
	    _j = $(_h[1]) ;
	    for _i in $(_h[2-])
	    {
	    	_j = $(_j),$(_i) ;
	    }
	    MACINC on $(<) = \"$(_j)\" ;
	}
d623 2
a624 2
	DEPENDS files : $(<) ;
	DEPENDS $(<) : $(>) ;
d632 1
a632 1
	DEPENDS $(<) : $(>) ;
d652 2
a653 2
	DEPENDS files : $(<) ;
	DEPENDS $(<) : $(>) ;
d671 1
a671 8
	local s ;

	if $(HDRGRIST) 
	{ 
	    s = $(>:G=$(HDRGRIST)) ;
	} else { 
	    s = $(>) ; 
	}
d673 1
a673 1
	INCLUDES $(<) : $(s) ;
d675 1
a675 1
	NOCARE $(s) ;
d691 2
a692 2
	DEPENDS install : $(t) ;
	DEPENDS $(t) : $(>) ;
d767 1
a767 1
	DEPENDS $(<) : $(>) ;
d791 1
a791 1
	    DEPENDS obj : $(_s) ;
d795 1
a795 1
	    DEPENDS lib : $(_l) ;
d814 1
a814 1
	    DEPENDS $(_l) : $(_s) ;
d822 1
a822 1
	    DEPENDS $(_l) : $(_l)($(_s:BS)) ;
d826 1
a826 1
		DEPENDS $(_l)($(_i:BS)) : $(_i) ;
d856 1
a856 1
	DEPENDS $(_t) : $(>:S=$(SUFLIB)) ;
d876 2
d880 2
a881 2
	    DEPENDS $(<) : $(_t) ;
	    NOTFILE $(<) ;
d886 2
a887 2
	DEPENDS exe : $(_t) ;
	DEPENDS $(_t) : $(_s) ;
d910 1
a910 1
	NOUPDATE $(<) ;
d945 1
a945 1
	        NOTFILE $(s) ;
a952 2
	local h ;

d966 1
a966 1
	HDRS on $(<) = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;
d976 3
a978 12
	# $(h) is where cc first looks for #include "foo.h" files.
	# If the source file is in a distant directory, look there.
	# Else, look in "" (the current directory).

	if $(SEARCH_SOURCE)
	{
	    h = $(SEARCH_SOURCE) ;
	}
	else
	{
	    h = "" ;
	}
d982 3
a984 1
	HDRSEARCH on $(>) = $(HDRS) $(SUBDIRHDRS) $(h) $(STDHDRS) ;
d987 4
d1004 2
a1005 2
	    case .y :	Cc $(<) : $(<:S=.c) ;
			Yacc $(<:S=.c) : $(>) ;
a1009 1

d1020 10
d1032 7
a1038 1
	HDRS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;
d1048 1
a1048 1
		DEPENDS obj : $(_i:S=$(SUFOBJ)) ;
d1054 1
a1054 1
	TEMPORARY $(>) ;
d1064 2
a1065 2
	DEPENDS shell : $(<) ;
	DEPENDS $(<) : $(>) ;
a1073 2
	local _r _s ;

d1089 3
a1091 1
	if ! $($(<[1]))
d1093 1
a1093 1
	    if ! $(<[1])
d1095 1
a1095 1
		EXIT SubDir syntax error ;
d1098 1
a1098 1
	    $(<[1]) = [ FSubDir $(<[2-]) ] ;
d1105 1
a1105 1
	if ! $($(<[1])-included)
d1109 1
a1109 1
	    $(<[1])-included = TRUE ;
d1113 1
a1113 10
	    _r = $($(<[1])RULES) ;

	    if ! $(_r)
	    {
		_r = $(JAMRULES:R=$($(<[1]))) ;
	    }

	    # Include it.

	    include $(_r) ;
d1119 2
a1120 2
	_s = [ FDirName $(<[2-]) ] ;
	SUBDIR = $(_s:R=$($(<[1]))) ;
d1152 1
a1152 1
	SUBDIRHDRS += $(<) ;
d1166 1
a1166 1
	    EXIT Top level of source tree has not been set with $(<[1]) ;
d1181 1
a1181 1
	EXIT "Unknown suffix on" $(>) "- see UserObject rule in Jamfile(5)." ;
d1196 1
a1196 1
	    DEPENDS $(<) $(_h) : $(>) ;
d1205 1
a1205 1
	INCLUDES $(<) : $(_h) ;
d1214 1
a1214 10
	# Turn individual elements in $(<) into grist.

	local _g _i ;

	_g = $(<[1]) ;

	for _i in $(<[2-])
	{
	    _g = $(_g)!$(_i) ;
	}
a1215 1
	return $(_g) ;
d1220 1
a1220 8
	if ! $(SOURCE_GRIST)
	{
	    return $(<) ;
	}
	else 
	{
	    return $(<:G=$(SOURCE_GRIST)) ;
	}
a1251 16
rule FConcat
{
	# Puts the variables together, removing spaces.

	local _t _r ;

	$(_r) = $(<[1]) ;

	for _t in $(<[2-])
	{
		$(_r) = $(_r)$(_t) ;
	}

	return $(_r) ;
}

a1253 2
	local _i _d ;

d1260 1
a1260 1
	    _d = $(DOT) ;
d1264 2
a1271 10
	}

	return $(_d) ;
}

rule FDirName
{
	local _s _i ;

	# Turn individual elements in $(<) into a usable path.
d1273 1
a1273 42
	if ! $(<)
	{
	    _s = $(DOT) ;
	}
	else if $(VMS)
	{
	    # This handles the following cases:
	    # 	a -> [.a]
	    # 	a b c -> [.a.b.c]
	    # 	x: -> x:
	    # 	x: a -> x:[a]
	    # 	x:[a] b -> x:[a.b]

	    switch $(<[1])
	    {
	    case *:* : _s = $(<[1]) ;
	    case \\[*\\] : _s = $(<[1]) ;
	    case * : _s = [.$(<[1])] ;
	    }

	    for _i in [.$(<[2-])]
	    {
		_s = $(_i:R=$(_s)) ;
	    }
	}
	else if $(MAC)
	{
	    _s = $(DOT) ;
	    
	    for _i in $(<)
	    {
	    	_s = $(_i:R=$(_s)) ;
	    }
	}
	else
	{
	    _s = $(<[1]) ; 

	    for _i in $(<[2-])
	    {
		_s = $(_i:R=$(_s)) ;
	    }
a1274 2

	return $(_s) ;
a1276 1

a1288 1

d1345 10
a1354 1
rule unmakeDir
d1356 71
a1426 8
    if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\ 
    {
        unmakeDir $(<) : $(>[1]:D) $(>[1]:BS) $(>[2-]) ;
    }
    else
    {
        $(<) = $(>) ;
    }
d1444 1
a1444 1
	$(AS) $(ASFLAGS) -I$(HDRS) -o $(<) $(>)
d1449 1
a1449 1
	$(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)
d1454 1
a1454 1
	$(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)
d1561 1
a1561 1
	$(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) $(>)
d1566 1
a1566 1
	$(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) $(>)
d1606 1
a1606 1
	$(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) $(>)
d1611 1
a1611 1
	$(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) /Tp$(>)
d1628 1
a1628 1
	$(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) $(>)
d1633 1
a1633 1
	$(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /Tp$(>)
d1655 1
a1655 1
	$(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
d1660 1
a1660 1
	$(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
a1661 1

d1677 1
a1677 1
	$(CC) $(CCFLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)
d1682 1
a1682 1
	$(C++) $(C++FLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)
d1709 1
a1709 1
	$(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>) 
d1714 1
a1714 1
	$(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>) 
d1734 1
a1734 1
	$(LINK)/exe=$(<) $(LINKFLAGS) $(>[1]) ,$(>[2-]) ,$(NEEDLIBS)/lib ,$(LINKLIBS)
d1761 2
a1762 2
	set -e MWCincludes $(MACINC)
	$(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>) 
d1766 3
a1768 3
    { 
	set -e MWCincludes $(MACINC)
	$(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>) 
d1777 8
d1810 1
d1812 1
d1815 2
d1823 1
a1823 3
{
	if $(JAMFILE) { include $(JAMFILE) ; }
}
@


1.211
log
@@
text
@d3 1
a3 1
# +\	Copyright 1993, 1995 Christopher Seiwald.
d10 1
a10 1
# JAMBASE - jam 2.1 ruleset providing make(1)-like functionality
d15 1
a15 1
# 04/18/94 (seiwald) - use 'default =' when setting OS specific vars
d39 1
d96 1
a96 1
# Utility rules that have no side effects:
d98 8
a105 9
# makeSubDir var : d1 d2 ... ;		$(var) = path to root
# addDirName var : d1 d2 ... ;		$(var) += path from root to dir
# makeDirName var : d1 d2 ... ;		$(var) = path from root to dir
# makeGrist var : d1 d2 ... ;		$(var) = grist form of dir
# makeGristedName var : value ;		$(var) = $(value:G=$(SOURCE_GRIST))
# makeCommon var1 : var2 ;		strip common initial elements
# makeRelPath var d1 : d2 ;		$(var) = rel path from d1 to d2
# makeSuffixed var $(SUF) : f1 f2 ... ; $(var) = $(>) with suffixes
# makeString var : value ... ;          $(var) = contatenated values
d108 1
d123 1
d139 1
a139 3
#	$(UNIX) - true on UNIX
#	$(VMS) - true on VMS
#	$(NT) - true on NT
d141 1
a141 1
#	$(JAMVERSION) - version number (2.1)
a154 3
# "default =" - set only if unset

OSFULL = $(OS)$(OSPLAT)$(OSVER) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ;
d160 1
a160 143
switch $(OS)
{
case AIX :	LINKLIBS default = -lbsd ;
case DGUX :	RANLIB default = "" ; RELOCATE = true ;
case HPUX :	RANLIB default = "" ;
		INSTALL default = "" ;
case INTERIX :	RANLIB default = "" ;
		JAMSHELL default = "sh -c" ;
		CC default = gcc ;
case IRIX :	RANLIB default = "" ;
		INSTALL default = "" ;
case MVS :	RANLIB default = "" ; 
case NEXT :	AR default = libtool -o ;
		RANLIB default = "" ;
case MACOSX : AR default = libtool -o ;
              RANLIB default = "" ;
              C++ default = c++ ;
              MANDIR default = /usr/local/share/man ;
case NCR :	RANLIB default = "" ;
		INSTALL default = "" ;
case PTX :	RANLIB default = "" ;
case QNX :	INSTALL default = "" ;
case SCO :	RANLIB default = "" ;
		INSTALL default = "" ; RELOCATE = true ;
case SINIX :	RANLIB default = "" ;
case SOLARIS :	RANLIB default = "" ;
		INSTALL default = "install" ;
		AR default = "/usr/ccs/bin/ar ru" ;
case UNIXWARE :	RANLIB default = "" ; RELOCATE = true ;
}

#if $(OS) = SUNOS && $(TZ)
#{
#	Echo Warning: you are running the SunOS jam on Solaris. ;
#}

if $(UNIX)
{
	if $(OS) = QNX 
	{
	AR		default = wlib ;
	CC		default = cc ;
	CCFLAGS		default = -Q ;	# quiet
	C++		default = $(CC) ;
	C++FLAGS	default = -Q ;	# quiet
	LINK		default = $(CC) ;
	LINKFLAGS	default = -Q ;	# quiet
	NOARSCAN	default = true ;
	RANLIB		default = "" ;
	}
	else if $(OS) = BEOS && $(METROWERKS)
	{
	AR		default = mwld -xml -o ;
	BINDIR		default = /boot/bin ;
	CC		default = mwcc ;
	CCFLAGS		default = -nosyspath ;
	C++		default = $(CC) ;
	C++FLAGS	default = -nosyspath ;
	FORTRAN		default = "" ;
	LIBDIR		default = /boot/develop/libraries ;
	LINK		default = mwld ;
	LINKFLAGS	default = "" ;
	LEX		default = "" ;
	MANDIR		default = /boot/documentation/"Shell Tools"/HTML ;
	NOARSCAN	default = true ;
	RANLIB		default = "" ;	
	STDHDRS		default = /boot/develop/headers/posix ;
	YACC		default = "" ;
	YACCFLAGS	default = "" ;
	YACCFILES	default = "" ;
	}
	else if $(OS) = BEOS 
	{
	BINDIR		default = /boot/bin ;
	CC		default = gcc ;
	C++		default = $(CC) ;
	FORTRAN		default = "" ;
	LIBDIR		default = /boot/develop/libraries ;
	LINK		default = gcc ;
	LINKLIBS	default = -lnet ;
	LEX		default = "" ;
	NOARSCAN	default = true ;
	RANLIB		default = "" ;	
	STDHDRS		default = /boot/develop/headers/posix ;
	YACC		default = "" ;
	YACCFLAGS	default = "" ;
	YACCFILES	default = "" ;
	}
	else if $(OS) = AMIGA
	{
	CC				default = gcc ;
	YACC			default = bison ;
	YACCFLAGS	default = -d ;
	YACCFILES	default = y.tab ;
	}

	AR		default = ar ru ;
	AS		default = as ;
	AWK		default = awk ;
	ASFLAGS		default = ;
	BINDIR		default = /usr/local/bin ;
	C++		default = gcc ;
	C++FLAGS	default = ;
	CC		default = cc ;
	CCFLAGS		default = ;
	CP		default = cp ;
	CHMOD		default = chmod ;
	DOT		default	= . ;
	DOTDOT		default	= .. ;
	EXEMODE		default = 711 ;
	FILEMODE	default = 644 ;
	FORTRAN		default = f77 ;
	FORTRANFLAGS	default = ;
	HDRS		default = ;
	INSTALL		default = install -c ;
	LEX		default = lex ;
	LIBDIR		default = /usr/local/lib ;
	LINK		default = $(CC) ;
	LINKFLAGS	default = $(CCFLAGS) ;
	LINKLIBS	default = ;
	LN		default = ln ;
	MANDIR		default = /usr/local/man ;
	MKDIR		default = mkdir ;
	MV		default = mv -f ;
	OPTIM		default = -O ;
	RANLIB		default = ranlib ;
	RCP		default = rcp ;
	RSH		default = rsh ;
	RM		default = rm -f ;
	SED		default = sed ;
	SHELLHEADER	default = "#!/bin/sh" ;
	SHELLMODE	default = 755 ;
	SLASH		default = / ;
	STDHDRS		default = /usr/include ;
	SUFLIB		default = .a ;
	SUFOBJ		default = .o ;
	SUFEXE		default = "" ;
	UNDEFFLAG	default = "-u _" ;
	YACC		default = yacc ;
	YACCFLAGS	default = -d ;
	YACCFILES	default = y.tab ;
}
else if $(NT)
d162 6
a167 18
	AWK		default = awk ;
	CHMOD		default = chmod ;
    	CP		default = copy ;
	DOT		default	= . ;
	DOTDOT		default	= .. ;
	EXEMODE		default = 711 ;
	FILEMODE	default = 644 ;
	MKDIR		default = mkdir ;
	MV		default = mv -f ;
	OS			= NT ;		# replace Windows_NT
	RCP		default = rcp ;
	RSH		default = rsh ;
    	RM		default = del /f/q ;
	SED		default = sed ;
    	SLASH		default = \\ ;
    	SUFLIB		default = .lib ;
    	SUFOBJ		default = .obj ;
    	SUFEXE		default = .exe ;
d173 10
a182 11
	AR		default = tlib ;
	ARFLAGS		default = /C /P64 ;
	CC		default = bcc32 ;
	CCFLAGS		default = -v -w- -DNT ;
	C++		default = bcc32 ;
	C++FLAGS	default = -v -w- ;
	LINK		default = $(CC) ;
	LINKFLAGS	default = $(CCFLAGS) ;
	STDLIBPATH	default = $(BCCROOT)\\lib ;
	STDHDRS		default = $(BCCROOT)\\include ;
	NOARSCAN	default = true ;
d188 8
a195 8
	AR		default = lib /nologo ;
	CC		default = cl /nologo ;
	CCFLAGS		default = /D \"WIN\" ;
	C++		default = $(CC) ;
	C++FLAGS	default = $(CCFLAGS) ;
	LINK		default = $(CC) ;
	LINKFLAGS	default = $(CCFLAGS) ;
	LINKLIBS	default = 
d203 5
a207 5
	LINKLIBS	default = ;
	NOARSCAN	default = true ;
	OPTIM		default =  ;
	STDHDRS		default = $(MSVC)\\include ;
	UNDEFFLAG	default = "/u _" ;
d213 9
a221 9
	AR		default = lib ;
	AS		default = masm386 ;
	CC		default = cl /nologo ;
	CCFLAGS		default = ;
	C++		default = $(CC) ;
	C++FLAGS	default = $(CCFLAGS) ;
	LINK		default = link ;
	LINKFLAGS	default = ;
	LINKLIBS	default = $(MSVCNT)\\lib\\advapi32.lib
d225 3
a227 3
	OPTIM		default =  ;
	STDHDRS		default = $(MSVCNT)\\include ;
	UNDEFFLAG	default = "/u _" ;
d238 6
a243 18
	WATCOM		default = $(watcom) ;
	
    	CP		default = copy ;
	DOT		default	= . ;
	DOTDOT		default	= .. ;
	MKDIR		default = mkdir ;
    	MV		default = move ;
    	RM		default = del /f ;
	SED		default = sed ;
    	SLASH		default = \\ ;
    	SUFLIB		default = .lib ;
    	SUFOBJ		default = .obj ;
    	SUFEXE		default = .exe ;
     
    if ! $(WATCOM)
    {
	EXIT On OS2, set WATCOM to the root of the Watcom directory. ;
    }
d245 22
a266 1
	ECHO "OS2 compiler is Watcom." ;
a267 12
	AR		default = wlib ;
	CC		default = wcc386 ;
	CCFLAGS		default = /zq /DOS2 /I$(WATCOM)\\h ; # zq=quiet
	C++		default = wpp386 ;
	C++FLAGS	default = $(CCFLAGS) ;
	LINK		default = wcl386 ;
	LINKFLAGS	default = /zq ; # zq=quiet
	LINKLIBS	default = ;
	NOARSCAN	default = true ;
	OPTIM		default = ;
	STDHDRS		default = $(WATCOM)\\h ;
	UNDEFFLAG	default = "/u _" ;
d271 26
a296 25
	AS		default = as ;
	CC		default = cc ;
	CCFLAGS		default = ;
	CP		default = copy/replace ;
	CRELIB		default = true ;
	DOT		default	= [] ;
	DOTDOT		default	= [-] ;
	EXEMODE		default = (w:e) ;
	FILEMODE	default = (w:r) ;
	HDRS		default = ;
	LEX		default = lex ;
	LINK		default = link ;
	LINKFLAGS	default = ;
	LINKLIBS	default = ;
	MV		default = rename ;
	OPTIM		default = ;
	RM		default = delete ;
	RUNVMS		default = mcr ;
	SED		default = sed ;
	SHELLMODE	default = (w:er) ;
	SLASH		default = . ;
	STDHDRS		default = decc$library_include ;
	SUFLIB		default = .olb ;
	SUFOBJ		default = .obj ;
	SUFEXE		default = .exe ;
d300 2
a301 2
	case OPENVMS : CCFLAGS default = /stand=vaxc ;
	case VMS     : LINKLIBS default = sys$library:vaxcrtl.olb/lib ;
d306 3
a308 4
	CW		default = "{CW}" ;
	CWMAC		default = "$(CW):MacOS Support" ;
	CWMSL		default = "$(CW):Metrowerks Standard Library" ;
	CWGUSI		default = "{CWGUSI}" ;
d310 4
a313 36
	CC		default = mwcppc ;
	CCFLAGS		default = -eol -w off ;
	C++		default = mwcppc ;
	C++FLAGS	default = -eol -w off ;
	CP		default = copy ;
	DOT		default = ":" ;
	DOTDOT		default = "::" ;
	HDRS		default = "$(CWGUSI):include"
				  "$(CWMAC):Headers:Universal Headers"
				  "$(CWMAC):Headers:System Extras Headers:MPW Extras"
				  "$(CWMSL):MSL C:MSL Common:Public Includes"
				  "$(CWMSL):MSL C:MSL Mac:Public Includes" ;
				  
	LINK		default = mwlinkppc ;
	LINKFLAGS	default = -mpwtool -warn ;
	LINKLIBS	default = "$(CWGUSI):Lib:GUSIMPW.Lib.PPC"
				  "$(CWGUSI):Lib:MSLGUSI.Lib.PPC"
				  "$(CWMAC):Libraries:MacOS Common:Interfacelib"
				  "$(CWMAC):Libraries:MacOS PPC:PPCToolLibs.o"
				  "$(CWMAC):Libraries:MacOS Common:PLStringFuncs Glue:PLStringFuncsPPC.lib"
				  "$(CWMAC):Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
				  "$(CWMSL):MSL C:Bin:MSL C.PPC MPW(NL).Lib"
				  "$(CWMAC):Libraries:MacOS Common:Mathlib" ;
				
	MKDIR		default = newfolder ;
	MV		default = rename ;
	NOARSCAN	default = true ;
	OPTIM		default = ;
	RM		default = delete ;
	SLASH		default = ":" ;
	STDHDRS		default = ; #$(MWCIncludes) ;
	SUFLIB		default = .lib ;
	SUFOBJ		default = .o ;
	SUFEXE		default = "" ;
	NOARSCAN	default = true ;
}
d315 3
a317 4
# 
# Define some MS-specific commands for MS-specific actions (which
# are not yet added to Jambase)
#
d319 37
a355 1
if $(NT) || $(OS2)
d357 25
a381 4
	MSLIB 		default = lib ;
	MSLINK		default = link ;
	MSIMPLIB 	default = implib ;
	MSRC		default = rc ;
d383 6
d390 3
a392 2
JAMFILE		default = Jamfile ;
JAMRULES	default = Jamrules ;
d394 20
a413 1
HDRPATTERN = "^[ 	]*#[ 	]*include[ 	]*[<\"](.*)[\">].*$" ;
d415 133
d643 5
d664 5
a668 5
	local s ;
	makeGristedName s : $(<) ;
	Depends $(s) : $(>[1]:S=$(SUFEXE)) $(>[2-]) ;
	GenFile1 $(s) : $(>[1]:S=$(SUFEXE)) $(>[2-]) ;
	Clean clean : $(s) ;
d739 1
a739 3
	if ! $(INSTALL)
	{
	    Chmod $(t) ;
d741 2
d750 4
a753 2
	InstallInto $(<) : $(>) ;
	MODE on $(>:G=installed) = $(EXEMODE) ;
d800 1
d814 1
a814 1
	local i l s ;
d818 2
a819 1
	makeGristedName s : $(>) ;
a822 2
	l = $(<:S=$(SUFLIB)) ;

d825 1
a825 1
	    DEPENDS obj : $(s) ;
d829 1
a829 1
	    DEPENDS lib : $(l) ;
d837 1
a837 1
	if ! $(l:D)
d839 1
a839 1
	    MakeLocate $(l) $(l)($(s:BS)) : $(LOCATE_TARGET) ;
d848 1
a848 1
	    DEPENDS $(l) : $(s) ;
d856 1
a856 1
	    DEPENDS $(l) : $(l)($(s:BS)) ;
d858 1
a858 1
	    for i in $(s)
d860 1
a860 1
		DEPENDS $(l)($(i:BS)) : $(i) ;
d864 1
a864 1
	Clean clean : $(l) ;
d866 1
a866 1
	if $(CRELIB) { CreLib $(l) : $(s[1]) ; }
d868 1
a868 1
	Archive $(l) : $(s) ;
d870 1
a870 1
	if $(RANLIB) { Ranlib $(l) ; }
d874 1
a874 1
	if ! ( $(NOARSCAN) || $(KEEPOBJS) ) { RmTemps $(l) : $(s) ; }
a884 2
	local t ;

d888 1
a888 6
	if $(<:S)
	{
	    t = $(<) ;
	} else {
	    t = $(<:S=$(SUFEXE)) ;
	}
d890 2
a891 2
	DEPENDS $(t) : $(>:S=$(SUFLIB)) ;
	NEEDLIBS on $(t) += $(>:S=$(SUFLIB)) ;
d902 1
a902 1
	local s t ;
d905 1
a905 2

	makeGristedName s : $(>) ;
d907 2
a908 1
	makeSuffixed t $(SUFEXE) : $(<) ;
d910 1
a910 1
	if $(t) != $(<)
d912 1
a912 1
	    DEPENDS $(<) : $(t) ;
d918 3
a920 3
	DEPENDS exe : $(t) ;
	DEPENDS $(t) : $(s) ;
	MakeLocate $(t) : $(LOCATE_TARGET) ;
d922 1
a922 1
	Clean clean : $(t) ;
d924 1
a924 1
	Link $(t) : $(s) ;
d939 5
a949 1
	    # If dir exists, don't update it
a953 1
	    NOUPDATE $(<) ;
d1047 1
d1050 1
a1050 7
	local s ;

	# Add grist to file names

	makeGristedName s : $(<:S=$(SUFOBJ)) ;

	CCFLAGS on $(s) += $(>) ;
d1055 1
a1055 7
	local s ;

	# Add grist to file names

	makeGristedName s : $(<:S=$(SUFOBJ)) ;

	C++FLAGS on $(s) += $(>) ;
d1060 1
a1060 7
	local s ;

	# Add grist to file names

	makeGristedName s : $(<:S=$(SUFOBJ)) ;

	HDRS on $(s) += $(>) ;
d1065 1
a1065 5
	local i s ;

	# Add grist to file names

	makeGristedName s : $(<) ;
d1067 1
a1067 1
	for i in $(s)
d1069 2
a1070 2
		Object $(i:S=$(SUFOBJ)) : $(i) ;
		DEPENDS obj : $(i:S=$(SUFOBJ)) ;
d1081 1
a1081 10
	local t ;

	if $(<:S)
	{
	    t = $(<) ;
	} else {
	    t = $(<:S=$(SUFEXE)) ;
	}

	MODE on $(t) = 4711 ;
d1096 1
a1096 1
	local r s ;
d1120 1
a1120 1
	    makeSubDir $(<[1]) : $(<[2-]) ;
d1135 1
a1135 1
	    r = $($(<[1])RULES) ;
d1137 1
a1137 1
	    if ! $(r)
d1139 1
a1139 1
		r = $(JAMRULES:R=$($(<[1]))) ;
d1144 1
a1144 1
	    include $(r) ;
d1147 1
a1147 1
	# Get path to current directory from root using makeSubDir.
d1150 2
a1151 2
	makeDirName s : $(<[2-]) ;
	SUBDIR = $(s:R=$($(<[1]))) ;
d1162 1
a1162 1
	makeGrist SOURCE_GRIST : $(<[2-]) ;
d1188 1
a1188 1
	local s ;
d1200 1
a1200 1
	makeDirName s : $(<[2-]) ;
d1202 1
a1202 1
	include $(JAMFILE:D=$(s):R=$($(<[1]))) ;
d1207 1
a1207 10
	local t ;

	if $(<:S)
	{
	    t = $(<) ;
	} else {
	    t = $(<:S=$(SUFEXE)) ;
	}

	UNDEFS on $(t) += $(UNDEFFLAG)$(>) ;
d1217 1
a1217 1
	local h ;
d1219 1
a1219 1
	h = $(<:BS=.h) ;
d1223 1
a1223 1
	MakeLocate $(<) $(h) : $(LOCATE_SOURCE) ;
d1227 4
a1230 3
	    DEPENDS $(<) $(h) : $(>) ;
	    Yacc1 $(<) $(h) : $(>) ;
	    Clean clean : $(<) $(h) ;
d1233 1
a1233 1
	# make sure someone includes $(h) else it will be
d1236 1
a1236 1
	INCLUDES $(<) : $(h) ;
d1243 1
a1243 1
rule makeString
d1245 1
a1245 1
	local _t ;
d1247 5
a1251 2
	$(<) = $(>[1]) ;
	for _t in $(>[2-])
d1253 1
a1253 1
		$(<) = $($(<))$(_t) ;
d1255 2
d1259 1
a1259 1
rule makeSubDir
d1261 57
d1324 1
a1324 1
	if ! $(>[1]) 
d1332 1
a1332 1
	    for _i in $(>[2-])
d1338 1
a1338 1
	$(<) = $(_d) ;
d1341 1
a1341 1
rule addDirName
d1345 1
a1345 2
	# Turn individual elements in $(>) into a usable path.
	# Add result to $(<).
d1347 1
a1347 1
	if ! $(>)
d1360 1
a1360 1
	    switch $(>[1])
d1362 3
a1364 3
	    case *:* : _s = $(>[1]) ;
	    case \\[*\\] : _s = $(>[1]) ;
	    case * : _s = [.$(>[1])] ;
d1367 1
a1367 1
	    for _i in [.$(>[2-])]
d1376 1
a1376 1
	    for _i in $(>)
d1383 1
a1383 1
	    _s = $(>[1]) ; 
d1385 1
a1385 1
	    for _i in $(>[2-])
d1391 1
a1391 6
	$(<) += $(_s) ;
}

rule makeDirName
{
	$(<) = ; addDirName $(<) : $(>) ;
a1393 8
rule makeGrist
{
	local _g _i ;

	# Turn individual elements in $(>) into grist.
	# Return result in $(<)

	_g = $(>[1]) ;
d1395 1
a1395 9
	for _i in $(>[2-])
	{
	    _g = $(_g)!$(_i) ;
	}

	$(<) = $(_g) ;
}

rule makeGristedName
d1397 1
a1397 22
	local _i _o ;

	# Produce name with grist in it, if SOURCE_GRIST is set.

	if ! $(SOURCE_GRIST)
	{
	    $(<) = $(>) ;
	}
	else 
	{
	    _o = ;
	    for _i in $(>)
	    {
		switch $(_i)
		{
		case *.h :	_o += $(_i) ;
		case * : 	_o += $(_i:G=$(SOURCE_GRIST)) ;
		}
	    }
	    $(<) = $(_o) ;
	}
}
a1398 2
rule makeCommon
{
d1403 1
a1403 1
	    makeCommon $(<) : $(>) ;
d1407 2
a1408 1
rule makeRelPath 
d1414 1
a1414 1
	_l = $(<[2-]) ;
d1417 1
a1417 1
	makeCommon _l : _r ;
d1421 2
a1422 2
	makeSubDir _l : $(_l) ;
	makeDirName _r : $(_r) ;
d1429 1
a1429 1
	    $(<[1]) = $(_l) ;
d1431 1
a1431 1
	    $(<[1]) = $(_r:R=$(_l)) ;
d1435 1
a1435 1
rule makeSuffixed
d1437 3
a1439 3
   # E.g., "makeSuffixed s_exe $(SUFEXE) : yacc lex foo.bat ;"
   # sets $(s_exe) to (yacc,lex,foo.bat) on Unix and 
   # (yacc.exe,lex.exe,foo.bat) on NT.
d1441 1
a1441 1
	if $(<[2])
d1443 1
a1443 3
	    local _i ;

	    $(<[1]) = ;
d1445 1
a1445 1
	    for _i in $(>)
d1449 1
a1449 1
		    $(<[1]) += $(_i) ;
d1453 1
a1453 1
		    $(<[1]) += $(_i:S=$(<[2])) ;
d1456 1
d1460 1
a1460 1
	    $(<[1]) = $(>) ;
d1480 5
a1484 1
if $(UNIX)
a1485 11
    if $(OS) = QNX 
    {
	actions together piecemeal Archive
	{
	$(AR) $(<) +-$(>) 
	}
    }
    else if $(OS) = BEOS && $(METROWERKS)
    {
	actions together Archive
	{
d1487 1
a1487 9
	}
    }
    else
    {
	actions updated together piecemeal Archive
	{
	$(AR) $(<) $(>)
	}
    }
d1489 2
a1490 2
    actions As
    {
d1492 1
a1492 1
    }
d1494 2
a1495 11
    if $(RELOCATE)
    {
	actions C++
	{
	$(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) $(>)
	}
    }
    else
    {
	actions C++
	{
d1497 1
a1497 2
	}
    }
d1499 2
a1500 2
    actions Cc
    {
d1502 1
a1502 14
    }

    if $(RELOCATE)
    {
	actions Cc
	{
	$(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) $(>)
	}
    }

    actions ignore CcMv
    {
	[ $(<) != $(>:BS=$(SUFOBJ)) ] && $(MV) $(>:BS=$(SUFOBJ)) $(<)
    }
d1504 2
a1505 2
    actions Chgrp
    {
d1507 1
a1507 1
    }
d1509 4
a1512 4
    actions Chmod
    {
	chmod $(MODE) $(<)
    }
d1514 2
a1515 2
    actions Chown
    {
d1517 1
a1517 1
    }
d1519 2
a1520 2
    actions piecemeal together existing Clean
    {
d1522 1
a1522 1
    }
d1524 2
a1525 3
    actions File
    {
	$(RM) $(<)
d1527 1
a1527 1
    }
d1529 2
a1530 2
    actions GenFile1
    {
d1532 1
a1532 1
    }
d1534 2
a1535 2
    actions Fortran
    {
d1537 1
a1537 1
    }
d1539 2
a1540 2
    actions HardLink
    {
d1542 1
a1542 1
    }
d1544 2
a1545 11
    if $(INSTALL)
    {
	actions Install
	{
	$(INSTALL) -m$(MODE) -o$(OWNER) -g$(GROUP) $(>) $(<)
	}
    }
    else
    {
	actions Install
	{
d1547 1
a1547 2
	}
    }
d1549 4
a1552 4
    actions Lex
    {
	$(LEX) $(>) && $(MV) lex.yy.c $(<)
    }
d1554 7
a1560 2
    actions Link bind NEEDLIBS
    {
d1562 1
a1562 1
    }
d1564 2
a1565 2
    actions MkDir1
    {
d1567 1
a1567 1
    }
d1569 2
a1570 2
    actions together Ranlib
    {
d1572 1
a1572 1
    }
d1574 2
a1575 2
    actions quietly updated piecemeal together RmTemps
    {
d1577 1
a1577 1
    }
d1579 2
a1580 2
    actions Shell
    {
d1587 1
a1587 1
    }
d1589 3
a1591 8
    actions Yacc1
    {
	$(YACC) $(YACCFLAGS) $(>) &&
	{
	    $(MV) $(YACCFILES).c $(<[1])
	    $(MV) $(YACCFILES).h $(<[2])
	}
    }
d1593 2
a1594 1
else if $(NT) || $(OS2)
d1596 7
a1602 2
    if $(BCCROOT)
    {
d1604 2
d1608 1
a1608 1
	$(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
d1611 1
a1611 1
	actions Link bind NEEDLIBS
d1613 1
a1613 1
	$(LINK) -e$(<) $(LINKFLAGS) $(UNDEFS) -L$(LINKLIBS) $(NEEDLIBS) $(>)
d1616 24
d1642 2
a1643 1
	$(AR) $(ARFLAGS) $(<) -+$(>)
d1646 5
d1653 15
a1667 5
	$(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
        }
    }
    else if $(MSVC) 
    {
d1670 1
a1670 1
	$(AR) $(<) -+$(>) ;
d1687 3
a1689 3
    }
    else if $(MSVCNT)
    {
d1692 1
a1692 7
	if exist $(<) set _$(<:B)_=$(<)
	$(AR) /out:$(<) %_$(<:B)_% $(>)
	}

	actions As
	{
	$(AS) /Ml /p /v /w2 $(>) $(<) ,nul,nul;
d1695 1
a1695 1
	actions Cc
d1697 1
a1697 1
	$(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) $(>)
d1702 1
a1702 1
	$(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) /Tp$(>)
d1705 1
a1705 1
	actions Link bind NEEDLIBS
d1707 1
a1707 1
	$(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
d1709 9
a1717 3
    }
    else if $(WATCOM)
    {
a1736 5
    }

    actions Chmod
    {
    }
d1738 5
a1742 24
    actions piecemeal together existing Clean
    {
	$(RM) $(>)
    }

    actions File
    {
	copy $(>) $(<)
    }

    actions GenFile1
    {
	$(>[1]) $(<) $(>[2-])
    }

    actions Install
    {
	copy $(>) $(<)
    }

    actions MkDir1
    {
	$(MKDIR) $(<)
    }
d1744 3
a1746 4
    actions quietly updated piecemeal together RmTemps
    {
	$(RM) $(>)
    }
a1747 5
    actions Shell
    {
	copy $(>) $(<)
    }
}
a1749 1

d1757 1
a1757 1
	cc/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>) 
d1762 1
a1762 6
	cxx/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>) 
    }

    actions Chmod
    {
	set file/prot=$(MODE) $(<)
d1772 1
a1772 6
       if f$search("$(<)") .eqs. "" then lib/create $(<)
    }

    actions File
    {
	copy $(>) $(<)
a1779 11
    actions Install
    {
	copy $(>) $(<)
    }

    actions Lex
    {
	$(LEX) $(>) 
	$(MV) lex.yy.c $(<)
    }

a1784 5
    actions MkDir1
    {
	create/dir $(<)
    }

d1792 1
a1792 8
	copy $(>) $(<)
    }

    actions Yacc1
    {
	$(YACC) $(YACCFLAGS) $(>)
	$(MV) $(YACCFILES).c $(<[1])
	$(MV) $(YACCFILES).h $(<[2])
d1795 5
a1801 2
    SP = " " ;

d1809 1
a1809 1
	set MWCincludes $(MACINC)
d1815 1
a1815 1
	set MWCincludes $(MACINC)
a1818 25
    rule Chmod
    {
	# no chmod on mac - could setfile -l/-L to make rw/ro
    }

    actions piecemeal together existing Clean
    {
	$(RM) $(>)
    }

    actions File
    {
	copy $(>) $(<)
    }

    actions GenFile1
    {
	$(>[1]) $(<) $(>[2-])
    }

    actions Install
    {
	copy $(>) $(<)
    }

a1822 15

    actions MkDir1
    {
	$(MKDIR) $(<)
    }

    actions quietly updated piecemeal together RmTemps
    {
	$(RM) $(>)
    }

    actions Shell
    {
	copy $(>) $(<)
    }
a1824 1

d1847 8
d1860 1
a1860 1
    if $(JAMFILE) { include $(JAMFILE) ; }
@


1.67
log
@@
text
@d38 1
d177 4
@


1.5
log
@@
text
@d168 3
d173 1
a173 1
case MVS :	RANLIB default = "" ; RELOCATE = true ;
d182 1
a182 1
case SINIX :	RANLIB default = "" ; RELOCATE = true ;
d461 3
a464 1
	CWMAC		default = "{CWMAC}" ;
a465 5
	CWGUSIHDR	default = $(CWGUSI):include ;
	CWGUSILIB	default = $(CWGUSI):Lib ;
	CWMACLIB	default = $(CWMAC):Libraries ;
	CWMACHDR	default = $(CWMAC):Headers ;
	
d467 3
a469 1
	CCFLAGS		default = -w off ;
d473 6
a478 3
	HDRS		default = $(CWGUSIHDR) 
				  $(CWMACHDR):"ANSI Headers" 
				  $(CWMACHDR):"Universal Headers" ;
d481 9
a489 8
	LINKLIBS	default = "$(CWGUSILIB):GUSIMPW.Lib.PPC" 
				  "$(CWGUSILIB):GUSI.Lib.PPC" 
				  "$(CWMACLIB):MacOS Common:Interfacelib" 
				  "$(CWMACLIB):MacOS Common:PLStringFuncs Glue:PLStringFuncsPPC.lib" 
				  "$(CWMACLIB):Runtime:Runtime PPC:MWMPWCRuntime.lib" 
				  "$(CWMACLIB):ANSI PPC:MPW ANSI.C.PPC.Lib" 
				  "$(CWMACLIB):MacOS PPC:PPCToolLibs.o" 
				  "$(CWMACLIB):MacOS PPC:Mathlib" ;
d1500 1
a1500 9
    if $(OS) = SINIX
    {
	actions C++
	{
	[ $(>:S) != .C ] && $(CP) $(>) $(>:S=.C) && trap "rm -f $(>:S=.C)" 0
	$(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) $(>:S=.C)
	}
    } 
    else if $(RELOCATE)
@


1.4
log
@@
text
@d205 1
a205 1
	else if $(OS) = BEOS 
d226 17
d513 1
a513 1
HDRPATTERN = "^#[	 ]*include[	 ]*[<\"](.*)[\">].*$" ;
d1474 1
a1474 1
    else if $(OS) = BEOS
d1857 1
a1857 1
    actions together piecemeal Archive 
@


1.2
log
@@
text
@d215 2
a216 1
	LINK		default = $(CC) ;
d226 7
@
