⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 allyourbase.jam

📁 C++的一个好库。。。现在很流行
💻 JAM
📖 第 1 页 / 共 4 页
字号:
#
# /+\
# +\    Copyright 1993, 2000 Christopher Seiwald.
# \+/
#
# This file is part of Jam - see jam.c for Copyright information.
#

# This file is ALSO:
# (C) Copyright David Abrahams 2001.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)

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

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

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


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

# Initialize variables
#

#
# OS specific variable settings
#

# dwa 6/4/01 - removed all settings of the following variables for boost:
#   CC, CCFLAGS, C++, C++FLAGS, LINK, LINKFLAGS, LINKLIBS
# probably a lot more could be cleared away

if $(NT)
{
    CP              ?= copy ;
    RM              ?= del /f/q ;
    SLASH           ?= \\ ;
    SPLITPATH       ?= ";" ; # dwa -- added missing SPLITPATH
    SUFLIB          ?= .lib ;
    SUFOBJ          ?= .obj ;
    SUFEXE          ?= .exe ;
    SUFDLL          ?= .dll .lib ;
    gLINK_VARIABLE(.dll) = ;             # dlls are NOT linked to directly
    gLINK_VARIABLE(.lib) = NEEDLIBS ;    # instead, users link to import libs
    PREDLL          ?= "" ;
    NOARSCAN        ?= true ;
    SHELL_EXPORT    ?= ;
    SHELL_SET       ?= "set " ;
    
    # dwa 6/4/01 - removed compiler determination for boost
    # added some yacc/lex stuff, assuming cygwin for now.
    LEX             ?= flex ;
    YACC            ?= bison -y ;
    YACCFILES       ?= y.tab ;
    YACC_OUTPUT     ?= --output= ;
    LEX_OUTPUT      ?= -o ;
    
    LN              ?= $(CP) ;
    NULL_OUT        ?= >NUL: ;
}
else if $(OS2)
{
    WATCOM          ?= $(watcom) ;

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

    AR              ?= wlib ;
    BINDIR          ?= \\os2\\apps ;
    CP              ?= copy ;
    DOT             ?= . ;
    DOTDOT          ?= .. ;
    MV              ?= move ;
    NOARSCAN        ?= true ;
    OPTIM           ?= ;
    RM              ?= del /f ;
    SLASH           ?= \\ ;
    SPLITPATH       ?= ";" ; # dwa -- added missing SPLITPATH
    STDHDRS         ?= $(WATCOM)\\h ;
    SUFEXE          ?= .exe ;
    SUFLIB          ?= .lib ;
    SUFOBJ          ?= .obj ;
    UNDEFFLAG       ?= "/u _" ;

}
else if $(VMS)
{
    CHMOD           ?= set file/prot= ;
    CP              ?= copy/replace ;
    CRELIB          ?= true ;
    DOT             ?= [] ;
    DOTDOT          ?= [-] ;
    EXEMODE         ?= (w:e) ;
    FILEMODE        ?= (w:r) ;
    HDRS            ?= ;
    MKDIR           ?= create/dir ;
    MV              ?= rename ;
    OPTIM           ?= "" ;
    RM              ?= delete ;
    RUNVMS          ?= mcr ;
    SHELLMODE       ?= (w:er) ;
    SLASH           ?= . ;
    STDHDRS         ?= decc$library_include ;
    SUFEXE          ?= .exe ;
    SUFLIB          ?= .olb ;
    SUFOBJ          ?= .obj ;

    switch $(OS) 
    {
    case VMS     : LINKLIBS ?= sys$library:vaxcrtl.olb/lib ;
    }
}
else if $(MAC)
{
    local OPT ;

    CW      ?= "{CW}" ;

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

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

    MPWLIBS ?= 
            "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
            "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW.Lib" ;

    MPWNLLIBS ?= 
            "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL MPWCRuntime.lib"
            "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC MPW(NL).Lib" ;

    SIOUXHDRS ?= ;

    SIOUXLIBS ?= 
            "$(CW):MacOS Support:Libraries:Runtime:Runtime PPC:MSL RuntimePPC.lib"
            "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL SIOUX.PPC.Lib" 
            "$(CW):MSL:MSL_C:MSL_MacOS:Lib:PPC:MSL C.PPC.Lib" ;

    CP              ?= duplicate -y ;
    DOT             ?= ":" ;
    DOTDOT          ?= "::" ;
    HDRS            ?= $(MACHDRS) $(MPWHDRS) ;
    MKDIR           ?= newfolder ;
    MV              ?= rename -y ;
    NOARSCAN        ?= true ;
    OPTIM           ?= ;
    RM              ?= delete -y ;
    SLASH           ?= ":" ;
    STDHDRS         ?= ; 
    SUFLIB          ?= .lib ;
    SUFOBJ          ?= .o ;
}
else if $(OS) = BEOS && $(METROWERKS)
{
    AR              ?= mwld -xml -o ;
    BINDIR          ?= /boot/apps ;
    FORTRAN         ?= "" ;
    LIBDIR          ?= /boot/develop/libraries ;
    MANDIR          ?= /boot/documentation/"Shell Tools"/HTML ;
    NOARSCAN        ?= true ;
    STDHDRS         ?= /boot/develop/headers/posix ;
}
else if $(OS) = BEOS 
{
    BINDIR          ?= /boot/apps ;
    FORTRAN         ?= "" ;
    LIBDIR          ?= /boot/develop/libraries ;
    NOARSCAN        ?= true ;
    STDHDRS         ?= /boot/develop/headers/posix ;
}
else if $(UNIX)
{
    switch $(OS)
    {
    case AIX :
        IMPLIB_FLAGS    ?= -bI: ;
        SUFDLL          ?= .so ;
        gLINK_VARIABLE(.so) = NEEDLIBS ;  # shared libs should be added to the list of libs needed
        gLINK_VARIABLE(.imp) = NEEDIMPS ; # import libs are handled separately.
        gSHELL_LIBPATH = LIBPATH ;
        
    case AMIGA :
        YACC            ?= bison -y ;

    case CYGWIN :       
        LEX             ?= flex ;
        RANLIB          ?= "" ;
        SUFEXE          ?= .exe ;
        YACC            ?= bison -y ;
        MKDIR           ?= mkdir -p ;
        SUFDLL          ?= .dll ;

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

    case HPUX :
        RANLIB          ?= "" ;

    case INTERIX :
        RANLIB          ?= "" ;

    case IRIX :
        RANLIB          ?= "" ;

    case KFREEBSD :
        CLONE           ?= cp -fpd ;

    case LINUX :
        CLONE           ?= cp -fpd ;

    case MPEIX :
        HDRS            += /usr/include ;
        RANLIB          ?= "" ; 
        NOARSCAN        ?= true ;
        NOARUPDATE      ?= true ;

    case MVS :
        RANLIB          ?= "" ; 

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

    case MACOSX :
        MANDIR          ?= /usr/local/share/man ;
        SUFDLL          ?= .dylib ;
        gSHELL_LIBPATH  ?= DYLD_LIBRARY_PATH ;
        NOARSCAN        ?= true ;

    case NCR :
        RANLIB          ?= "" ;

    case PTX :
        RANLIB          ?= "" ;

    case QNX :
        AR              ?= wlib ;
        NOARSCAN        ?= true ;
        RANLIB          ?= "" ;

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

    case SINIX :
        RANLIB          ?= "" ;

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

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

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

    case OSF :
        gLINK_VARIABLE(.so) = NEEDLIBS ; # shared objects should be added to the list of libs needed
    }

    # UNIX defaults
    CHMOD           ?= chmod ;
    LEX             ?= lex ;
    OPTIM           ?= -O ;
    RANLIB          ?= ranlib ;
    YACC            ?= yacc ;
    YACCFILES       ?= y.tab ;
    YACCFLAGS       ?= -d ;
    SHELL_EXPORT    ?= "export " ;
    SHELL_SET       ?= "" ;
    gSHELL_LIBPATH  ?= LD_LIBRARY_PATH ;
    BINDIR          ?= /usr/local/bin ;
    LIBDIR          ?= /usr/local/lib ;
    MANDIR          ?= /usr/local/man ;
    STDHDRS         ?= /usr/include ;
}
    
