/[ascend]/trunk/jam/Jambase
ViewVC logotype

Diff of /trunk/jam/Jambase

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 59 by jds, Sat Oct 1 18:10:03 2005 UTC revision 60 by jds, Mon Oct 31 03:39:15 2005 UTC
# Line 1  Line 1 
1  #  #
2  # /+\  # /+\
3  # +\    Copyright 1993, 2000 Christopher Seiwald.  # +\    Copyright 1993, 2000 Christopher Seiwald.
4  # \+/  # \+/
5  #  #
6  # This file is part of Jam - see jam.c for Copyright information.  # This file is part of Jam - see jam.c for Copyright information.
7  #  #
8    
9  #  #
10  # JAMBASE - jam 2.3 ruleset providing make(1)-like functionality  # JAMBASE - jam 2.3 ruleset providing make(1)-like functionality
11  #  #
12  # Supports UNIX, NT, and VMS.  # Supports UNIX, NT, and VMS.
13  #  #
14  # 12/27/93 (seiwald) - purturb library sources with SOURCE_GRIST  # 12/27/93 (seiwald) - purturb library sources with SOURCE_GRIST
15  # 04/18/94 (seiwald) - use '?=' when setting OS specific vars  # 04/18/94 (seiwald) - use '?=' when setting OS specific vars
16  # 04/21/94 (seiwald) - do RmTemps together  # 04/21/94 (seiwald) - do RmTemps together
17  # 05/05/94 (seiwald) - all supported C compilers support -o: relegate  # 05/05/94 (seiwald) - all supported C compilers support -o: relegate
18  #                      RELOCATE as an option; set Ranlib to "" to disable it  #                      RELOCATE as an option; set Ranlib to "" to disable it
19  # 06/01/94 (seiwald) - new 'actions existing' to do existing sources  # 06/01/94 (seiwald) - new 'actions existing' to do existing sources
20  # 08/25/94 (seiwald) - new ObjectCcFlags rule to append to per-target CCFLAGS  # 08/25/94 (seiwald) - new ObjectCcFlags rule to append to per-target CCFLAGS
21  # 08/29/94 (seiwald) - new ObjectHdrs rule to append to per-target HDRS  # 08/29/94 (seiwald) - new ObjectHdrs rule to append to per-target HDRS
22  # 09/19/94 (seiwald) - LinkLibraries and Undefs now append  # 09/19/94 (seiwald) - LinkLibraries and Undefs now append
23  #                    - Rule names downshifted.  #                    - Rule names downshifted.
24  # 10/06/94 (seiwald) - Dumb yyacc stuff moved into Jamfile.  # 10/06/94 (seiwald) - Dumb yyacc stuff moved into Jamfile.
25  # 10/14/94 (seiwald) - (Crude) support for .s, .C, .cc, .cpp, and .f files.  # 10/14/94 (seiwald) - (Crude) support for .s, .C, .cc, .cpp, and .f files.
26  # 01/08/95 (seiwald) - Shell now handled with awk, not sed  # 01/08/95 (seiwald) - Shell now handled with awk, not sed
27  # 01/09/95 (seiwald) - Install* now take dest directory as target  # 01/09/95 (seiwald) - Install* now take dest directory as target
28  # 01/10/95 (seiwald) - All entries sorted.  # 01/10/95 (seiwald) - All entries sorted.
29  # 01/10/95 (seiwald) - NT support moved in, with LauraW's help.  # 01/10/95 (seiwald) - NT support moved in, with LauraW's help.
30  # 01/10/95 (seiwald) - VMS support moved in.  # 01/10/95 (seiwald) - VMS support moved in.
31  # 02/06/95 (seiwald) - ObjectC++Flags and SubDirC++Flags added.  # 02/06/95 (seiwald) - ObjectC++Flags and SubDirC++Flags added.
32  # 02/07/95 (seiwald) - Iron out when HDRSEARCH uses "" or SEARCH_SOURCE.  # 02/07/95 (seiwald) - Iron out when HDRSEARCH uses "" or SEARCH_SOURCE.
33  # 02/08/95 (seiwald) - SubDir works on VMS.  # 02/08/95 (seiwald) - SubDir works on VMS.
34  # 02/14/95 (seiwald) - MkDir and entourage.  # 02/14/95 (seiwald) - MkDir and entourage.
35  # 04/30/95 (seiwald) - Use install -c flag so that it copies, not moves.  # 04/30/95 (seiwald) - Use install -c flag so that it copies, not moves.
36  # 07/10/95 (taylor)  - Support for Microsoft C++.  # 07/10/95 (taylor)  - Support for Microsoft C++.
37  # 11/21/96 (peterk)  - Support for BeOS  # 11/21/96 (peterk)  - Support for BeOS
38  # 07/19/99 (sickel)  - Support for Mac OS X Server (and maybe client)  # 07/19/99 (sickel)  - Support for Mac OS X Server (and maybe client)
39  # 02/18/00 (belmonte)- Support for Cygwin.  # 02/18/00 (belmonte)- Support for Cygwin.
40  # 11/05/04 (st.clair)- Modified MinGW variables and actions  # 11/05/04 (st.clair)- Modified MinGW variables and actions
41    
42  # Special targets defined in this file:  # Special targets defined in this file:
43  #  #
44  # all       - parent of first, shell, files, lib, exe  # all       - parent of first, shell, files, lib, exe
45  # first     - first dependent of 'all', for potential initialization  # first     - first dependent of 'all', for potential initialization
46  # shell     - parent of all Shell targets  # shell     - parent of all Shell targets
47  # files     - parent of all File targets  # files     - parent of all File targets
48  # lib       - parent of all Library targets  # lib       - parent of all Library targets
49  # exe       - parent of all Main targets  # exe       - parent of all Main targets
50  # dirs      - parent of all MkDir targets  # dirs      - parent of all MkDir targets
51  # clean     - removes all Shell, File, Library, and Main targets  # clean     - removes all Shell, File, Library, and Main targets
52  # uninstall - removes all Install targets  # uninstall - removes all Install targets
53  #    #  
54    
55  # Rules defined by this file:  # Rules defined by this file:
56  #  #
57  # as obj.o : source.s ;         .s -> .o  # as obj.o : source.s ;         .s -> .o
58  # Bulk dir : files ;            populate directory with many files  # Bulk dir : files ;            populate directory with many files
59  # Cc obj.o : source.c ;         .c -> .o  # Cc obj.o : source.c ;         .c -> .o
60  # C++ obj.o : source.cc ;       .cc -> .o  # C++ obj.o : source.cc ;       .cc -> .o
61  # Clean clean : sources ;       remove sources with 'jam clean'  # Clean clean : sources ;       remove sources with 'jam clean'
62  # File dest : source ;          copy file  # File dest : source ;          copy file
63  # Fortran obj.o : source.f ;        .f -> .o  # Fortran obj.o : source.f ;        .f -> .o
64  # GenFile source.c : program args ; make custom file  # GenFile source.c : program args ; make custom file
65  # Hardlink target : source ;        make link from source to target  # Hardlink target : source ;        make link from source to target
66  # HdrRule source : headers ;        handle #includes  # HdrRule source : headers ;        handle #includes
67  # InstallInto dir : sources ;       install any files  # InstallInto dir : sources ;       install any files
68  # InstallBin dir : sources ;        install binaries  # InstallBin dir : sources ;        install binaries
69  # InstallLib dir : sources ;        install files  # InstallLib dir : sources ;        install files
70  # InstallFile dir : sources ;       install files  # InstallFile dir : sources ;       install files
71  # InstallMan dir : sources ;        install man pages  # InstallMan dir : sources ;        install man pages
72  # InstallShell dir : sources ;      install shell scripts  # InstallShell dir : sources ;      install shell scripts
73  # Lex source.c : source.l ;     .l -> .c  # Lex source.c : source.l ;     .l -> .c
74  # Library lib : source ;        archive library from compiled sources  # Library lib : source ;        archive library from compiled sources
75  # LibraryFromObjects lib : objects ;    archive library from objects  # LibraryFromObjects lib : objects ;    archive library from objects
76  # LinkLibraries images : libraries ;    bag libraries onto Mains  # LinkLibraries images : libraries ;    bag libraries onto Mains
77  # Main image : source ;         link executable from compiled sources  # Main image : source ;         link executable from compiled sources
78  # MainFromObjects image : objects ; link executable from objects  # MainFromObjects image : objects ; link executable from objects
79  # MkDir dir ;               make a directory, if not there  # MkDir dir ;               make a directory, if not there
80  # Object object : source ;      compile object from source  # Object object : source ;      compile object from source
81  # ObjectCcFlags source : flags ;    add compiler flags for object  # ObjectCcFlags source : flags ;    add compiler flags for object
82  # ObjectC++Flags source : flags ;   add compiler flags for object  # ObjectC++Flags source : flags ;   add compiler flags for object
83  # ObjectHdrs source : dirs ;        add include directories for object  # ObjectHdrs source : dirs ;        add include directories for object
84  # Objects sources ;         compile sources  # Objects sources ;         compile sources
85  # RmTemps target : sources ;        remove temp sources after target made  # RmTemps target : sources ;        remove temp sources after target made
86  # Setuid images ;           mark executables Setuid  # Setuid images ;           mark executables Setuid
87  # SubDir TOP d1 d2 ... ;        start a subdirectory Jamfile  # SubDir TOP d1 d2 ... ;        start a subdirectory Jamfile
88  # SubDirCcFlags flags ;         add compiler flags until next SubDir  # SubDirCcFlags flags ;         add compiler flags until next SubDir
89  # SubDirC++Flags flags ;        add compiler flags until next SubDir  # SubDirC++Flags flags ;        add compiler flags until next SubDir
90  # SubDirHdrs dirs ;         add include dirs until next SubDir  # SubDirHdrs dirs ;         add include dirs until next SubDir
91  # SubInclude TOP d1 d2 ... ;        include a subdirectory Jamfile  # SubInclude TOP d1 d2 ... ;        include a subdirectory Jamfile
92  # Shell exe : source ;          make a shell executable  # Shell exe : source ;          make a shell executable
93  # Undefines images : symbols ;      save undef's for linking  # Undefines images : symbols ;      save undef's for linking
94  # UserObject object : source ;      handle unknown suffixes for Object  # UserObject object : source ;      handle unknown suffixes for Object
95  # Yacc source.c : source.y ;        .y -> .c  # Yacc source.c : source.y ;        .y -> .c
96  #  #
97  # Utility rules that have no side effects (not supported):  # Utility rules that have no side effects (not supported):
98  #  #
99  # FAppendSuffix f1 f2 ... : $(SUF) ;    return $(<) with suffixes  # FAppendSuffix f1 f2 ... : $(SUF) ;    return $(<) with suffixes
100  # FConcat value ... ;               return contatenated values  # FConcat value ... ;               return contatenated values
101  # FDirName d1 d2 ... ;          return path from root to dir  # FDirName d1 d2 ... ;          return path from root to dir
102  # FGrist d1 d2 ... ;            return d1!d2!...  # FGrist d1 d2 ... ;            return d1!d2!...
103  # FGristFiles value ;           return $(value:G=$(SOURCE_GRIST))  # FGristFiles value ;           return $(value:G=$(SOURCE_GRIST))
104  # FGristSourceFiles value ;     return $(value:G=$(SOURCE_GRIST))  # FGristSourceFiles value ;     return $(value:G=$(SOURCE_GRIST))
105  # FRelPath d1 : d2 ;            return rel path from d1 to d2  # FRelPath d1 : d2 ;            return rel path from d1 to d2
106  # FSubDir d1 d2 ... ;           return path to root  # FSubDir d1 d2 ... ;           return path to root
107  #  #
108    
109    
110  # Brief review of the jam language:  # Brief review of the jam language:
111  #  #
112  # Statements:  # Statements:
113  #   rule RULE - statements to process a rule  #   rule RULE - statements to process a rule
114  #   actions RULE - system commands to carry out target update  #   actions RULE - system commands to carry out target update
115  #  #
116  # Modifiers on actions:  # Modifiers on actions:
117  #   together - multiple instances of same rule on target get executed  #   together - multiple instances of same rule on target get executed
118  #          once with their sources ($(>)) concatenated  #          once with their sources ($(>)) concatenated
119  #   updated - refers to updated sources ($(>)) only  #   updated - refers to updated sources ($(>)) only
120  #   ignore - ignore return status of command  #   ignore - ignore return status of command
121  #   quietly - don't trace its execution unless verbose  #   quietly - don't trace its execution unless verbose
122  #   piecemeal - iterate command each time with a small subset of $(>)  #   piecemeal - iterate command each time with a small subset of $(>)
123  #   existing - refers to currently existing sources ($(>)) only  #   existing - refers to currently existing sources ($(>)) only
124  #   bind vars - subject to binding before expanding in actions  #   bind vars - subject to binding before expanding in actions
125  #  #
126  # Special rules:  # Special rules:
127  #   ALWAYS - always build a target  #   ALWAYS - always build a target
128  #   DEPENDS - builds the dependency graph  #   DEPENDS - builds the dependency graph
129  #   ECHO - blurt out targets on stdout  #   ECHO - blurt out targets on stdout
130  #   EXIT - blurt out targets and exit  #   EXIT - blurt out targets and exit
131  #   INCLUDES - marks sources as headers for target (a codependency)  #   INCLUDES - marks sources as headers for target (a codependency)
132  #   NOCARE - don't panic if the target can't be built  #   NOCARE - don't panic if the target can't be built
133  #   NOUPDATE - create the target if needed but never update it  #   NOUPDATE - create the target if needed but never update it
134  #   NOTFILE - ignore the timestamp of the target (it's not a file)  #   NOTFILE - ignore the timestamp of the target (it's not a file)
135  #   TEMPORARY - target need not be present if sources haven't changed  #   TEMPORARY - target need not be present if sources haven't changed
136  #  #
137  # Special variables set by jam:  # Special variables set by jam:
138  #   $(<) - targets of a rule (to the left of the :)  #   $(<) - targets of a rule (to the left of the :)
139  #   $(>) - sources of a rule (to the right of the :)  #   $(>) - sources of a rule (to the right of the :)
140  #   $(xxx) - true on xxx (UNIX, VMS, NT, OS2, MAC)  #   $(xxx) - true on xxx (UNIX, VMS, NT, OS2, MAC)
141  #   $(OS) - name of OS - varies wildly  #   $(OS) - name of OS - varies wildly
142  #   $(JAMVERSION) - version number (2.3)  #   $(JAMVERSION) - version number (2.3)
143  #  #
144  # Special variables used by jam:  # Special variables used by jam:
145  #   SEARCH - where to find something (used during binding and actions)  #   SEARCH - where to find something (used during binding and actions)
146  #   LOCATE - where to plop something not found with SEARCH  #   LOCATE - where to plop something not found with SEARCH
147  #   HDRRULE - rule to call to handle include files  #   HDRRULE - rule to call to handle include files
148  #   HDRSCAN - egrep regex to extract include files  #   HDRSCAN - egrep regex to extract include files
149  #  #
150  # Special targets:  # Special targets:
151  #   all - default if none given on command line  #   all - default if none given on command line
152  #  #
153    
154  # Initialize variables  # Initialize variables
155  #  #
156    
157  #  #
158  # OS specific variable settings  # OS specific variable settings
159  #  #
160    
161  if $(NT)  if $(NT)
162  {  {
163    # the list of supported toolsets on Windows NT and Windows 95/98    # the list of supported toolsets on Windows NT and Windows 95/98
164    #    #
165    local SUPPORTED_TOOLSETS =    local SUPPORTED_TOOLSETS =
166      "BORLANDC"      "BORLANDC"
167      "VISUALC"      "VISUALC"
168      "VISUALC16"      "VISUALC16"
169      "INTELC"      "INTELC"
170      "WATCOM"      "WATCOM"
171      "MINGW"      "MINGW"
172      "LCC"      "LCC"
173      ;      ;
174    
175    # this variable holds the current toolset    # this variable holds the current toolset
176    #    #
177    TOOLSET = "" ;    TOOLSET = "" ;
178    
179    # if the JAM_TOOLSET environment variable is defined, check that it is    # if the JAM_TOOLSET environment variable is defined, check that it is
180    # one of our supported values    # one of our supported values
181    #    #
182    if $(JAM_TOOLSET)    if $(JAM_TOOLSET)
183    {    {
184      local t ;      local t ;
185    
186      for t in $(SUPPORTED_TOOLSETS)      for t in $(SUPPORTED_TOOLSETS)
187      {      {
188        if $(t) = $(JAM_TOOLSET) { TOOLSET = $(t) ; }        if $(t) = $(JAM_TOOLSET) { TOOLSET = $(t) ; }
189      }      }
190    
191      if ! $(TOOLSET)      if ! $(TOOLSET)
192      {      {
193        ECHO  "The JAM_TOOLSET environment variable is defined but its value" ;        ECHO  "The JAM_TOOLSET environment variable is defined but its value" ;
194        ECHO  "is invalid, please use one of the following:" ;        ECHO  "is invalid, please use one of the following:" ;
195        ECHO  ;        ECHO  ;
196    
197        for t in $(SUPPORTED_TOOLSETS) { ECHO "  " $(t) ; }        for t in $(SUPPORTED_TOOLSETS) { ECHO "  " $(t) ; }
198        EXIT ;        EXIT ;
199      }      }
200    }    }
201    
202    # if TOOLSET is empty, we'll try to detect the toolset from other    # if TOOLSET is empty, we'll try to detect the toolset from other
203    # environment variables to remain backwards compatible with Jam 2.3    # environment variables to remain backwards compatible with Jam 2.3
204    #    #
205    if ! $(TOOLSET)    if ! $(TOOLSET)
206    {    {
207      if $(BCCROOT)      if $(BCCROOT)
208      {      {
209        TOOLSET  = BORLANDC ;        TOOLSET  = BORLANDC ;
210        BORLANDC = $(BCCROOT) ;        BORLANDC = $(BCCROOT) ;
211      }      }
212      else if $(MSVC)      else if $(MSVC)
213      {      {
214        TOOLSET   = VISUALC16 ;        TOOLSET   = VISUALC16 ;
215        VISUALC16 = $(MSVC) ;        VISUALC16 = $(MSVC) ;
216      }      }
217      else if $(MSVCNT)      else if $(MSVCNT)
218      {      {
219        TOOLSET = VISUALC ;        TOOLSET = VISUALC ;
220        VISUALC = $(MSVCNT) ;        VISUALC = $(MSVCNT) ;
221      }      }
222      else if $(MINGW)      else if $(MINGW)
223      {      {
224        TOOLSET = MINGW ;        TOOLSET = MINGW ;
225      }      }
226      else if $(WATCOM)      else if $(WATCOM)
227      {      {
228        TOOLSET = WATCOM ;        TOOLSET = WATCOM ;
229      }      }
230      else      else
231      {      {
232        ECHO  "Jam cannot be run because you didn't indicate which compilation toolset" ;        ECHO  "Jam cannot be run because you didn't indicate which compilation toolset" ;
233        ECHO  "to use. To do so, follow these simple instructions:" ;        ECHO  "to use. To do so, follow these simple instructions:" ;
234        ECHO  ;        ECHO  ;
235        ECHO  "  - define one of the following environment variable, with the" ;        ECHO  "  - define one of the following environment variable, with the" ;
236        ECHO  "    appropriate value according to this list:" ;        ECHO  "    appropriate value according to this list:" ;
237        ECHO  ;        ECHO  ;
238        ECHO  "   Variable    Toolset                      Description" ;        ECHO  "   Variable    Toolset                      Description" ;
239        ECHO  ;        ECHO  ;
240        ECHO  "   BORLANDC    Borland C++                  BC++ install path" ;        ECHO  "   BORLANDC    Borland C++                  BC++ install path" ;
241        ECHO  "   VISUALC     Microsoft Visual C++         VC++ install path" ;        ECHO  "   VISUALC     Microsoft Visual C++         VC++ install path" ;
242        ECHO  "   VISUALC16   Microsoft Visual C++ 16 bit  VC++ 16 bit install" ;        ECHO  "   VISUALC16   Microsoft Visual C++ 16 bit  VC++ 16 bit install" ;
243        ECHO  "   INTELC      Intel C/C++                  IC++ install path" ;        ECHO  "   INTELC      Intel C/C++                  IC++ install path" ;
244        ECHO  "   WATCOM      Watcom C/C++                 Watcom install path" ;        ECHO  "   WATCOM      Watcom C/C++                 Watcom install path" ;
245        ECHO  "   MINGW       MinGW (gcc)                  MinGW install path" ;        ECHO  "   MINGW       MinGW (gcc)                  MinGW install path" ;
246        ECHO  "   LCC         Win32-LCC                    LCC-Win32 install path" ;        ECHO  "   LCC         Win32-LCC                    LCC-Win32 install path" ;
247        ECHO  ;        ECHO  ;
248        ECHO  "  - define the JAM_TOOLSET environment variable with the *name*" ;        ECHO  "  - define the JAM_TOOLSET environment variable with the *name*" ;
249        ECHO  "    of the toolset variable you want to use." ;        ECHO  "    of the toolset variable you want to use." ;
250        ECHO  ;        ECHO  ;
251        ECHO  "  e.g.:  set VISUALC=C:\Visual6" ;        ECHO  "  e.g.:  set VISUALC=C:\Visual6" ;
252        ECHO  "         set JAM_TOOLSET=VISUALC" ;        ECHO  "         set JAM_TOOLSET=VISUALC" ;
253        ECHO  ;        ECHO  ;
254        EXIT  ;        EXIT  ;
255      }      }
256    }    }
257    
258    CP          ?= copy ;    CP          ?= copy ;
259    RM          ?= del ;    RM          ?= del ;
260    MV          ?= move /Y ;    MV          ?= move /Y ;
261    SLASH       ?= \\ ;    SLASH       ?= \\ ;
262    SUFLIB      ?= .lib ;    SUFLIB      ?= .lib ;
263    SUFOBJ      ?= .obj ;    SUFOBJ      ?= .obj ;
264    SUFEXE      ?= .exe ;    SUFEXE      ?= .exe ;
265    
266    if $(TOOLSET) = BORLANDC    if $(TOOLSET) = BORLANDC
267    {    {
268      ECHO "Compiler is Borland C++" ;      ECHO "Compiler is Borland C++" ;
269    
270      AR          ?= tlib /C /P64 ;      AR          ?= tlib /C /P64 ;
271      CC          ?= bcc32 ;      CC          ?= bcc32 ;
272      CCFLAGS     ?= -q -y -d -v -w-par -w-ccc -w-rch -w-pro -w-aus ;      CCFLAGS     ?= -q -y -d -v -w-par -w-ccc -w-rch -w-pro -w-aus ;
273      C++         ?= bcc32 ;      C++         ?= bcc32 ;
274      C++FLAGS    ?= -q -y -d -v -w-par -w-ccc -w-rch -w-pro -w-aus -P ;      C++FLAGS    ?= -q -y -d -v -w-par -w-ccc -w-rch -w-pro -w-aus -P ;
275      STDLIBPATH  ?= $(BORLANDC)\\lib ;      STDLIBPATH  ?= $(BORLANDC)\\lib ;
276      STDHDRS     ?= $(BORLANDC)\\include ;      STDHDRS     ?= $(BORLANDC)\\include ;
277      LINK        ?= $(CC) ;      LINK        ?= $(CC) ;
278      LINKFLAGS   ?= $(CCFLAGS) -L$(STDLIBPATH) ;      LINKFLAGS   ?= $(CCFLAGS) -L$(STDLIBPATH) ;
279      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
280    }    }
281    else if $(TOOLSET) = VISUALC16    else if $(TOOLSET) = VISUALC16
282    {    {
283      ECHO "Compiler is Microsoft Visual C++ 16 bit" ;      ECHO "Compiler is Microsoft Visual C++ 16 bit" ;
284    
285      AR          ?= lib /nologo ;      AR          ?= lib /nologo ;
286      CC          ?= cl /nologo ;      CC          ?= cl /nologo ;
287      CCFLAGS     ?= /D \"WIN\" ;      CCFLAGS     ?= /D \"WIN\" ;
288      C++         ?= $(CC) ;      C++         ?= $(CC) ;
289      C++FLAGS    ?= $(CCFLAGS) ;      C++FLAGS    ?= $(CCFLAGS) ;
290      LINK        ?= $(CC) ;      LINK        ?= $(CC) ;
291      LINKFLAGS   ?= $(CCFLAGS) ;      LINKFLAGS   ?= $(CCFLAGS) ;
292      LINKLIBS    ?=      LINKLIBS    ?=
293                  #$(VISUALC16)\\lib\\advapi32.lib                  #$(VISUALC16)\\lib\\advapi32.lib
294                  #$(VISUALC16)\\lib\\libcmt.lib                  #$(VISUALC16)\\lib\\libcmt.lib
295                  $(VISUALC16)\\lib\\mlibce.lib                  $(VISUALC16)\\lib\\mlibce.lib
296                  #$(VISUALC16)\\lib\\slibce.lib                  #$(VISUALC16)\\lib\\slibce.lib
297                  $(VISUALC16)\\lib\\oldnames.lib                  $(VISUALC16)\\lib\\oldnames.lib
298                  #$(VISUALC16)\\lib\\kernel32.lib                  #$(VISUALC16)\\lib\\kernel32.lib
299                  ;                  ;
300      LINKLIBS    ?= ;      LINKLIBS    ?= ;
301      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
302      OPTIM       ?= "" ;      OPTIM       ?= "" ;
303      STDHDRS     ?= $(VISUALC16)\\include ;      STDHDRS     ?= $(VISUALC16)\\include ;
304      UNDEFFLAG   ?= "/u _" ;      UNDEFFLAG   ?= "/u _" ;
305    }    }
306    else if $(TOOLSET) = VISUALC    else if $(TOOLSET) = VISUALC
307    {    {
308      ECHO "Compiler is Microsoft Visual C++" ;      ECHO "Compiler is Microsoft Visual C++" ;
309    
310      AR          ?= lib ;      AR          ?= lib ;
311      AS          ?= masm386 ;      AS          ?= masm386 ;
312      CC          ?= cl /nologo ;      CC          ?= cl /nologo ;
313      CCFLAGS     ?= "" ;      CCFLAGS     ?= "" ;
314      C++         ?= $(CC) ;      C++         ?= $(CC) ;
315      C++FLAGS    ?= $(CCFLAGS) ;      C++FLAGS    ?= $(CCFLAGS) ;
316      LINK        ?= link /nologo ;      LINK        ?= link /nologo ;
317      LINKFLAGS   ?= "" ;      LINKFLAGS   ?= "" ;
318      LINKLIBS    ?= /LIBPATH:$(VISUALC)\\lib      LINKLIBS    ?= /LIBPATH:$(VISUALC)\\lib
319                     /LIBPATH:$(VISUALC)\\PlatformSDK\\lib                     /LIBPATH:$(VISUALC)\\PlatformSDK\\lib
320                     advapi32.lib                     advapi32.lib
321                     libc.lib                     libc.lib
322                     oldnames.lib                     oldnames.lib
323                     gdi32.lib                     gdi32.lib
324                     user32.lib                     user32.lib
325                     kernel32.lib ;                     kernel32.lib ;
326      OPTIM       ?= "" ;      OPTIM       ?= "" ;
327      STDHDRS     ?= $(VISUALC)\\include $(VISUALC)\\PlatformSDK\\include ;      STDHDRS     ?= $(VISUALC)\\include $(VISUALC)\\PlatformSDK\\include ;
328      UNDEFFLAG   ?= "/u _" ;      UNDEFFLAG   ?= "/u _" ;
329    }    }
330    else if $(TOOLSET) = INTELC    else if $(TOOLSET) = INTELC
331    {    {
332       ECHO "Compiler is Intel C/C++" ;       ECHO "Compiler is Intel C/C++" ;
333    
334        if ! $(VISUALC)        if ! $(VISUALC)
335        {        {
336          ECHO "As a special exception, when using the Intel C++ compiler, you need" ;          ECHO "As a special exception, when using the Intel C++ compiler, you need" ;
337          ECHO "to define the VISUALC environment variable to indicate the location" ;          ECHO "to define the VISUALC environment variable to indicate the location" ;
338          ECHO "of your Visual C++ installation. Aborting.." ;          ECHO "of your Visual C++ installation. Aborting.." ;
339          EXIT ;          EXIT ;
340        }        }
341    
342      AR          ?= lib ;      AR          ?= lib ;
343      AS          ?= masm386 ;      AS          ?= masm386 ;
344      CC          ?= icl /nologo ;      CC          ?= icl /nologo ;
345      CCFLAGS     ?= "" ;      CCFLAGS     ?= "" ;
346      C++         ?= $(CC) ;      C++         ?= $(CC) ;
347      C++FLAGS    ?= $(CCFLAGS) ;      C++FLAGS    ?= $(CCFLAGS) ;
348      LINK        ?= link /nologo ;      LINK        ?= link /nologo ;
349      LINKFLAGS   ?= "" ;      LINKFLAGS   ?= "" ;
350      LINKLIBS    ?= $(VISUALC)\\lib\\advapi32.lib      LINKLIBS    ?= $(VISUALC)\\lib\\advapi32.lib
351                     $(VISUALC)\\lib\\libc.lib                     $(VISUALC)\\lib\\libc.lib
352                     $(VISUALC)\\lib\\oldnames.lib                     $(VISUALC)\\lib\\oldnames.lib
353                     $(VISUALC)\\lib\\kernel32.lib ;                     $(VISUALC)\\lib\\kernel32.lib ;
354      OPTIM       ?= "" ;      OPTIM       ?= "" ;
355      STDHDRS     ?= $(INTELC)\include $(VISUALC)\\include ;      STDHDRS     ?= $(INTELC)\include $(VISUALC)\\include ;
356      UNDEFFLAG   ?= "/u _" ;      UNDEFFLAG   ?= "/u _" ;
357    }    }
358    else if $(TOOLSET) = WATCOM    else if $(TOOLSET) = WATCOM
359    {    {
360      ECHO "Compiler is Watcom C/C++" ;      ECHO "Compiler is Watcom C/C++" ;
361    
362      AR          ?= wlib ;      AR          ?= wlib ;
363      CC          ?= wcc386 ;      CC          ?= wcc386 ;
364      CCFLAGS     ?= /zq /DWIN32 /I$(WATCOM)\\h ; # zq=quiet      CCFLAGS     ?= /zq /DWIN32 /I$(WATCOM)\\h ; # zq=quiet
365      C++         ?= wpp386 ;      C++         ?= wpp386 ;
366      C++FLAGS    ?= $(CCFLAGS) ;      C++FLAGS    ?= $(CCFLAGS) ;
367      DOT         ?= . ;      DOT         ?= . ;
368      DOTDOT      ?= .. ;      DOTDOT      ?= .. ;
369      FORTRAN     ?= wfc386 ;      FORTRAN     ?= wfc386 ;
370      LINK        ?= wcl386 ;      LINK        ?= wcl386 ;
371      LINKFLAGS   ?= /zq ; # zq=quiet      LINKFLAGS   ?= /zq ; # zq=quiet
372      LINKLIBS    ?= ;      LINKLIBS    ?= ;
373      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
374      OPTIM       ?= ;      OPTIM       ?= ;
375      STDHDRS     ?= $(WATCOM)\\h $(WATCOM)\\h\\nt ;      STDHDRS     ?= $(WATCOM)\\h $(WATCOM)\\h\\nt ;
376      UNDEFFLAG   ?= "/u _" ;      UNDEFFLAG   ?= "/u _" ;
377    }    }
378    else if $(TOOLSET) = MINGW    else if $(TOOLSET) = MINGW
379    {    {
380      ECHO "Compiler is GCC with Mingw" ;      ECHO "Compiler is GCC with Mingw" ;
381    
382      AR              ?= ar -ru ;      AR              ?= ar -ru ;
383      CC              ?= gcc ;      CC              ?= gcc ;
384      CCFLAGS         ?= "" ;      CCFLAGS         ?= "" ;
385      C++             ?= $(CC) ;      C++             ?= $(CC) ;
386      C++FLAGS        ?= $(CCFLAGS) ;      C++FLAGS        ?= $(CCFLAGS) ;
387      FORTRAN         ?= g77 ;      FORTRAN         ?= g77 ;
388      LINK            ?= $(CC) ;      LINK            ?= $(CC) ;
389      LINKFLAGS       ?= "" ;      LINKFLAGS       ?= "" ;
390      LINKLIBS        ?= "" ;      LINKLIBS        ?= "" ;
391      OPTIM           ?= ;      OPTIM           ?= ;
392      SUFOBJ           = .o ;      SUFOBJ           = .o ;
393      SUFLIB           = .a ;      SUFLIB           = .a ;
394  #   NOARSCAN        ?= true ;  #   NOARSCAN        ?= true ;
395    }    }
396    else if $(TOOLSET) = LCC    else if $(TOOLSET) = LCC
397    {    {
398      ECHO "Compiler is Win32-LCC" ;      ECHO "Compiler is Win32-LCC" ;
399    
400      AR              ?= lcclib ;      AR              ?= lcclib ;
401      CC              ?= lcc ;      CC              ?= lcc ;
402      CCFLAGS         ?= "" ;      CCFLAGS         ?= "" ;
403      C++             ?= $(CC) ;      C++             ?= $(CC) ;
404      C++FLAGS        ?= $(CCFLAGS) ;      C++FLAGS        ?= $(CCFLAGS) ;
405      LINK            ?= lcclnk ;      LINK            ?= lcclnk ;
406      LINKFLAGS       ?= "" ;      LINKFLAGS       ?= "" ;
407      LINKLIBS        ?= "" ;      LINKLIBS        ?= "" ;
408      OPTIM           ?= ;      OPTIM           ?= ;
409      NOARSCAN         = true ;      NOARSCAN         = true ;
410    }    }
411    else    else
412    {    {
413      EXIT On NT, did not recognize compiler type. ;      EXIT On NT, did not recognize compiler type. ;
414    }    }
415  }  }
416    
417  else if $(OS2)  else if $(OS2)
418  {  {
419      # the list of supported toolsets on Windows NT and Windows 95/98      # the list of supported toolsets on Windows NT and Windows 95/98
420      #      #
421      local SUPPORTED_TOOLSETS = "EMX" "WATCOM" ;      local SUPPORTED_TOOLSETS = "EMX" "WATCOM" ;
422    
423      # this variable holds the current toolset      # this variable holds the current toolset
424      #      #
425      TOOLSET = "" ;      TOOLSET = "" ;
426    
427      # if the JAM_TOOLSET environment variable is defined, check that it is      # if the JAM_TOOLSET environment variable is defined, check that it is
428      # one of our supported values      # one of our supported values
429      #      #
430      if $(JAM_TOOLSET)      if $(JAM_TOOLSET)
431      {      {
432        local t ;        local t ;
433    
434        for t in $(SUPPORTED_TOOLSETS)        for t in $(SUPPORTED_TOOLSETS)
435        {        {
436          if $(t) = $(JAM_TOOLSET) { TOOLSET = $(t) ; }          if $(t) = $(JAM_TOOLSET) { TOOLSET = $(t) ; }
437        }        }
438    
439        if ! $(TOOLSET)        if ! $(TOOLSET)
440        {        {
441          ECHO  "The JAM_TOOLSET environment variable is defined but its value" ;          ECHO  "The JAM_TOOLSET environment variable is defined but its value" ;
442          ECHO  "is invalid, please use one of the following:" ;          ECHO  "is invalid, please use one of the following:" ;
443          ECHO  ;          ECHO  ;
444    
445          for t in $(SUPPORTED_TOOLSETS) { ECHO "  " $(t) ; }          for t in $(SUPPORTED_TOOLSETS) { ECHO "  " $(t) ; }
446          EXIT ;          EXIT ;
447        }        }
448      }      }
449    
450      # if TOOLSET is empty, we'll try to detect the toolset from other      # if TOOLSET is empty, we'll try to detect the toolset from other
451      # environment variables to remain backwards compatible with Jam 2.3      # environment variables to remain backwards compatible with Jam 2.3
452      #      #
453      if ! $(TOOLSET)      if ! $(TOOLSET)
454      {      {
455        if $(watcom)        if $(watcom)
456        {        {
457          WATCOM   = $(watcom) ;          WATCOM   = $(watcom) ;
458          TOOLSET  = WATCOM ;          TOOLSET  = WATCOM ;
459        }        }
460        else        else
461        {        {
462          ECHO  "Jam cannot be run because you didn't indicate which compilation toolset" ;          ECHO  "Jam cannot be run because you didn't indicate which compilation toolset" ;
463          ECHO  "to use. To do so, follow these simple instructions:" ;          ECHO  "to use. To do so, follow these simple instructions:" ;
464          ECHO  ;          ECHO  ;
465          ECHO  "  - define one of the following environment variable, with the" ;          ECHO  "  - define one of the following environment variable, with the" ;
466          ECHO  "    appropriate value according to this list:" ;          ECHO  "    appropriate value according to this list:" ;
467          ECHO  ;          ECHO  ;
468          ECHO  "   Variable    Toolset                      Description" ;          ECHO  "   Variable    Toolset                      Description" ;
469          ECHO  ;          ECHO  ;
470          ECHO  "   WATCOM      Watcom C/C++                 Watcom install path" ;          ECHO  "   WATCOM      Watcom C/C++                 Watcom install path" ;
471          ECHO  "   EMX         EMX (gcc)                    EMX install path" ;          ECHO  "   EMX         EMX (gcc)                    EMX install path" ;
472          ECHO  "   VISUALAGE   IBM Visual Age C/C++         VisualAge install path" ;          ECHO  "   VISUALAGE   IBM Visual Age C/C++         VisualAge install path" ;
473          ECHO  ;          ECHO  ;
474          ECHO  "  - define the JAM_TOOLSET environment variable with the *name*" ;          ECHO  "  - define the JAM_TOOLSET environment variable with the *name*" ;
475          ECHO  "    of the toolset variable you want to use." ;          ECHO  "    of the toolset variable you want to use." ;
476          ECHO  ;          ECHO  ;
477          ECHO  "  e.g.:  set WATCOM=C:\WATCOM" ;          ECHO  "  e.g.:  set WATCOM=C:\WATCOM" ;
478          ECHO  "         set JAM_TOOLSET=WATCOM" ;          ECHO  "         set JAM_TOOLSET=WATCOM" ;
479          ECHO  ;          ECHO  ;
480          EXIT  ;          EXIT  ;
481        }        }
482      }      }
483    
484      RM       = del /f ;      RM       = del /f ;
485      CP       = copy ;      CP       = copy ;
486      MV      ?= move ;      MV      ?= move ;
487      DOT     ?= . ;      DOT     ?= . ;
488      DOTDOT  ?= .. ;      DOTDOT  ?= .. ;
489      SUFLIB  ?= .lib ;      SUFLIB  ?= .lib ;
490      SUFOBJ  ?= .obj ;      SUFOBJ  ?= .obj ;
491      SUFEXE  ?= .exe ;      SUFEXE  ?= .exe ;
492        
493      if $(TOOLSET) = WATCOM      if $(TOOLSET) = WATCOM
494      {      {
495         AR           ?= wlib ;         AR           ?= wlib ;
496         BINDIR       ?= \\os2\\apps ;         BINDIR       ?= \\os2\\apps ;
497         CC           ?= wcc386 ;         CC           ?= wcc386 ;
498         CCFLAGS      ?= /zq /DOS2 /I$(WATCOM)\\h ; # zq=quiet         CCFLAGS      ?= /zq /DOS2 /I$(WATCOM)\\h ; # zq=quiet
499         C++          ?= wpp386 ;         C++          ?= wpp386 ;
500         C++FLAGS     ?= $(CCFLAGS) ;         C++FLAGS     ?= $(CCFLAGS) ;
501         LINK         ?= wcl386 ;         LINK         ?= wcl386 ;
502         LINKFLAGS    ?= /zq ; # zq=quiet         LINKFLAGS    ?= /zq ; # zq=quiet
503         LINKLIBS     ?= ;         LINKLIBS     ?= ;
504         NOARSCAN     ?= true ;         NOARSCAN     ?= true ;
505         OPTIM        ?= ;         OPTIM        ?= ;
506         SLASH        ?= \\ ;         SLASH        ?= \\ ;
507         STDHDRS      ?= $(WATCOM)\\h ;         STDHDRS      ?= $(WATCOM)\\h ;
508         UNDEFFLAG    ?= "/u _" ;         UNDEFFLAG    ?= "/u _" ;
509      }      }
510      else if $(TOOLSET) = EMX      else if $(TOOLSET) = EMX
511      {      {
512        ECHO "Compiler is GCC-EMX" ;        ECHO "Compiler is GCC-EMX" ;
513        AR            ?= ar -ru ;        AR            ?= ar -ru ;
514        CC            ?= gcc ;        CC            ?= gcc ;
515        CCFLAGS       ?= "" ;        CCFLAGS       ?= "" ;
516        C++           ?= $(CC) ;        C++           ?= $(CC) ;
517        C++FLAGS      ?= $(CCFLAGS) ;        C++FLAGS      ?= $(CCFLAGS) ;
518        LINK          ?= $(CC) ;        LINK          ?= $(CC) ;
519        LINKFLAGS     ?= "" ;        LINKFLAGS     ?= "" ;
520        LINKLIBS      ?= "" ;        LINKLIBS      ?= "" ;
521        OPTIM         ?= ;        OPTIM         ?= ;
522        SUFOBJ         = .o ;        SUFOBJ         = .o ;
523        SUFLIB         = .a ;        SUFLIB         = .a ;
524        UNDEFFLAG     ?= "-U" ;        UNDEFFLAG     ?= "-U" ;
525        SLASH          = / ;        SLASH          = / ;
526  #     NOARSCAN      ?= true ;  #     NOARSCAN      ?= true ;
527      }      }
528      else      else
529      {      {
530        # should never happen        # should never happen
531        EXIT  "Sorry, but the $(JAM_TOOLSET) toolset isn't supported for now" ;        EXIT  "Sorry, but the $(JAM_TOOLSET) toolset isn't supported for now" ;
532      }      }
533  }  }
534  else if $(VMS)  else if $(VMS)
535  {  {
536      C++         ?= cxx ;      C++         ?= cxx ;
537      C++FLAGS    ?= ;      C++FLAGS    ?= ;
538      CC          ?= cc ;      CC          ?= cc ;
539      CCFLAGS     ?= ;      CCFLAGS     ?= ;
540      CHMOD       ?= set file/prot= ;      CHMOD       ?= set file/prot= ;
541      CP          ?= copy/replace ;      CP          ?= copy/replace ;
542      CRELIB      ?= true ;      CRELIB      ?= true ;
543      DOT         ?= [] ;      DOT         ?= [] ;
544      DOTDOT      ?= [-] ;      DOTDOT      ?= [-] ;
545      EXEMODE     ?= (w:e) ;      EXEMODE     ?= (w:e) ;
546      FILEMODE    ?= (w:r) ;      FILEMODE    ?= (w:r) ;
547      HDRS        ?= ;      HDRS        ?= ;
548      LINK        ?= link ;      LINK        ?= link ;
549      LINKFLAGS   ?= "" ;      LINKFLAGS   ?= "" ;
550      LINKLIBS    ?= ;      LINKLIBS    ?= ;
551      MKDIR       ?= create/dir ;      MKDIR       ?= create/dir ;
552      MV          ?= rename ;      MV          ?= rename ;
553      OPTIM       ?= "" ;      OPTIM       ?= "" ;
554      RM          ?= delete ;      RM          ?= delete ;
555      RUNVMS      ?= mcr ;      RUNVMS      ?= mcr ;
556      SHELLMODE   ?= (w:er) ;      SHELLMODE   ?= (w:er) ;
557      SLASH       ?= . ;      SLASH       ?= . ;
558      STDHDRS     ?= decc$library_include ;      STDHDRS     ?= decc$library_include ;
559      SUFEXE      ?= .exe ;      SUFEXE      ?= .exe ;
560      SUFLIB      ?= .olb ;      SUFLIB      ?= .olb ;
561      SUFOBJ      ?= .obj ;      SUFOBJ      ?= .obj ;
562    
563      switch $(OS)      switch $(OS)
564      {      {
565      case OPENVMS : CCFLAGS  ?= /stand=vaxc ;      case OPENVMS : CCFLAGS  ?= /stand=vaxc ;
566      case VMS     : LINKLIBS ?= sys$library:vaxcrtl.olb/lib ;      case VMS     : LINKLIBS ?= sys$library:vaxcrtl.olb/lib ;
567      }      }
568  }  }
569  else if $(MAC)  else if $(MAC)
570  {  {
571      local OPT ;      local OPT ;
572            
573      CW  ?= "{CW}" ;      CW  ?= "{CW}" ;
574    
575      MACHDRS ?=      MACHDRS ?=
576          "$(UMACHDRS):Universal:Interfaces:CIncludes"          "$(UMACHDRS):Universal:Interfaces:CIncludes"
577          "$(CW):MSL:MSL_C:MSL_Common:Include"          "$(CW):MSL:MSL_C:MSL_Common:Include"
578          "$(CW):MSL:MSL_C:MSL_MacOS:Include" ;          "$(CW):MSL:MSL_C:MSL_MacOS:Include" ;
579    
580      MACLIBS ?=      MACLIBS ?=
581          "$(CW):MacOS Support:Universal:Libraries:StubLibraries:Interfacelib"          "$(CW):MacOS Support:Universal:Libraries:StubLibraries:Interfacelib"
582          "$(CW):MacOS Support:Universal:Libraries:StubLibraries:Mathlib" ;          "$(CW):MacOS Support:Universal:Libraries:StubLibraries:Mathlib" ;
583    
584      MPWLIBS ?=      MPWLIBS ?=
585          "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"          "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
586          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW.Lib" ;          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW.Lib" ;
587    
588      MPWNLLIBS ?=      MPWNLLIBS ?=
589          "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"          "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
590          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW(NL).Lib" ;          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW(NL).Lib" ;
591                    
592      SIOUXHDRS ?= ;      SIOUXHDRS ?= ;
593            
594      SIOUXLIBS ?=      SIOUXLIBS ?=
595          "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.lib"          "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.lib"
596          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib"          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib"
597          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC.Lib" ;          "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC.Lib" ;
598    
599      C++         ?= mwcppc ;      C++         ?= mwcppc ;
600      C++FLAGS    ?= -w off -nomapcr ;      C++FLAGS    ?= -w off -nomapcr ;
601      CC          ?= mwcppc ;      CC          ?= mwcppc ;
602      CCFLAGS     ?= -w off -nomapcr ;      CCFLAGS     ?= -w off -nomapcr ;
603      CP          ?= duplicate -y ;      CP          ?= duplicate -y ;
604      DOT         ?= ":" ;      DOT         ?= ":" ;
605      DOTDOT      ?= "::" ;      DOTDOT      ?= "::" ;
606      HDRS        ?= $(MACHDRS) $(MPWHDRS) ;      HDRS        ?= $(MACHDRS) $(MPWHDRS) ;
607      LINK        ?= mwlinkppc ;      LINK        ?= mwlinkppc ;
608      LINKFLAGS   ?= -mpwtool -warn ;                  LINKFLAGS   ?= -mpwtool -warn ;            
609      LINKLIBS    ?= $(MACLIBS) $(MPWLIBS) ;      LINKLIBS    ?= $(MACLIBS) $(MPWLIBS) ;
610      MKDIR       ?= newfolder ;      MKDIR       ?= newfolder ;
611      MV          ?= rename -y ;      MV          ?= rename -y ;
612      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
613      OPTIM       ?= ;      OPTIM       ?= ;
614      RM          ?= delete -y ;      RM          ?= delete -y ;
615      SLASH       ?= ":" ;      SLASH       ?= ":" ;
616      STDHDRS     ?= ;      STDHDRS     ?= ;
617      SUFLIB      ?= .lib ;      SUFLIB      ?= .lib ;
618      SUFOBJ      ?= .o ;      SUFOBJ      ?= .o ;
619  }  }
620  else if $(OS) = BEOS && $(METROWERKS)  else if $(OS) = BEOS && $(METROWERKS)
621  {  {
622      AR          ?= mwld -xml -o ;      AR          ?= mwld -xml -o ;
623      BINDIR      ?= /boot/apps ;      BINDIR      ?= /boot/apps ;
624      CC          ?= mwcc ;      CC          ?= mwcc ;
625      CCFLAGS     ?= -nosyspath ;      CCFLAGS     ?= -nosyspath ;
626      C++         ?= $(CC) ;      C++         ?= $(CC) ;
627      C++FLAGS    ?= -nosyspath ;      C++FLAGS    ?= -nosyspath ;
628      FORTRAN     ?= "" ;      FORTRAN     ?= "" ;
629      LIBDIR      ?= /boot/develop/libraries ;      LIBDIR      ?= /boot/develop/libraries ;
630      LINK        ?= mwld ;      LINK        ?= mwld ;
631      LINKFLAGS   ?= "" ;      LINKFLAGS   ?= "" ;
632      MANDIR      ?= /boot/documentation/"Shell Tools"/HTML ;      MANDIR      ?= /boot/documentation/"Shell Tools"/HTML ;
633      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
634      STDHDRS     ?= /boot/develop/headers/posix ;      STDHDRS     ?= /boot/develop/headers/posix ;
635  }  }
636  else if $(OS) = BEOS  else if $(OS) = BEOS
637  {  {
638      BINDIR      ?= /boot/apps ;      BINDIR      ?= /boot/apps ;
639      CC          ?= gcc ;      CC          ?= gcc ;
640      C++         ?= $(CC) ;      C++         ?= $(CC) ;
641      FORTRAN     ?= "" ;      FORTRAN     ?= "" ;
642      LIBDIR      ?= /boot/develop/libraries ;      LIBDIR      ?= /boot/develop/libraries ;
643      LINK        ?= gcc ;      LINK        ?= gcc ;
644      LINKLIBS    ?= -lnet ;      LINKLIBS    ?= -lnet ;
645      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
646      STDHDRS     ?= /boot/develop/headers/posix ;      STDHDRS     ?= /boot/develop/headers/posix ;
647  }  }
648  else if $(UNIX)  else if $(UNIX)
649  {  {
650      switch $(OS)      switch $(OS)
651      {      {
652      case AIX :      case AIX :
653      LINKLIBS    ?= -lbsd ;      LINKLIBS    ?= -lbsd ;
654    
655      case AMIGA :      case AMIGA :
656      CC          ?= gcc ;      CC          ?= gcc ;
657      YACC        ?= bison ;      YACC        ?= bison ;
658    
659      case CYGWIN :        case CYGWIN :  
660      CC          ?= gcc ;      CC          ?= gcc ;
661      CCFLAGS     += -D__cygwin__ ;      CCFLAGS     += -D__cygwin__ ;
662      LEX         ?= flex ;      LEX         ?= flex ;
663      JAMSHELL    ?= sh -c ;      JAMSHELL    ?= sh -c ;
664      RANLIB      ?= "" ;      RANLIB      ?= "" ;
665      SUFEXE      ?= .exe ;      SUFEXE      ?= .exe ;
666      YACC        ?= bison ;      YACC        ?= bison ;
667    
668      case DGUX :      case DGUX :
669      RANLIB      ?= "" ;      RANLIB      ?= "" ;
670      RELOCATE    ?= true ;      RELOCATE    ?= true ;
671    
672      case HPUX :      case HPUX :
673      RANLIB      ?= "" ;      RANLIB      ?= "" ;
674    
675      case INTERIX :      case INTERIX :
676      CC          ?= gcc ;      CC          ?= gcc ;
677      JAMSHELL    ?= sh -c ;      JAMSHELL    ?= sh -c ;
678      RANLIB      ?= "" ;      RANLIB      ?= "" ;
679    
680      case IRIX :      case IRIX :
681      RANLIB      ?= "" ;      RANLIB      ?= "" ;
682    
683      case MPEIX :      case MPEIX :
684      CC          ?= gcc ;      CC          ?= gcc ;
685      C++         ?= gcc ;      C++         ?= gcc ;
686      CCFLAGS     += -D_POSIX_SOURCE ;      CCFLAGS     += -D_POSIX_SOURCE ;
687      HDRS        += /usr/include ;      HDRS        += /usr/include ;
688      RANLIB      ?= "" ;      RANLIB      ?= "" ;
689      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
690      NOARUPDATE  ?= true ;      NOARUPDATE  ?= true ;
691    
692      case MVS :      case MVS :
693      RANLIB      ?= "" ;      RANLIB      ?= "" ;
694    
695      case NEXT :      case NEXT :
696      AR          ?= libtool -o ;      AR          ?= libtool -o ;
697      RANLIB      ?= "" ;      RANLIB      ?= "" ;
698    
699      case MACOSX :      case MACOSX :
700      AR          ?= libtool -o ;      AR          ?= libtool -o ;
701      C++         ?= c++ ;      C++         ?= c++ ;
702      MANDIR      ?= /usr/local/share/man ;      MANDIR      ?= /usr/local/share/man ;
703      RANLIB      ?= "" ;      RANLIB      ?= "" ;
704    
705      case NCR :      case NCR :
706      RANLIB      ?= "" ;      RANLIB      ?= "" ;
707    
708      case PTX :      case PTX :
709      RANLIB      ?= "" ;      RANLIB      ?= "" ;
710    
711      case QNX :      case QNX :
712      AR          ?= wlib ;      AR          ?= wlib ;
713      CC          ?= cc ;      CC          ?= cc ;
714      CCFLAGS     ?= -Q ; # quiet      CCFLAGS     ?= -Q ; # quiet
715      C++         ?= $(CC) ;      C++         ?= $(CC) ;
716      C++FLAGS    ?= -Q ; # quiet      C++FLAGS    ?= -Q ; # quiet
717      LINK        ?= $(CC) ;      LINK        ?= $(CC) ;
718      LINKFLAGS   ?= -Q ; # quiet      LINKFLAGS   ?= -Q ; # quiet
719      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
720      RANLIB      ?= "" ;      RANLIB      ?= "" ;
721    
722      case SCO :      case SCO :
723      RANLIB      ?= "" ;      RANLIB      ?= "" ;
724      RELOCATE    ?= true ;      RELOCATE    ?= true ;
725    
726      case SINIX :      case SINIX :
727      RANLIB      ?= "" ;      RANLIB      ?= "" ;
728    
729      case SOLARIS :      case SOLARIS :
730      RANLIB      ?= "" ;      RANLIB      ?= "" ;
731      AR          ?= "/usr/ccs/bin/ar ru" ;      AR          ?= "/usr/ccs/bin/ar ru" ;
732    
733      case UNICOS :      case UNICOS :
734      NOARSCAN    ?= true ;      NOARSCAN    ?= true ;
735      OPTIM       ?= -O0 ;      OPTIM       ?= -O0 ;
736    
737      case UNIXWARE :      case UNIXWARE :
738      RANLIB      ?= "" ;      RANLIB      ?= "" ;
739      RELOCATE    ?= true ;      RELOCATE    ?= true ;
740      }      }
741    
742      # UNIX defaults      # UNIX defaults
743    
744      CCFLAGS     ?= ;      CCFLAGS     ?= ;
745      C++FLAGS    ?= $(CCFLAGS) ;      C++FLAGS    ?= $(CCFLAGS) ;
746      CHMOD       ?= chmod ;      CHMOD       ?= chmod ;
747      LEX         ?= lex ;      LEX         ?= lex ;
748      LINKFLAGS   ?= $(CCFLAGS) ;      LINKFLAGS   ?= $(CCFLAGS) ;
749      LINKLIBS    ?= ;      LINKLIBS    ?= ;
750      OPTIM       ?= -O ;      OPTIM       ?= -O ;
751      RANLIB      ?= ranlib ;      RANLIB      ?= ranlib ;
752      YACC        ?= yacc ;      YACC        ?= yacc ;
753      YACCFILES   ?= y.tab ;      YACCFILES   ?= y.tab ;
754      YACCFLAGS   ?= -d ;      YACCFLAGS   ?= -d ;
755  }  }
756    
757  #  #
758  # General defaults; a lot like UNIX  # General defaults; a lot like UNIX
759  #  #
760    
761      AR          ?= ar ru ;      AR          ?= ar ru ;
762      AS          ?= as ;      AS          ?= as ;
763      ASFLAGS     ?= ;      ASFLAGS     ?= ;
764      AWK         ?= awk ;      AWK         ?= awk ;
765      BINDIR      ?= /usr/local/bin ;      BINDIR      ?= /usr/local/bin ;
766      C++         ?= gcc ;      C++         ?= gcc ;
767      C++FLAGS    ?= ;      C++FLAGS    ?= ;
768      CC          ?= gcc ;      CC          ?= gcc ;
769      CCFLAGS     ?= ;      CCFLAGS     ?= ;
770      CP          ?= cp -f ;      CP          ?= cp -f ;
771      CRELIB      ?= ;      CRELIB      ?= ;
772      DOT         ?= . ;      DOT         ?= . ;
773      DOTDOT      ?= .. ;      DOTDOT      ?= .. ;
774      EXEMODE     ?= 711 ;      EXEMODE     ?= 711 ;
775      FILEMODE    ?= 644 ;      FILEMODE    ?= 644 ;
776      FORTRAN     ?= g77 ;      FORTRAN     ?= g77 ;
777      FORTRANFLAGS ?= ;      FORTRANFLAGS ?= ;
778      HDRS        ?= ;      HDRS        ?= ;
779      JAMFILE     ?= Jamfile ;      JAMFILE     ?= Jamfile ;
780      JAMRULES    ?= Jamrules ;      JAMRULES    ?= Jamrules ;
781      LEX         ?= lex ;      LEX         ?= lex ;
782      LIBDIR      ?= /usr/local/lib ;      LIBDIR      ?= /usr/local/lib ;
783      LINK        ?= $(CC) ;      LINK        ?= $(CC) ;
784      LINKFLAGS   ?= ;      LINKFLAGS   ?= ;
785      LINKLIBS    ?= ;      LINKLIBS    ?= ;
786      LN          ?= ln ;      LN          ?= ln ;
787      MANDIR      ?= /usr/local/man ;      MANDIR      ?= /usr/local/man ;
788      MKDIR       ?= mkdir ;      MKDIR       ?= mkdir ;
789      MV          ?= mv -f ;      MV          ?= mv -f ;
790      OPTIM       ?= ;      OPTIM       ?= ;
791      RCP         ?= rcp ;      RCP         ?= rcp ;
792      RM          ?= rm -f ;      RM          ?= rm -f ;
793      RSH         ?= rsh ;      RSH         ?= rsh ;
794      SED         ?= sed ;      SED         ?= sed ;
795      SHELLHEADER ?= "#!/bin/sh" ;      SHELLHEADER ?= "#!/bin/sh" ;
796      SHELLMODE   ?= 755 ;      SHELLMODE   ?= 755 ;
797      SLASH       ?= / ;      SLASH       ?= / ;
798      STDHDRS     ?= /usr/include ;      STDHDRS     ?= /usr/include ;
799      SUFEXE      ?= "" ;      SUFEXE      ?= "" ;
800      SUFLIB      ?= .a ;      SUFLIB      ?= .a ;
801      SUFOBJ      ?= .o ;      SUFOBJ      ?= .o ;
802      UNDEFFLAG   ?= "-u _" ;      UNDEFFLAG   ?= "-u _" ;
803      YACC        ?= ;      YACC        ?= ;
804      YACCFILES   ?= ;      YACCFILES   ?= ;
805      YACCFLAGS   ?= ;      YACCFLAGS   ?= ;
806    
807      HDRPATTERN =              HDRPATTERN =        
808              "^[     ]*#[    ]*include[  ]*[<\"]([^\">]*)[\">].*$" ;              "^[     ]*#[    ]*include[  ]*[<\"]([^\">]*)[\">].*$" ;
809    
810      OSFULL = $(OS)$(OSVER)$(OSPLAT) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ;      OSFULL = $(OS)$(OSVER)$(OSPLAT) $(OS)$(OSPLAT) $(OS)$(OSVER) $(OS) ;
811    
812    
813  #  #
814  # Base dependencies - first for "bootstrap" kinds of rules  # Base dependencies - first for "bootstrap" kinds of rules
815  #  #
816    
817  DEPENDS all : shell files lib exe obj ;  DEPENDS all : shell files lib exe obj ;
818  DEPENDS all shell files lib exe obj : first ;  DEPENDS all shell files lib exe obj : first ;
819  NOTFILE all first shell files lib exe obj dirs clean uninstall ;  NOTFILE all first shell files lib exe obj dirs clean uninstall ;
820  ALWAYS clean uninstall ;  ALWAYS clean uninstall ;
821    
822  #  #
823  # Rules  # Rules
824  #  #
825    
826  rule As  rule As
827  {  {
828      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
829      ASFLAGS on $(<) += $(ASFLAGS) $(SUBDIRASFLAGS) ;      ASFLAGS on $(<) += $(ASFLAGS) $(SUBDIRASFLAGS) ;
830  }  }
831    
832  rule Bulk  rule Bulk
833  {  {
834      local i ;      local i ;
835    
836      for i in $(>)      for i in $(>)
837      {      {
838          File $(i:D=$(<)) : $(i) ;          File $(i:D=$(<)) : $(i) ;
839      }      }
840  }  }
841    
842  rule Cc  rule Cc
843  {  {
844      local _h ;      local _h ;
845    
846      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
847    
848      # Just to clarify here: this sets the per-target CCFLAGS to      # Just to clarify here: this sets the per-target CCFLAGS to
849      # be the current value of (global) CCFLAGS and SUBDIRCCFLAGS.      # be the current value of (global) CCFLAGS and SUBDIRCCFLAGS.
850    
851      CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;      CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) ;
852    
853      # If the compiler's -o flag doesn't work, relocate the .o      # If the compiler's -o flag doesn't work, relocate the .o
854    
855      if $(RELOCATE)      if $(RELOCATE)
856      {      {
857          CcMv $(<) : $(>) ;          CcMv $(<) : $(>) ;
858      }      }
859    
860      _h = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;      _h = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;
861    
862      if $(VMS) && $(_h)      if $(VMS) && $(_h)
863      {      {
864          SLASHINC on $(<) = "/inc=(" $(_h[1]) ,$(_h[2-]) ")" ;          SLASHINC on $(<) = "/inc=(" $(_h[1]) ,$(_h[2-]) ")" ;
865      }      }
866      else if $(MAC) && $(_h)      else if $(MAC) && $(_h)
867      {      {
868          local _i _j ;          local _i _j ;
869          _j = $(_h[1]) ;          _j = $(_h[1]) ;
870          for _i in $(_h[2-])          for _i in $(_h[2-])
871          {          {
872              _j = $(_j),$(_i) ;              _j = $(_j),$(_i) ;
873          }          }
874          MACINC on $(<) = \"$(_j)\" ;          MACINC on $(<) = \"$(_j)\" ;
875      }      }
876  }  }
877    
878  rule C++  rule C++
879  {  {
880      local _h ;      local _h ;
881    
882      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
883      C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) ;      C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) ;
884    
885      if $(RELOCATE)      if $(RELOCATE)
886      {      {
887          CcMv $(<) : $(>) ;          CcMv $(<) : $(>) ;
888      }      }
889    
890      _h = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;      _h = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;
891    
892      if $(VMS) && $(_h)      if $(VMS) && $(_h)
893      {      {
894          SLASHINC on $(<) = "/inc=(" $(_h[1]) ,$(_h[2-]) ")" ;          SLASHINC on $(<) = "/inc=(" $(_h[1]) ,$(_h[2-]) ")" ;
895      }      }
896      else if $(MAC) && $(_h)      else if $(MAC) && $(_h)
897      {      {
898          local _i _j ;          local _i _j ;
899          _j = $(_h[1]) ;          _j = $(_h[1]) ;
900          for _i in $(_h[2-])          for _i in $(_h[2-])
901          {          {
902              _j = $(_j),$(_i) ;              _j = $(_j),$(_i) ;
903          }          }
904          MACINC on $(<) = \"$(_j)\" ;          MACINC on $(<) = \"$(_j)\" ;
905      }      }
906  }  }
907    
908  rule Chmod  rule Chmod
909  {  {
910      if $(CHMOD) { Chmod1 $(<) ; }      if $(CHMOD) { Chmod1 $(<) ; }
911  }  }
912    
913  rule File  rule File
914  {  {
915      DEPENDS files : $(<) ;      DEPENDS files : $(<) ;
916      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
917      SEARCH on $(>) = $(SEARCH_SOURCE) ;      SEARCH on $(>) = $(SEARCH_SOURCE) ;
918      MODE on $(<) = $(FILEMODE) ;      MODE on $(<) = $(FILEMODE) ;
919      Chmod $(<) ;      Chmod $(<) ;
920  }  }
921    
922  rule Fortran  rule Fortran
923  {  {
924      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
925  }  }
926    
927  rule GenFile  rule GenFile
928  {  {
929      local _t = [ FGristSourceFiles $(<) ] ;      local _t = [ FGristSourceFiles $(<) ] ;
930      local _s = [ FAppendSuffix $(>[1]) : $(SUFEXE) ] ;      local _s = [ FAppendSuffix $(>[1]) : $(SUFEXE) ] ;
931      Depends $(_t) : $(_s) $(>[2-]) ;      Depends $(_t) : $(_s) $(>[2-]) ;
932      GenFile1 $(_t) : $(_s) $(>[2-]) ;      GenFile1 $(_t) : $(_s) $(>[2-]) ;
933      Clean clean : $(_t) ;      Clean clean : $(_t) ;
934  }  }
935    
936  rule GenFile1  rule GenFile1
937  {  {
938      MakeLocate $(<) : $(LOCATE_SOURCE) ;      MakeLocate $(<) : $(LOCATE_SOURCE) ;
939      SEARCH on $(>) = $(SEARCH_SOURCE) ;      SEARCH on $(>) = $(SEARCH_SOURCE) ;
940  }  }
941    
942  rule HardLink  rule HardLink
943  {  {
944      DEPENDS files : $(<) ;      DEPENDS files : $(<) ;
945      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
946      SEARCH on $(>) = $(SEARCH_SOURCE) ;      SEARCH on $(>) = $(SEARCH_SOURCE) ;
947  }  }
948    
949  rule HdrMacroFile  rule HdrMacroFile
950  {  {
951    # HdrMacroFile file ;    # HdrMacroFile file ;
952    #    #
953    # this rule is used to indicate that a given file contains definitions    # this rule is used to indicate that a given file contains definitions
954    # for filename macros (e.g. "#define  MYFILE_H <myfile.h>") that can    # for filename macros (e.g. "#define  MYFILE_H <myfile.h>") that can
955    # later be used in #include statements in the rest of the source    # later be used in #include statements in the rest of the source
956    #    #
957    # theses files must be parsed before any make is tried..    # theses files must be parsed before any make is tried..
958    #    #
959    HDRMACRO $(<) ;    HDRMACRO $(<) ;
960  }  }
961    
962  rule HdrRule  rule HdrRule
963  {  {
964      # HdrRule source : headers ;      # HdrRule source : headers ;
965    
966      # N.B.  This rule is called during binding, potentially after      # N.B.  This rule is called during binding, potentially after
967      # the fate of many targets has been determined, and must be      # the fate of many targets has been determined, and must be
968      # used with caution: don't add dependencies to unrelated      # used with caution: don't add dependencies to unrelated
969      # targets, and don't set variables on $(<).      # targets, and don't set variables on $(<).
970    
971      # Tell Jam that anything depending on $(<) also depends on $(>),      # Tell Jam that anything depending on $(<) also depends on $(>),
972      # set SEARCH so Jam can find the headers, but then say we don't      # set SEARCH so Jam can find the headers, but then say we don't
973      # care if we can't actually find the headers (they may have been      # care if we can't actually find the headers (they may have been
974      # within ifdefs),      # within ifdefs),
975    
976      local s ;      local s ;
977    
978      if $(HDRGRIST)      if $(HDRGRIST)
979      {      {
980          s = $(>:G=$(HDRGRIST)) ;          s = $(>:G=$(HDRGRIST)) ;
981      } else {      } else {
982          s = $(>) ;          s = $(>) ;
983      }      }
984    
985      INCLUDES $(<) : $(s) ;      INCLUDES $(<) : $(s) ;
986      SEARCH on $(s) = $(HDRSEARCH) ;      SEARCH on $(s) = $(HDRSEARCH) ;
987      NOCARE $(s) ;      NOCARE $(s) ;
988    
989      # Propagate on $(<) to $(>)      # Propagate on $(<) to $(>)
990    
991      HDRSEARCH on $(s) = $(HDRSEARCH) ;      HDRSEARCH on $(s) = $(HDRSEARCH) ;
992      HDRSCAN on $(s) = $(HDRSCAN) ;      HDRSCAN on $(s) = $(HDRSCAN) ;
993      HDRRULE on $(s) = $(HDRRULE) ;      HDRRULE on $(s) = $(HDRRULE) ;
994      HDRGRIST on $(s) = $(HDRGRIST) ;      HDRGRIST on $(s) = $(HDRGRIST) ;
995  }  }
996    
997  rule InstallInto  rule InstallInto
998  {  {
999      local i t ;      local i t ;
1000    
1001      t = $(>:G=installed) ;      t = $(>:G=installed) ;
1002    
1003      DEPENDS install : $(t) ;      DEPENDS install : $(t) ;
1004      DEPENDS $(t) : $(>) ;      DEPENDS $(t) : $(>) ;
1005      SEARCH on $(>) = $(SEARCH_SOURCE) ;      SEARCH on $(>) = $(SEARCH_SOURCE) ;
1006      MakeLocate $(t) : $(<) ;      MakeLocate $(t) : $(<) ;
1007    
1008      # Arrange for jam uninstall      # Arrange for jam uninstall
1009    
1010      Clean uninstall : $(t) ;      Clean uninstall : $(t) ;
1011    
1012      for i in $(>)      for i in $(>)
1013      {      {
1014          Install $(i:G=installed) : $(i) ;          Install $(i:G=installed) : $(i) ;
1015      }      }
1016    
1017      Chmod $(t) ;      Chmod $(t) ;
1018    
1019      if $(UNIX)      if $(UNIX)
1020      {      {
1021          if $(OWNER) { Chown $(t) ; OWNER on $(t) = $(OWNER) ; }          if $(OWNER) { Chown $(t) ; OWNER on $(t) = $(OWNER) ; }
1022          if $(GROUP) { Chgrp $(t) ; GROUP on $(t) = $(GROUP) ; }          if $(GROUP) { Chgrp $(t) ; GROUP on $(t) = $(GROUP) ; }
1023      }      }
1024  }  }
1025    
1026  rule InstallBin  rule InstallBin
1027  {  {
1028      local _t = [ FAppendSuffix $(>) : $(SUFEXE) ] ;      local _t = [ FAppendSuffix $(>) : $(SUFEXE) ] ;
1029    
1030      InstallInto $(<) : $(_t) ;      InstallInto $(<) : $(_t) ;
1031      MODE on $(_t:G=installed) = $(EXEMODE) ;      MODE on $(_t:G=installed) = $(EXEMODE) ;
1032  }  }
1033    
1034  rule InstallFile  rule InstallFile
1035  {  {
1036      InstallInto $(<) : $(>) ;      InstallInto $(<) : $(>) ;
1037      MODE on $(>:G=installed) = $(FILEMODE) ;      MODE on $(>:G=installed) = $(FILEMODE) ;
1038  }  }
1039    
1040  rule InstallLib  rule InstallLib
1041  {  {
1042      InstallInto $(<) : $(>) ;      InstallInto $(<) : $(>) ;
1043      MODE on $(>:G=installed) = $(FILEMODE) ;      MODE on $(>:G=installed) = $(FILEMODE) ;
1044  }  }
1045    
1046  rule InstallMan  rule InstallMan
1047  {  {
1048      # Really this just strips the . from the suffix      # Really this just strips the . from the suffix
1049    
1050      local i s d ;      local i s d ;
1051    
1052      for i in $(>)      for i in $(>)
1053      {      {
1054          switch $(i:S)          switch $(i:S)
1055          {          {
1056          case .1 : s = 1 ; case .2 : s = 2 ; case .3 : s = 3 ;          case .1 : s = 1 ; case .2 : s = 2 ; case .3 : s = 3 ;
1057          case .4 : s = 4 ; case .5 : s = 5 ; case .6 : s = 6 ;          case .4 : s = 4 ; case .5 : s = 5 ; case .6 : s = 6 ;
1058          case .7 : s = 7 ; case .8 : s = 8 ; case .l : s = l ;          case .7 : s = 7 ; case .8 : s = 8 ; case .l : s = l ;
1059          case .n : s = n ; case .man : s = 1 ;          case .n : s = n ; case .man : s = 1 ;
1060          }          }
1061    
1062          d = man$(s) ;          d = man$(s) ;
1063    
1064          InstallInto $(d:R=$(<)) : $(i) ;          InstallInto $(d:R=$(<)) : $(i) ;
1065      }      }
1066    
1067      MODE on $(>:G=installed) = $(FILEMODE) ;      MODE on $(>:G=installed) = $(FILEMODE) ;
1068  }  }
1069    
1070  rule InstallShell  rule InstallShell
1071  {  {
1072      InstallInto $(<) : $(>) ;      InstallInto $(<) : $(>) ;
1073      MODE on $(>:G=installed) = $(SHELLMODE) ;      MODE on $(>:G=installed) = $(SHELLMODE) ;
1074  }  }
1075    
1076  rule Lex  rule Lex
1077  {  {
1078      LexMv $(<) : $(>) ;      LexMv $(<) : $(>) ;
1079      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
1080      MakeLocate $(<) : $(LOCATE_SOURCE) ;      MakeLocate $(<) : $(LOCATE_SOURCE) ;
1081      Clean clean : $(<) ;      Clean clean : $(<) ;
1082  }  }
1083    
1084  rule Library  rule Library
1085  {  {
1086      LibraryFromObjects $(<) : $(>:S=$(SUFOBJ)) ;      LibraryFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
1087      Objects $(>) ;      Objects $(>) ;
1088  }  }
1089    
1090  rule LibraryFromObjects  rule LibraryFromObjects
1091  {  {
1092      local _i _l _s ;      local _i _l _s ;
1093    
1094      # Add grist to file names      # Add grist to file names
1095    
1096      _s = [ FGristFiles $(>) ] ;      _s = [ FGristFiles $(>) ] ;
1097      _l = $(<:S=$(SUFLIB)) ;      _l = $(<:S=$(SUFLIB)) ;
1098    
1099      # library depends on its member objects      # library depends on its member objects
1100    
1101      if $(KEEPOBJS)      if $(KEEPOBJS)
1102      {      {
1103          DEPENDS obj : $(_s) ;          DEPENDS obj : $(_s) ;
1104      }      }
1105      else      else
1106      {      {
1107          DEPENDS lib : $(_l) ;          DEPENDS lib : $(_l) ;
1108      }      }
1109    
1110      # Set LOCATE for the library and its contents.  The bound      # Set LOCATE for the library and its contents.  The bound
1111      # value shows up as $(NEEDLIBS) on the Link actions.      # value shows up as $(NEEDLIBS) on the Link actions.
1112      # For compatibility, we only do this if the library doesn't      # For compatibility, we only do this if the library doesn't
1113      # already have a path.      # already have a path.
1114    
1115      if ! $(_l:D)      if ! $(_l:D)
1116      {      {
1117          MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;          MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;
1118      }      }
1119    
1120      if $(NOARSCAN)      if $(NOARSCAN)
1121      {      {
1122          # If we can't scan the library to timestamp its contents,          # If we can't scan the library to timestamp its contents,
1123          # we have to just make the library depend directly on the          # we have to just make the library depend directly on the
1124          # on-disk object files.          # on-disk object files.
1125    
1126          DEPENDS $(_l) : $(_s) ;          DEPENDS $(_l) : $(_s) ;
1127      }      }
1128      else      else
1129      {      {
1130          # If we can scan the library, we make the library depend          # If we can scan the library, we make the library depend
1131          # on its members and each member depend on the on-disk          # on its members and each member depend on the on-disk
1132          # object file.          # object file.
1133    
1134          DEPENDS $(_l) : $(_l)($(_s:BS)) ;          DEPENDS $(_l) : $(_l)($(_s:BS)) ;
1135    
1136          for _i in $(_s)          for _i in $(_s)
1137          {          {
1138          DEPENDS $(_l)($(_i:BS)) : $(_i) ;          DEPENDS $(_l)($(_i:BS)) : $(_i) ;
1139          }          }
1140      }      }
1141    
1142      Clean clean : $(_l) ;      Clean clean : $(_l) ;
1143    
1144      if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; }      if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; }
1145    
1146      Archive $(_l) : $(_s) ;      Archive $(_l) : $(_s) ;
1147    
1148      if $(RANLIB) { Ranlib $(_l) ; }      if $(RANLIB) { Ranlib $(_l) ; }
1149    
1150      # If we can't scan the library, we have to leave the .o's around.      # If we can't scan the library, we have to leave the .o's around.
1151    
1152      if ! ( $(NOARSCAN) || $(KEEPOBJS) ) { RmTemps $(_l) : $(_s) ; }      if ! ( $(NOARSCAN) || $(KEEPOBJS) ) { RmTemps $(_l) : $(_s) ; }
1153  }  }
1154    
1155  rule Link  rule Link
1156  {  {
1157      MODE on $(<) = $(EXEMODE) ;      MODE on $(<) = $(EXEMODE) ;
1158      Chmod $(<) ;      Chmod $(<) ;
1159  }  }
1160    
1161  rule LinkLibraries  rule LinkLibraries
1162  {  {
1163      # make library dependencies of target      # make library dependencies of target
1164      # set NEEDLIBS variable used by 'actions Main'      # set NEEDLIBS variable used by 'actions Main'
1165    
1166      local _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;      local _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;
1167    
1168      DEPENDS $(_t) : $(>:S=$(SUFLIB)) ;      DEPENDS $(_t) : $(>:S=$(SUFLIB)) ;
1169      NEEDLIBS on $(_t) += $(>:S=$(SUFLIB)) ;      NEEDLIBS on $(_t) += $(>:S=$(SUFLIB)) ;
1170  }  }
1171    
1172  rule Main  rule Main
1173  {  {
1174      MainFromObjects $(<) : $(>:S=$(SUFOBJ)) ;      MainFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
1175      Objects $(>) ;      Objects $(>) ;
1176  }  }
1177    
1178  rule MainFromObjects  rule MainFromObjects
1179  {  {
1180      local _s _t ;      local _s _t ;
1181    
1182      # Add grist to file names      # Add grist to file names
1183      # Add suffix to exe      # Add suffix to exe
1184    
1185      _s = [ FGristFiles $(>) ] ;      _s = [ FGristFiles $(>) ] ;
1186      _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;      _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;
1187    
1188      if $(_t) != $(<)      if $(_t) != $(<)
1189      {      {
1190          DEPENDS $(<) : $(_t) ;          DEPENDS $(<) : $(_t) ;
1191          NOTFILE $(<) ;          NOTFILE $(<) ;
1192      }      }
1193    
1194      # make compiled sources a dependency of target      # make compiled sources a dependency of target
1195    
1196      DEPENDS exe : $(_t) ;      DEPENDS exe : $(_t) ;
1197      DEPENDS $(_t) : $(_s) ;      DEPENDS $(_t) : $(_s) ;
1198      MakeLocate $(_t) : $(LOCATE_TARGET) ;      MakeLocate $(_t) : $(LOCATE_TARGET) ;
1199    
1200      Clean clean : $(_t) ;      Clean clean : $(_t) ;
1201    
1202      Link $(_t) : $(_s) ;      Link $(_t) : $(_s) ;
1203  }  }
1204    
1205  rule MakeLocate  rule MakeLocate
1206  {  {
1207      if $(>)      if $(>)
1208      {      {
1209          LOCATE on $(<) = $(>) ;          LOCATE on $(<) = $(>) ;
1210          Depends $(<) : $(>[1]) ;          Depends $(<) : $(>[1]) ;
1211          MkDir $(>[1]) ;          MkDir $(>[1]) ;
1212      }      }
1213  }  }
1214    
1215  rule MkDir  rule MkDir
1216  {  {
1217      # If dir exists, don't update it      # If dir exists, don't update it
1218      # Do this even for $(DOT).      # Do this even for $(DOT).
1219    
1220      NOUPDATE $(<) ;      NOUPDATE $(<) ;
1221    
1222      if $(<) != $(DOT) && ! $($(<)-mkdir)      if $(<) != $(DOT) && ! $($(<)-mkdir)
1223      {      {
1224          local s ;          local s ;
1225    
1226          # Cheesy gate to prevent multiple invocations on same dir          # Cheesy gate to prevent multiple invocations on same dir
1227          # MkDir1 has the actions          # MkDir1 has the actions
1228          # Arrange for jam dirs          # Arrange for jam dirs
1229    
1230          $(<)-mkdir = true ;          $(<)-mkdir = true ;
1231          MkDir1 $(<) ;          MkDir1 $(<) ;
1232          Depends dirs : $(<) ;          Depends dirs : $(<) ;
1233    
1234          # Recursively make parent directories.          # Recursively make parent directories.
1235          # $(<:P) = $(<)'s parent, & we recurse until root          # $(<:P) = $(<)'s parent, & we recurse until root
1236    
1237          s = $(<:P) ;          s = $(<:P) ;
1238    
1239          if $(NT)          if $(NT)
1240          {          {
1241              switch $(s)              switch $(s)
1242          {          {
1243          case *:   : s = ;          case *:   : s = ;
1244          case *:\\ : s = ;          case *:\\ : s = ;
1245          }          }
1246          }          }
1247    
1248          if $(s) && $(s) != $(<)          if $(s) && $(s) != $(<)
1249          {          {
1250          Depends $(<) : $(s) ;          Depends $(<) : $(s) ;
1251          MkDir $(s) ;          MkDir $(s) ;
1252          }          }
1253          else if $(s)          else if $(s)
1254          {          {
1255              NOTFILE $(s) ;              NOTFILE $(s) ;
1256          }          }
1257    
1258      }      }
1259  }  }
1260    
1261  rule Object  rule Object
1262  {  {
1263      local h ;      local h ;
1264    
1265      # locate object and search for source, if wanted      # locate object and search for source, if wanted
1266    
1267      Clean clean : $(<) ;      Clean clean : $(<) ;
1268    
1269      MakeLocate $(<) : $(LOCATE_TARGET) ;      MakeLocate $(<) : $(LOCATE_TARGET) ;
1270      SEARCH on $(>) = $(SEARCH_SOURCE) ;      SEARCH on $(>) = $(SEARCH_SOURCE) ;
1271    
1272      # Save HDRS for -I$(HDRS) on compile.      # Save HDRS for -I$(HDRS) on compile.
1273      # We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers      # We shouldn't need -I$(SEARCH_SOURCE) as cc can find headers
1274      # in the .c file's directory, but generated .c files (from      # in the .c file's directory, but generated .c files (from
1275      # yacc, lex, etc) are located in $(LOCATE_TARGET), possibly      # yacc, lex, etc) are located in $(LOCATE_TARGET), possibly
1276      # different from $(SEARCH_SOURCE).      # different from $(SEARCH_SOURCE).
1277    
1278      HDRS on $(<) = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;      HDRS on $(<) = $(SEARCH_SOURCE) $(HDRS) $(SUBDIRHDRS) ;
1279    
1280      # handle #includes for source: Jam scans for headers with      # handle #includes for source: Jam scans for headers with
1281      # the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)      # the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE)
1282      # with the scanned file as the target and the found headers      # with the scanned file as the target and the found headers
1283      # as the sources.  HDRSEARCH is the value of SEARCH used for      # as the sources.  HDRSEARCH is the value of SEARCH used for
1284      # the found header files.  Finally, if jam must deal with      # the found header files.  Finally, if jam must deal with
1285      # header files of the same name in different directories,      # header files of the same name in different directories,
1286      # they can be distinguished with HDRGRIST.      # they can be distinguished with HDRGRIST.
1287    
1288      # $(h) is where cc first looks for #include "foo.h" files.      # $(h) is where cc first looks for #include "foo.h" files.
1289      # If the source file is in a distant directory, look there.      # If the source file is in a distant directory, look there.
1290      # Else, look in "" (the current directory).      # Else, look in "" (the current directory).
1291    
1292      if $(SEARCH_SOURCE)      if $(SEARCH_SOURCE)
1293      {      {
1294          h = $(SEARCH_SOURCE) ;          h = $(SEARCH_SOURCE) ;
1295      }      }
1296      else      else
1297      {      {
1298          h = "" ;          h = "" ;
1299      }      }
1300    
1301      HDRRULE on $(>) = HdrRule ;      HDRRULE on $(>) = HdrRule ;
1302      HDRSCAN on $(>) = $(HDRPATTERN) ;      HDRSCAN on $(>) = $(HDRPATTERN) ;
1303      HDRSEARCH on $(>) = $(HDRS) $(SUBDIRHDRS) $(h) $(STDHDRS) ;      HDRSEARCH on $(>) = $(HDRS) $(SUBDIRHDRS) $(h) $(STDHDRS) ;
1304      HDRGRIST on $(>) = $(HDRGRIST) ;      HDRGRIST on $(>) = $(HDRGRIST) ;
1305    
1306      # if source is not .c, generate .c with specific rule      # if source is not .c, generate .c with specific rule
1307    
1308      switch $(>:S)      switch $(>:S)
1309      {      {
1310          case .asm : As $(<) : $(>) ;          case .asm : As $(<) : $(>) ;
1311          case .c :   Cc $(<) : $(>) ;          case .c :   Cc $(<) : $(>) ;
1312          case .C :   C++ $(<) : $(>) ;          case .C :   C++ $(<) : $(>) ;
1313          case .cc :  C++ $(<) : $(>) ;          case .cc :  C++ $(<) : $(>) ;
1314          case .cpp : C++ $(<) : $(>) ;          case .cpp : C++ $(<) : $(>) ;
1315          case .f :   Fortran $(<) : $(>) ;          case .f :   Fortran $(<) : $(>) ;
1316          case .l :   Cc $(<) : $(<:S=.c) ;          case .l :   Cc $(<) : $(<:S=.c) ;
1317                      Lex $(<:S=.c) : $(>) ;                      Lex $(<:S=.c) : $(>) ;
1318          case .s :   As $(<) : $(>) ;          case .s :   As $(<) : $(>) ;
1319          case .y :   Cc $(<) : $(<:S=.c) ;          case .y :   Cc $(<) : $(<:S=.c) ;
1320                      Yacc $(<:S=.c) : $(>) ;                      Yacc $(<:S=.c) : $(>) ;
1321          case * :    UserObject $(<) : $(>) ;          case * :    UserObject $(<) : $(>) ;
1322      }      }
1323  }  }
1324    
1325    
1326  rule ObjectCcFlags  rule ObjectCcFlags
1327  {  {
1328      CCFLAGS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;      CCFLAGS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;
1329  }  }
1330    
1331  rule ObjectC++Flags  rule ObjectC++Flags
1332  {  {
1333      C++FLAGS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;      C++FLAGS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;
1334  }  }
1335    
1336  rule ObjectHdrs  rule ObjectHdrs
1337  {  {
1338      HDRS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;      HDRS on [ FGristFiles $(<:S=$(SUFOBJ)) ] += $(>) ;
1339  }  }
1340    
1341  rule Objects  rule Objects
1342  {  {
1343      local _i ;      local _i ;
1344    
1345      for _i in [ FGristFiles $(<) ]      for _i in [ FGristFiles $(<) ]
1346      {      {
1347          Object $(_i:S=$(SUFOBJ)) : $(_i) ;          Object $(_i:S=$(SUFOBJ)) : $(_i) ;
1348          DEPENDS obj : $(_i:S=$(SUFOBJ)) ;          DEPENDS obj : $(_i:S=$(SUFOBJ)) ;
1349      }      }
1350  }  }
1351    
1352  rule RmTemps  rule RmTemps
1353  {  {
1354      TEMPORARY $(>) ;      TEMPORARY $(>) ;
1355  }  }
1356    
1357  rule Setuid  rule Setuid
1358  {  {
1359      MODE on [ FAppendSuffix $(<) : $(SUFEXE) ] = 4711 ;      MODE on [ FAppendSuffix $(<) : $(SUFEXE) ] = 4711 ;
1360  }  }
1361    
1362  rule Shell  rule Shell
1363  {  {
1364      DEPENDS shell : $(<) ;      DEPENDS shell : $(<) ;
1365      DEPENDS $(<) : $(>) ;      DEPENDS $(<) : $(>) ;
1366      SEARCH on $(>) = $(SEARCH_SOURCE) ;      SEARCH on $(>) = $(SEARCH_SOURCE) ;
1367      MODE on $(<) = $(SHELLMODE) ;      MODE on $(<) = $(SHELLMODE) ;
1368      Clean clean : $(<) ;      Clean clean : $(<) ;
1369      Chmod $(<) ;      Chmod $(<) ;
1370  }  }
1371    
1372  rule SubDir  rule SubDir
1373  {  {
1374      local _r _s ;      local _r _s ;
1375    
1376      #      #
1377      # SubDir TOP d1 [ ... ]      # SubDir TOP d1 [ ... ]
1378      #      #
1379      # This introduces a Jamfile that is part of a project tree      # This introduces a Jamfile that is part of a project tree
1380      # rooted at $(TOP).  It (only once) includes the project-specific      # rooted at $(TOP).  It (only once) includes the project-specific
1381      # rules file $(TOP)/Jamrules and then sets search & locate stuff.      # rules file $(TOP)/Jamrules and then sets search & locate stuff.
1382      #      #
1383      # If the variable $(TOPRULES) is set (where TOP is the first arg      # If the variable $(TOPRULES) is set (where TOP is the first arg
1384      # to SubDir), that file is included instead of $(TOP)/Jamrules.      # to SubDir), that file is included instead of $(TOP)/Jamrules.
1385      #      #
1386      # d1 ... are the directory elements that lead to this directory      # d1 ... are the directory elements that lead to this directory
1387      # from $(TOP).  We construct the system dependent path from these      # from $(TOP).  We construct the system dependent path from these
1388      # directory elements in order to set search&locate stuff.      # directory elements in order to set search&locate stuff.
1389      #      #
1390    
1391      if ! $($(<[1]))      if ! $($(<[1]))
1392      {      {
1393          if ! $(<[1])          if ! $(<[1])
1394          {          {
1395          EXIT SubDir syntax error ;          EXIT SubDir syntax error ;
1396          }          }
1397    
1398          $(<[1]) = [ FSubDir $(<[2-]) ] ;          $(<[1]) = [ FSubDir $(<[2-]) ] ;
1399      }      }
1400    
1401      #      #
1402      # If $(TOP)/Jamrules hasn't been included, do so.      # If $(TOP)/Jamrules hasn't been included, do so.
1403      #      #
1404    
1405      if ! $($(<[1])-included)      if ! $($(<[1])-included)
1406      {      {
1407          # Gated entry.          # Gated entry.
1408    
1409          $(<[1])-included = TRUE ;          $(<[1])-included = TRUE ;
1410    
1411          # File is $(TOPRULES) or $(TOP)/Jamrules.          # File is $(TOPRULES) or $(TOP)/Jamrules.
1412    
1413          _r = $($(<[1])RULES) ;          _r = $($(<[1])RULES) ;
1414    
1415          if ! $(_r)          if ! $(_r)
1416          {          {
1417          _r = $(JAMRULES:R=$($(<[1]))) ;          _r = $(JAMRULES:R=$($(<[1]))) ;
1418          }          }
1419    
1420          # Include it.          # Include it.
1421    
1422          include $(_r) ;          include $(_r) ;
1423      }      }
1424    
1425      # Get path to current directory from root using SubDir.      # Get path to current directory from root using SubDir.
1426      # Save dir tokens for other potential uses.      # Save dir tokens for other potential uses.
1427    
1428      _s = [ FDirName $(<[2-]) ] ;      _s = [ FDirName $(<[2-]) ] ;
1429      SUBDIR = $(_s:R=$($(<[1]))) ;      SUBDIR = $(_s:R=$($(<[1]))) ;
1430          SUBDIR_TOKENS = $(<[2-]) ;          SUBDIR_TOKENS = $(<[2-]) ;
1431    
1432      # Now set up SEARCH_SOURCE, LOCATE_TARGET, SOURCE_GRIST      # Now set up SEARCH_SOURCE, LOCATE_TARGET, SOURCE_GRIST
1433      # These can be reset if needed.  For example, if the source      # These can be reset if needed.  For example, if the source
1434      # directory should not hold object files, LOCATE_TARGET can      # directory should not hold object files, LOCATE_TARGET can
1435      # subsequently be redefined.      # subsequently be redefined.
1436    
1437      SEARCH_SOURCE = $(SUBDIR) ;      SEARCH_SOURCE = $(SUBDIR) ;
1438      LOCATE_SOURCE = $(ALL_LOCATE_TARGET) $(SUBDIR) ;      LOCATE_SOURCE = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
1439      LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(SUBDIR) ;      LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(SUBDIR) ;
1440      SOURCE_GRIST = [ FGrist $(<[2-]) ] ;      SOURCE_GRIST = [ FGrist $(<[2-]) ] ;
1441    
1442      # Reset per-directory ccflags, hdrs      # Reset per-directory ccflags, hdrs
1443    
1444      SUBDIRCCFLAGS = ;      SUBDIRCCFLAGS = ;
1445      SUBDIRC++FLAGS = ;      SUBDIRC++FLAGS = ;
1446      SUBDIRHDRS = ;      SUBDIRHDRS = ;
1447  }  }
1448    
1449  rule SubDirCcFlags  rule SubDirCcFlags
1450  {  {
1451      SUBDIRCCFLAGS += $(<) ;      SUBDIRCCFLAGS += $(<) ;
1452  }  }
1453    
1454  rule SubDirC++Flags  rule SubDirC++Flags
1455  {  {
1456      SUBDIRC++FLAGS += $(<) ;      SUBDIRC++FLAGS += $(<) ;
1457  }  }
1458    
1459  rule SubDirHdrs  rule SubDirHdrs
1460  {  {
1461      SUBDIRHDRS += $(<) ;      SUBDIRHDRS += $(<) ;
1462  }  }
1463    
1464  rule SubInclude  rule SubInclude
1465  {  {
1466      local _s ;      local _s ;
1467    
1468      # That's      # That's
1469      #   SubInclude TOP d1 [ d2 [ d3 [ d4 ] ] ]      #   SubInclude TOP d1 [ d2 [ d3 [ d4 ] ] ]
1470      #      #
1471      # to include a subdirectory's Jamfile.      # to include a subdirectory's Jamfile.
1472    
1473      if ! $($(<[1]))      if ! $($(<[1]))
1474      {      {
1475          EXIT Top level of source tree has not been set with $(<[1]) ;          EXIT Top level of source tree has not been set with $(<[1]) ;
1476      }      }
1477    
1478      _s = [ FDirName $(<[2-]) ] ;      _s = [ FDirName $(<[2-]) ] ;
1479    
1480      include $(JAMFILE:D=$(_s):R=$($(<[1]))) ;      include $(JAMFILE:D=$(_s):R=$($(<[1]))) ;
1481  }  }
1482    
1483  rule Undefines  rule Undefines
1484  {  {
1485      UNDEFS on [ FAppendSuffix $(<) : $(SUFEXE) ] += $(UNDEFFLAG)$(>) ;      UNDEFS on [ FAppendSuffix $(<) : $(SUFEXE) ] += $(UNDEFFLAG)$(>) ;
1486  }  }
1487    
1488  rule UserObject  rule UserObject
1489  {  {
1490      EXIT "Unknown suffix on" $(>) "- see UserObject rule in Jamfile(5)." ;      EXIT "Unknown suffix on" $(>) "- see UserObject rule in Jamfile(5)." ;
1491  }  }
1492    
1493  rule Yacc  rule Yacc
1494  {  {
1495      local _h ;      local _h ;
1496    
1497      _h = $(<:BS=.h) ;      _h = $(<:BS=.h) ;
1498    
1499      # Some places don't have a yacc.      # Some places don't have a yacc.
1500    
1501      MakeLocate $(<) $(_h) : $(LOCATE_SOURCE) ;      MakeLocate $(<) $(_h) : $(LOCATE_SOURCE) ;
1502    
1503      if $(YACC)      if $(YACC)
1504      {      {
1505          DEPENDS $(<) $(_h) : $(>) ;          DEPENDS $(<) $(_h) : $(>) ;
1506          Yacc1 $(<) $(_h) : $(>) ;          Yacc1 $(<) $(_h) : $(>) ;
1507          YaccMv $(<) $(_h) : $(>) ;          YaccMv $(<) $(_h) : $(>) ;
1508          Clean clean : $(<) $(_h) ;          Clean clean : $(<) $(_h) ;
1509      }      }
1510    
1511      # make sure someone includes $(_h) else it will be      # make sure someone includes $(_h) else it will be
1512      # a deadly independent target      # a deadly independent target
1513    
1514      INCLUDES $(<) : $(_h) ;      INCLUDES $(<) : $(_h) ;
1515  }  }
1516    
1517  #  #
1518  # Utility rules; no side effects on these  # Utility rules; no side effects on these
1519  #  #
1520    
1521  rule FGrist  rule FGrist
1522  {  {
1523      # Turn individual elements in $(<) into grist.      # Turn individual elements in $(<) into grist.
1524    
1525      local _g _i ;      local _g _i ;
1526    
1527      _g = $(<[1]) ;      _g = $(<[1]) ;
1528    
1529      for _i in $(<[2-])      for _i in $(<[2-])
1530      {      {
1531          _g = $(_g)!$(_i) ;          _g = $(_g)!$(_i) ;
1532      }      }
1533    
1534      return $(_g) ;      return $(_g) ;
1535  }  }
1536    
1537  rule FGristFiles  rule FGristFiles
1538  {  {
1539      if ! $(SOURCE_GRIST)      if ! $(SOURCE_GRIST)
1540      {      {
1541          return $(<) ;          return $(<) ;
1542      }      }
1543      else      else
1544      {      {
1545          return $(<:G=$(SOURCE_GRIST)) ;          return $(<:G=$(SOURCE_GRIST)) ;
1546      }      }
1547  }  }
1548    
1549  rule FGristSourceFiles  rule FGristSourceFiles
1550  {  {
1551      # Produce source file name name with grist in it,      # Produce source file name name with grist in it,
1552      # if SOURCE_GRIST is set.      # if SOURCE_GRIST is set.
1553    
1554      # Leave header files alone, because they have a global      # Leave header files alone, because they have a global
1555      # visibility.      # visibility.
1556    
1557      if ! $(SOURCE_GRIST)      if ! $(SOURCE_GRIST)
1558      {      {
1559          return $(<) ;          return $(<) ;
1560      }      }
1561      else      else
1562      {      {
1563          local _i _o ;          local _i _o ;
1564    
1565          for _i in $(<)          for _i in $(<)
1566          {          {
1567          switch $(_i)          switch $(_i)
1568          {          {
1569          case *.h :  _o += $(_i) ;          case *.h :  _o += $(_i) ;
1570          case * :    _o += $(_i:G=$(SOURCE_GRIST)) ;          case * :    _o += $(_i:G=$(SOURCE_GRIST)) ;
1571          }          }
1572          }          }
1573    
1574          return $(_o) ;          return $(_o) ;
1575      }      }
1576  }  }
1577    
1578  rule FConcat  rule FConcat
1579  {  {
1580      # Puts the variables together, removing spaces.      # Puts the variables together, removing spaces.
1581    
1582      local _t _r ;      local _t _r ;
1583    
1584      $(_r) = $(<[1]) ;      $(_r) = $(<[1]) ;
1585    
1586      for _t in $(<[2-])      for _t in $(<[2-])
1587      {      {
1588          $(_r) = $(_r)$(_t) ;          $(_r) = $(_r)$(_t) ;
1589      }      }
1590    
1591      return $(_r) ;      return $(_r) ;
1592  }  }
1593    
1594  rule FSubDir  rule FSubDir
1595  {  {
1596      local _i _d ;      local _i _d ;
1597    
1598      # If $(>) is the path to the current directory, compute the      # If $(>) is the path to the current directory, compute the
1599      # path (using ../../ etc) back to that root directory.      # path (using ../../ etc) back to that root directory.
1600      # Sets result in $(<)      # Sets result in $(<)
1601    
1602      if ! $(<[1])      if ! $(<[1])
1603      {      {
1604          _d = $(DOT) ;          _d = $(DOT) ;
1605      }      }
1606      else      else
1607      {      {
1608          _d = $(DOTDOT) ;          _d = $(DOTDOT) ;
1609    
1610          for _i in $(<[2-])          for _i in $(<[2-])
1611          {          {
1612          _d = $(_d:R=$(DOTDOT)) ;          _d = $(_d:R=$(DOTDOT)) ;
1613          }          }
1614      }      }
1615    
1616      return $(_d) ;      return $(_d) ;
1617  }  }
1618    
1619  rule FDirName  rule FDirName
1620  {  {
1621      local _s _i ;      local _s _i ;
1622    
1623      # Turn individual elements in $(<) into a usable path.      # Turn individual elements in $(<) into a usable path.
1624    
1625      if ! $(<)      if ! $(<)
1626      {      {
1627          _s = $(DOT) ;          _s = $(DOT) ;
1628      }      }
1629      else if $(VMS)      else if $(VMS)
1630      {      {
1631          # This handles the following cases:          # This handles the following cases:
1632          #   a -> [.a]          #   a -> [.a]
1633          #   a b c -> [.a.b.c]          #   a b c -> [.a.b.c]
1634          #   x: -> x:          #   x: -> x:
1635          #   x: a -> x:[a]          #   x: a -> x:[a]
1636          #   x:[a] b -> x:[a.b]          #   x:[a] b -> x:[a.b]
1637    
1638          switch $(<[1])          switch $(<[1])
1639          {          {
1640          case *:* : _s = $(<[1]) ;          case *:* : _s = $(<[1]) ;
1641          case \\[*\\] : _s = $(<[1]) ;          case \\[*\\] : _s = $(<[1]) ;
1642          case * : _s = [.$(<[1])] ;          case * : _s = [.$(<[1])] ;
1643          }          }
1644    
1645          for _i in [.$(<[2-])]          for _i in [.$(<[2-])]
1646          {          {
1647          _s = $(_i:R=$(_s)) ;          _s = $(_i:R=$(_s)) ;
1648          }          }
1649      }      }
1650      else if $(MAC)      else if $(MAC)
1651      {      {
1652          _s = $(DOT) ;          _s = $(DOT) ;
1653    
1654          for _i in $(<)          for _i in $(<)
1655          {          {
1656              _s = $(_i:R=$(_s)) ;              _s = $(_i:R=$(_s)) ;
1657          }          }
1658      }      }
1659      else      else
1660      {      {
1661          _s = $(<[1]) ;          _s = $(<[1]) ;
1662    
1663          for _i in $(<[2-])          for _i in $(<[2-])
1664          {          {
1665          _s = $(_i:R=$(_s)) ;          _s = $(_i:R=$(_s)) ;
1666          }          }
1667      }      }
1668    
1669      return $(_s) ;      return $(_s) ;
1670  }  }
1671    
1672    
1673  rule _makeCommon  rule _makeCommon
1674  {  {
1675      # strip common initial elements      # strip common initial elements
1676    
1677      if $($(<)[1]) && $($(<)[1]) = $($(>)[1])      if $($(<)[1]) && $($(<)[1]) = $($(>)[1])
1678      {      {
1679          $(<) = $($(<)[2-]) ;          $(<) = $($(<)[2-]) ;
1680          $(>) = $($(>)[2-]) ;          $(>) = $($(>)[2-]) ;
1681          _makeCommon $(<) : $(>) ;          _makeCommon $(<) : $(>) ;
1682      }      }
1683  }  }
1684    
1685    
1686  rule FRelPath  rule FRelPath
1687  {  {
1688      local _l _r ;      local _l _r ;
1689    
1690      # first strip off common parts      # first strip off common parts
1691    
1692      _l = $(<) ;      _l = $(<) ;
1693      _r = $(>) ;      _r = $(>) ;
1694    
1695      _makeCommon _l : _r ;      _makeCommon _l : _r ;
1696    
1697      # now make path to root and path down      # now make path to root and path down
1698    
1699      _l = [ FSubDir $(_l) ] ;      _l = [ FSubDir $(_l) ] ;
1700      _r = [ FDirName $(_r) ] ;      _r = [ FDirName $(_r) ] ;
1701    
1702      # Concatenate and save      # Concatenate and save
1703    
1704      # XXX This should be better      # XXX This should be better
1705    
1706      if $(_r) = $(DOT) {      if $(_r) = $(DOT) {
1707          return $(_l) ;          return $(_l) ;
1708      } else {      } else {
1709          return $(_r:R=$(_l)) ;          return $(_r:R=$(_l)) ;
1710      }      }
1711  }  }
1712    
1713  rule FAppendSuffix  rule FAppendSuffix
1714  {  {
1715         # E.g., "FAppendSuffix yacc lex foo.bat : $(SUFEXE) ;"         # E.g., "FAppendSuffix yacc lex foo.bat : $(SUFEXE) ;"
1716         # returns (yacc,lex,foo.bat) on Unix and         # returns (yacc,lex,foo.bat) on Unix and
1717         # (yacc.exe,lex.exe,foo.bat) on NT.         # (yacc.exe,lex.exe,foo.bat) on NT.
1718    
1719      if $(>)      if $(>)
1720      {      {
1721          local _i _o ;          local _i _o ;
1722    
1723          for _i in $(<)          for _i in $(<)
1724          {          {
1725          if $(_i:S)          if $(_i:S)
1726          {          {
1727              _o += $(_i) ;              _o += $(_i) ;
1728          }          }
1729          else          else
1730          {          {
1731              _o += $(_i:S=$(>)) ;              _o += $(_i:S=$(>)) ;
1732          }          }
1733          }          }
1734          return $(_o) ;          return $(_o) ;
1735      }      }
1736      else      else
1737      {      {
1738          return $(<) ;          return $(<) ;
1739      }      }
1740  }  }
1741    
1742  rule unmakeDir  rule unmakeDir
1743  {  {
1744      if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\      if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\
1745      {      {
1746          unmakeDir $(<) : $(>[1]:D) $(>[1]:BS) $(>[2-]) ;          unmakeDir $(<) : $(>[1]:D) $(>[1]:BS) $(>[2-]) ;
1747      }      }
1748      else      else
1749      {      {
1750          $(<) = $(>) ;          $(<) = $(>) ;
1751      }      }
1752  }  }
1753    
1754    
1755  rule FConvertToSlashes  rule FConvertToSlashes
1756  {  {
1757    local _d, _s, _i ;    local _d, _s, _i ;
1758        
1759    unmakeDir _d : $(<) ;    unmakeDir _d : $(<) ;
1760        
1761    _s = $(_d[1]) ;    _s = $(_d[1]) ;
1762    for _i in $(_d[2-])    for _i in $(_d[2-])
1763    {    {
1764      _s = $(_s)/$(_i) ;      _s = $(_s)/$(_i) ;
1765    }    }
1766    return $(_s) ;    return $(_s) ;
1767  }  }
1768    
1769    
1770  #  #
1771  # Actions  # Actions
1772  #  #
1773    
1774  #  #
1775  # First the defaults  # First the defaults
1776  #  #
1777    
1778  actions updated together piecemeal Archive  actions updated together piecemeal Archive
1779  {  {
1780      $(AR) $(<) $(>)      $(AR) $(<) $(>)
1781  }  }
1782    
1783  actions As  actions As
1784  {  {
1785      $(AS) $(ASFLAGS) -I$(HDRS) -o $(<) $(>)      $(AS) $(ASFLAGS) -I$(HDRS) -o $(<) $(>)
1786  }  }
1787    
1788  actions C++  actions C++
1789  {  {
1790      $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)      $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)
1791  }  }
1792    
1793  actions Cc  actions Cc
1794  {  {
1795      $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)      $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)
1796  }  }
1797    
1798  actions Chgrp  actions Chgrp
1799  {  {
1800      chgrp $(GROUP) $(<)      chgrp $(GROUP) $(<)
1801  }  }
1802    
1803  actions Chmod1  actions Chmod1
1804  {  {
1805      $(CHMOD) $(MODE) $(<)      $(CHMOD) $(MODE) $(<)
1806  }  }
1807    
1808  actions Chown  actions Chown
1809  {  {
1810      chown $(OWNER) $(<)      chown $(OWNER) $(<)
1811  }  }
1812    
1813  actions piecemeal together existing Clean  actions piecemeal together existing Clean
1814  {  {
1815      $(RM) $(>)      $(RM) $(>)
1816  }  }
1817    
1818  actions File  actions File
1819  {  {
1820      $(CP) $(>) $(<)      $(CP) $(>) $(<)
1821  }  }
1822    
1823  actions GenFile1  actions GenFile1
1824  {  {
1825      $(>[1]) $(<) $(>[2-])      $(>[1]) $(<) $(>[2-])
1826  }  }
1827    
1828  actions Fortran  actions Fortran
1829  {  {
1830      $(FORTRAN) $(FORTRANFLAGS) -o $(<) $(>)      $(FORTRAN) $(FORTRANFLAGS) -o $(<) $(>)
1831  }  }
1832    
1833  actions HardLink  actions HardLink
1834  {  {
1835      $(RM) $(<) && $(LN) $(>) $(<)      $(RM) $(<) && $(LN) $(>) $(<)
1836  }  }
1837    
1838  actions Install  actions Install
1839  {  {
1840      $(CP) $(>) $(<)      $(CP) $(>) $(<)
1841  }  }
1842    
1843  actions Lex  actions Lex
1844  {  {
1845      $(LEX) $(>)      $(LEX) $(>)
1846  }  }
1847    
1848  actions LexMv  actions LexMv
1849  {  {
1850      $(MV) lex.yy.c $(<)      $(MV) lex.yy.c $(<)
1851  }  }
1852    
1853  actions Link bind NEEDLIBS  actions Link bind NEEDLIBS
1854  {  {
1855      $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)      $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
1856  }  }
1857    
1858  actions MkDir1  actions MkDir1
1859  {  {
1860      $(MKDIR) $(<)      $(MKDIR) $(<)
1861  }  }
1862    
1863  actions together Ranlib  actions together Ranlib
1864  {  {
1865      $(RANLIB) $(<)      $(RANLIB) $(<)
1866  }  }
1867    
1868  actions quietly updated piecemeal together RmTemps  actions quietly updated piecemeal together RmTemps
1869  {  {
1870      $(RM) $(>)      $(RM) $(>)
1871  }  }
1872    
1873  actions Shell  actions Shell
1874  {  {
1875      $(AWK) '      $(AWK) '
1876          NR == 1 { print "$(SHELLHEADER)" }          NR == 1 { print "$(SHELLHEADER)" }
1877          NR == 1 && /^[#:]/ { next }          NR == 1 && /^[#:]/ { next }
1878          /^##/ { next }          /^##/ { next }
1879          { print }          { print }
1880      ' < $(>) > $(<)      ' < $(>) > $(<)
1881  }  }
1882    
1883  actions Yacc1  actions Yacc1
1884  {  {
1885    $(YACC) $(YACCFLAGS) $(>)    $(YACC) $(YACCFLAGS) $(>)
1886  }  }
1887    
1888  actions YaccMv  actions YaccMv
1889  {  {
1890    $(MV) $(YACCFILES).c $(<[1])    $(MV) $(YACCFILES).c $(<[1])
1891    $(MV) $(YACCFILES).h $(<[2])    $(MV) $(YACCFILES).h $(<[2])
1892  }  }
1893    
1894  #  #
1895  # RELOCATE - for compilers with broken -o flags  # RELOCATE - for compilers with broken -o flags
1896  #  #
1897    
1898  if $(RELOCATE)  if $(RELOCATE)
1899  {  {
1900    actions C++    actions C++
1901    {    {
1902      $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) $(>)      $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) $(>)
1903    }    }
1904    
1905    actions Cc    actions Cc
1906    {    {
1907      $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) $(>)      $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) $(>)
1908    }    }
1909    
1910    actions ignore CcMv    actions ignore CcMv
1911    {    {
1912      [ $(<) != $(>:BS=$(SUFOBJ)) ] && $(MV) $(>:BS=$(SUFOBJ)) $(<)      [ $(<) != $(>:BS=$(SUFOBJ)) ] && $(MV) $(>:BS=$(SUFOBJ)) $(<)
1913    }    }
1914  }  }
1915    
1916  #  #
1917  # NOARUPDATE - can't update an archive  # NOARUPDATE - can't update an archive
1918  #  #
1919    
1920  if $(NOARUPDATE)  if $(NOARUPDATE)
1921  {  {
1922      actions Archive      actions Archive
1923      {      {
1924      $(AR) $(<) $(>)      $(AR) $(<) $(>)
1925      }      }
1926  }  }
1927    
1928  #  #
1929  # NT specific actions  # NT specific actions
1930  #  #
1931    
1932  if $(NT)  if $(NT)
1933  {  {
1934    if $(TOOLSET) = VISUALC || $(TOOLSET) = INTELC    if $(TOOLSET) = VISUALC || $(TOOLSET) = INTELC
1935    {    {
1936      actions updated together piecemeal Archive      actions updated together piecemeal Archive
1937      {      {
1938      if exist $(<) set _$(<:B)_=$(<)      if exist $(<) set _$(<:B)_=$(<)
1939      $(AR) /out:$(<) %_$(<:B)_% $(>)      $(AR) /out:$(<) %_$(<:B)_% $(>)
1940      }      }
1941    
1942      actions As      actions As
1943      {      {
1944      $(AS) /Ml /p /v /w2 $(>) $(<) ,nul,nul;      $(AS) /Ml /p /v /w2 $(>) $(<) ,nul,nul;
1945      }      }
1946    
1947      actions Cc      actions Cc
1948      {      {
1949      $(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) $(>)      $(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) $(>)
1950      }      }
1951    
1952      actions C++      actions C++
1953      {      {
1954      $(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) /Tp$(>)      $(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) /Tp$(>)
1955      }      }
1956    
1957      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
1958      {      {
1959      $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)      $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
1960      }      }
1961    }    }
1962    else if $(TOOLSET) = VISUALC16    else if $(TOOLSET) = VISUALC16
1963    {    {
1964      actions updated together piecemeal Archive      actions updated together piecemeal Archive
1965      {      {
1966      $(AR) $(<) -+$(>)      $(AR) $(<) -+$(>)
1967      }      }
1968    
1969      actions Cc      actions Cc
1970      {      {
1971      $(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) $(>)      $(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) $(>)
1972      }      }
1973    
1974      actions C++      actions C++
1975      {      {
1976      $(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /Tp$(>)      $(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /Tp$(>)
1977      }      }
1978    
1979      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
1980      {      {
1981      $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)      $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
1982      }      }
1983    }    }
1984    else if $(TOOLSET) = BORLANDC    else if $(TOOLSET) = BORLANDC
1985    {    {
1986      actions updated together piecemeal Archive      actions updated together piecemeal Archive
1987      {      {
1988        $(AR) $(<) -+$(>)        $(AR) $(<) -+$(>)
1989      }      }
1990    
1991      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
1992      {      {
1993        $(LINK) -e$(<) $(LINKFLAGS) $(UNDEFS) -L$(LINKLIBS) $(NEEDLIBS) $(>)        $(LINK) -e$(<) $(LINKFLAGS) $(UNDEFS) -L$(LINKLIBS) $(NEEDLIBS) $(>)
1994      }      }
1995    
1996      actions C++      actions C++
1997      {      {
1998        $(C++) -c $(C++FLAGS) $(OPTIM) -I$(STDHDRS) -I$(HDRS) -o$(<) $(>)        $(C++) -c $(C++FLAGS) $(OPTIM) -I$(STDHDRS) -I$(HDRS) -o$(<) $(>)
1999      }      }
2000    
2001      actions Cc      actions Cc
2002      {      {
2003        $(CC) -c $(CCFLAGS) $(OPTIM) -I$(STDHDRS) -I$(HDRS) -o$(<) $(>)        $(CC) -c $(CCFLAGS) $(OPTIM) -I$(STDHDRS) -I$(HDRS) -o$(<) $(>)
2004      }      }
2005    
2006    }    }
2007    else if $(TOOLSET) = MINGW    else if $(TOOLSET) = MINGW
2008    {    {
2009  #    actions together piecemeal Archive  #    actions together piecemeal Archive
2010  #    {  #    {
2011  #      $(AR) $(<) $(>:T)  #      $(AR) $(<) $(>:T)
2012  #    }  #    }
2013    
2014  #    actions Cc  #    actions Cc
2015  #    {  #    {
2016  #    $(CC) $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)  #    $(CC) $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
2017  #    }  #    }
2018    
2019  #    actions C++  #    actions C++
2020  #    {  #    {
2021  #    $(C++) $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)  #    $(C++) $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
2022  #    }  #    }
2023    }    }
2024    else if $(TOOLSET) = WATCOM    else if $(TOOLSET) = WATCOM
2025    {    {
2026      actions together piecemeal Archive      actions together piecemeal Archive
2027      {      {
2028        $(AR) $(<) +-$(>)        $(AR) $(<) +-$(>)
2029      }      }
2030    
2031      actions Cc      actions Cc
2032      {      {
2033        $(CC) $(CCFLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)        $(CC) $(CCFLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)
2034      }      }
2035    
2036      actions C++      actions C++
2037      {      {
2038        $(C++) $(C++FLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)        $(C++) $(C++FLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)
2039      }      }
2040    
2041      actions Fortran      actions Fortran
2042      {      {
2043        $(FORTRAN) $(FORTRANFLAGS) /FO=$(<) $(>)        $(FORTRAN) $(FORTRANFLAGS) /FO=$(<) $(>)
2044      }      }
2045    
2046      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
2047      {      {
2048        $(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)        $(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
2049      }      }
2050    
2051      actions Shell      actions Shell
2052      {      {
2053        $(CP) $(>) $(<)        $(CP) $(>) $(<)
2054      }      }
2055    }    }
2056    else if $(TOOLSET) = LCC    else if $(TOOLSET) = LCC
2057    {    {
2058      actions together piecemeal Archive      actions together piecemeal Archive
2059      {      {
2060        $(AR) /out:$(<) $(>)        $(AR) /out:$(<) $(>)
2061      }      }
2062    
2063      actions Cc      actions Cc
2064      {      {
2065        $(CC) $(CCFLAGS) $(OPTIM) -Fo$(<) -I$(HDRS) $(>)        $(CC) $(CCFLAGS) $(OPTIM) -Fo$(<) -I$(HDRS) $(>)
2066      }      }
2067    
2068      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
2069      {      {
2070        $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)        $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
2071      }      }
2072    
2073      actions Shell      actions Shell
2074      {      {
2075        $(CP) $(>) $(<)        $(CP) $(>) $(<)
2076      }      }
2077    }    }
2078  }  }
2079    
2080  #  #
2081  # OS2 specific actions  # OS2 specific actions
2082  #  #
2083    
2084  else if $(OS2)              else if $(OS2)            
2085  {  {
2086    if $(TOOLSET) = WATCOM    if $(TOOLSET) = WATCOM
2087    {    {
2088      actions together piecemeal Archive      actions together piecemeal Archive
2089      {      {
2090      $(AR) $(<) +-$(>)      $(AR) $(<) +-$(>)
2091      }      }
2092    
2093      actions Cc      actions Cc
2094      {      {
2095      $(CC) $(CCFLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)      $(CC) $(CCFLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)
2096      }      }
2097    
2098      actions C++      actions C++
2099      {      {
2100      $(C++) $(C++FLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)      $(C++) $(C++FLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>)
2101      }      }
2102    
2103      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
2104      {      {
2105      $(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)      $(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS)
2106      }      }
2107    
2108      actions Shell      actions Shell
2109      {      {
2110      $(CP) $(>) $(<)      $(CP) $(>) $(<)
2111      }      }
2112    }    }
2113    else if $(TOOLSET) = EMX    else if $(TOOLSET) = EMX
2114    {    {
2115      actions together piecemeal Archive      actions together piecemeal Archive
2116      {      {
2117        $(AR) $(<) $(>:T)        $(AR) $(<) $(>:T)
2118      }      }
2119    
2120      actions Cc      actions Cc
2121      {      {
2122      $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)      $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
2123      }      }
2124    
2125      actions C++      actions C++
2126      {      {
2127      $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)      $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>)
2128      }      }
2129    }    }
2130  }  }
2131    
2132  #  #
2133  # VMS specific actions  # VMS specific actions
2134  #  #
2135    
2136  else if $(VMS)  else if $(VMS)
2137  {  {
2138      actions updated together piecemeal Archive      actions updated together piecemeal Archive
2139      {      {
2140      lib/replace $(<) $(>[1]) ,$(>[2-])      lib/replace $(<) $(>[1]) ,$(>[2-])
2141      }      }
2142    
2143      actions Cc      actions Cc
2144      {      {
2145      $(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>)      $(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>)
2146      }      }
2147    
2148      actions C++      actions C++
2149      {      {
2150      $(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>)      $(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>)
2151      }      }
2152    
2153      actions piecemeal together existing Clean      actions piecemeal together existing Clean
2154      {      {
2155      $(RM) $(>[1]);* ,$(>[2-]);*      $(RM) $(>[1]);* ,$(>[2-]);*
2156      }      }
2157    
2158      actions together quietly CreLib      actions together quietly CreLib
2159      {      {
2160      if f$search("$(<)") .eqs. "" then lib/create $(<)      if f$search("$(<)") .eqs. "" then lib/create $(<)
2161      }      }
2162    
2163      actions GenFile1      actions GenFile1
2164      {      {
2165      mcr $(>[1]) $(<) $(>[2-])      mcr $(>[1]) $(<) $(>[2-])
2166      }      }
2167    
2168      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
2169      {      {
2170      $(LINK)/exe=$(<) $(LINKFLAGS) $(>[1]) ,$(>[2-]) ,$(NEEDLIBS)/lib ,$(LINKLIBS)      $(LINK)/exe=$(<) $(LINKFLAGS) $(>[1]) ,$(>[2-]) ,$(NEEDLIBS)/lib ,$(LINKLIBS)
2171      }      }
2172    
2173      actions quietly updated piecemeal together RmTemps      actions quietly updated piecemeal together RmTemps
2174      {      {
2175      $(RM) $(>[1]);* ,$(>[2-]);*      $(RM) $(>[1]);* ,$(>[2-]);*
2176      }      }
2177    
2178      actions Shell      actions Shell
2179      {      {
2180      $(CP) $(>) $(<)      $(CP) $(>) $(<)
2181      }      }
2182  }  }
2183    
2184  #  #
2185  # Mac specific actions  # Mac specific actions
2186  #  #
2187    
2188  else if $(MAC)  else if $(MAC)
2189  {  {
2190      actions together Archive      actions together Archive
2191      {      {
2192      $(LINK) -library -o $(<) $(>)      $(LINK) -library -o $(<) $(>)
2193      }      }
2194    
2195      actions Cc      actions Cc
2196      {      {
2197      set -e MWCincludes $(MACINC)      set -e MWCincludes $(MACINC)
2198      $(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>)      $(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>)
2199      }      }
2200    
2201      actions C++      actions C++
2202      {      {
2203      set -e MWCincludes $(MACINC)      set -e MWCincludes $(MACINC)
2204      $(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>)      $(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>)
2205      }      }
2206    
2207      actions Link bind NEEDLIBS      actions Link bind NEEDLIBS
2208      {      {
2209      $(LINK) -o $(<) $(LINKFLAGS) $(>) $(NEEDLIBS) "$(LINKLIBS)"      $(LINK) -o $(<) $(LINKFLAGS) $(>) $(NEEDLIBS) "$(LINKLIBS)"
2210      }      }
2211  }  }
2212    
2213  #  #
2214  # Backwards compatibility with jam 1, where rules were uppercased.  # Backwards compatibility with jam 1, where rules were uppercased.
2215  #  #
2216    
2217  rule BULK { Bulk $(<) : $(>) ; }  rule BULK { Bulk $(<) : $(>) ; }
2218  rule FILE { File $(<) : $(>) ; }  rule FILE { File $(<) : $(>) ; }
2219  rule HDRRULE { HdrRule $(<) : $(>) ; }  rule HDRRULE { HdrRule $(<) : $(>) ; }
2220  rule INSTALL { Install $(<) : $(>) ; }  rule INSTALL { Install $(<) : $(>) ; }
2221  rule LIBRARY { Library $(<) : $(>) ; }  rule LIBRARY { Library $(<) : $(>) ; }
2222  rule LIBS { LinkLibraries $(<) : $(>) ; }  rule LIBS { LinkLibraries $(<) : $(>) ; }
2223  rule LINK { Link $(<) : $(>) ; }  rule LINK { Link $(<) : $(>) ; }
2224  rule MAIN { Main $(<) : $(>) ; }  rule MAIN { Main $(<) : $(>) ; }
2225  rule SETUID { Setuid $(<) ; }  rule SETUID { Setuid $(<) ; }
2226  rule SHELL { Shell $(<) : $(>) ; }  rule SHELL { Shell $(<) : $(>) ; }
2227  rule UNDEFINES { Undefines $(<) : $(>) ; }  rule UNDEFINES { Undefines $(<) : $(>) ; }
2228    
2229  # Old INSTALL* didn't take dest directory.  # Old INSTALL* didn't take dest directory.
2230    
2231  rule INSTALLBIN { InstallBin $(BINDIR) : $(<) ; }  rule INSTALLBIN { InstallBin $(BINDIR) : $(<) ; }
2232  rule INSTALLLIB { InstallLib $(LIBDIR) : $(<) ; }  rule INSTALLLIB { InstallLib $(LIBDIR) : $(<) ; }
2233  rule INSTALLMAN { InstallMan $(MANDIR) : $(<) ; }  rule INSTALLMAN { InstallMan $(MANDIR) : $(<) ; }
2234    
2235  # Compatibility with jam 2.2.  # Compatibility with jam 2.2.
2236    
2237  rule addDirName { $(<) += [ FDirName $(>) ] ; }  rule addDirName { $(<) += [ FDirName $(>) ] ; }
2238  rule makeDirName { $(<) = [ FDirName $(>) ] ; }  rule makeDirName { $(<) = [ FDirName $(>) ] ; }
2239  rule makeGristedName { $(<) = [ FGristSourceFiles $(>) ] ; }  rule makeGristedName { $(<) = [ FGristSourceFiles $(>) ] ; }
2240  rule makeRelPath { $(<[1]) = [ FRelPath $(<[2-]) : $(>) ] ; }  rule makeRelPath { $(<[1]) = [ FRelPath $(<[2-]) : $(>) ] ; }
2241  rule makeSuffixed { $(<[1]) = [ FAppendSuffix $(>) : $(<[2]) ] ; }  rule makeSuffixed { $(<[1]) = [ FAppendSuffix $(>) : $(<[2]) ] ; }
2242    
2243  #  #
2244  # Now include the user's Jamfile.  # Now include the user's Jamfile.
2245  #  #
2246    
2247  {  {
2248      if $(JAMFILE) { include $(JAMFILE) ; }      if $(JAMFILE) { include $(JAMFILE) ; }
2249  }  }

Legend:
Removed from v.59  
changed lines
  Added in v.60

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22