#
# General defaults; a lot like UNIX
#

AR              ?= ar ru ;
AS              ?= as ;
ASFLAGS         ?= ;
AWK             ?= awk ;
BINDIR          ?= ;
CLONE           ?= $(CP) ;
CLONE           ?= cp -fp ;
CP              ?= cp -f ;
CRELIB          ?= ;
DOT             ?= . ;
DOTDOT          ?= .. ;
EXEMODE         ?= 711 ;
DLLMODE         ?= 755 ;
FILEMODE        ?= 644 ;
FORTRAN         ?= f77 ;
FORTRANFLAGS    ?= ;
HDRS            ?= ;
JAMFILE         ?= Jamfile ;
JAMRULES        ?= Jamrules ;
LEX             ?= ;
LIBDIR          ?= ;
LN              ?= ln ;
MANDIR          ?= ;
MKDIR           ?= mkdir ;
MV              ?= mv -f ;
OPTIM           ?= ;
RCP             ?= rcp ;
RM              ?= rm -f ;
RSH             ?= rsh ;
SED             ?= sed ;
SHELLHEADER     ?= "#!/bin/sh" ;
SHELLMODE       ?= 755 ;
SHELL_EXPORT    ?= ;
SHELL_SET       ?= "" ;
SLASH           ?= / ;
SPLITPATH       ?= ":" ; # dwa -- added missing SPLITPATH
STDHDRS         ?= ;
SUFEXE          ?= "" ;
SUFDLL          ?= .so ;
SUFLIB          ?= .a ;
SUFOBJ          ?= .o ;
PREDLL          ?= lib ;
PRELIB          ?= lib ;
UNDEFFLAG       ?= "-u _" ;
YACC            ?= ;
YACCFILES       ?= ;
YACCFLAGS       ?= ;
BIN_DIRECTORY   ?= bin ;

#~ HDRPATTERN = 
        #~ "^[     ]*#[    ]*include[      ]*([<\"][^\">]*[\">]).*$" ;
HDRPATTERN = 
        "^[ 	]*#[ 	]*include[ 	]*([<\"][^\">]*[\">]).*$" ;
          
#" My Jam mode gets its syntax highlighting confused without this comment

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

#
# Rule to automate patching of singleton variables from the user so that
# they are correctly interpreted as a single entry instead of as a list if
# they happen to contain spaces.
#
# This also remembers the first(global) value so that it can be reset
# when cleared, but used again.
#
rule set-as-singleton ( variables + )
{
    for local variable in $(variables)
    {
        $(variable) = $($(variable):J=" ") ;
        #~ if ! $(gSINGLETON_SET($(variable)))
        #~ {
            #~ gSINGLETON($(variable)) = $($(variable)) ;
            #~ gSINGLETON_SET($(variable)) = true ;
        #~ }
        #~ $(variable) ?= $(gSINGLETON($(variable))) ;
    }
}

#
# "Fix" the known possibly directory variables.
#
set-as-singleton
    BINDIR
    CW
    JAMFILE
    JAMRULES
    JAMSHELL
    LIBDIR
    MANDIR
    WATCOM
    ;

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

# dwa 6/17/01 - added test
DEPENDS all : shell files lib dll exe obj ;
DEPENDS all shell files lib dll exe obj test : first ;
NOTFILE all first shell files lib dll exe obj dirs clean uninstall test nothing ;
ALWAYS clean uninstall ;

#
# Prevent external variables from interfeering with some esnetial intenal
# variables.
#
TOP = ;

#
# Rules
#

# dwa 6/4/01 - added for boost
# type-DEPENDS type : targets...
#
# Use this to create a dependency between a fake type-target and other targets. Will prevent
# targets in dependee subprojects from being added to the type-target's dependencies.
rule type-DEPENDS # type-target : targets...
{
    if ! $(gSUPPRESS_FAKE_TARGETS) && ! $(gIN_LIB_INCLUDE)
    {
        DEPENDS $(<) : $(>) ;
    }
}

# dwa 6/4/01 - added for boost
# Archive file-target : sources
#
# Used to dispatch through Archive-action, which should be redefined in toolset

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -