📄 jambase
字号:
rule SubRules{ # SubRules TOP d1 ... : Other-TOP ; # # Read another tree's Jamrules, by giving it's path according # to this tree and it's own name. if ! $($(<[1])) { Exit SubRules $(<[1]) without prior SubDir $(<[1]) ; } SubDir $(<) ; SubDir $(>) ;}rule Undefines{ UNDEFS on [ FAppendSuffix $(<) : $(SUFEXE) ] += $(UNDEFFLAG)$(>) ;}rule UserObject{ Exit "Unknown suffix on" $(>) "- see UserObject rule in Jamfile(5)." ;}rule Yacc{ local _h ; _h = $(<:BS=.h) ; # Some places don't have a yacc. MakeLocate $(<) $(_h) : $(LOCATE_SOURCE) ; if $(YACC) { Depends $(<) $(_h) : $(>) ; Yacc1 $(<) $(_h) : $(>) ; YaccMv $(<) $(_h) : $(>) ; Clean clean : $(<) $(_h) ; } # make sure someone includes $(_h) else it will be # a deadly independent target Includes $(<) : $(_h) ;}## Utility rules; no side effects on these#rule FGrist{ return $(<:J=!) ;}rule FGristFiles { return $(<:G=$(SOURCE_GRIST:E)) ;}rule FGristSourceFiles{ # Produce source file name name with grist in it, # if SOURCE_GRIST is set. # Leave header files alone, because they have a global # visibility. if ! $(SOURCE_GRIST) { return $(<) ; } else { local _i _o ; for _i in $(<) { switch $(_i) { case *.h : _o += $(_i) ; case * : _o += $(_i:G=$(SOURCE_GRIST)) ; } } return $(_o) ; }}rule FReverse { # FReverse a1 a2 a3 ... ; # return ... a3 a2 a1 ; if $(1) { return [ FReverse $(1[2-]) ] $(1[1]) ; }}rule FSubDir{ # If $(>) is the path to the current directory, compute the # path (using ../../ etc) back to that root directory. # Sets result in $(<) if ! $(<[1]) { return $(DOT) ; } else { local _i _d ; _d = $(DOTDOT) ; for _i in $(<[2-]) { _d = $(_d:R=$(DOTDOT)) ; } return $(_d) ; }}rule FStripCommon{ # FStripCommon v1 : v2 ; # Strip common initial elements of variables v1 and v2. # Modifies the variable values themselves. if $($(<)[1]) && $($(<)[1]) = $($(>)[1]) { $(<) = $($(<)[2-]) ; $(>) = $($(>)[2-]) ; FStripCommon $(<) : $(>) ; }}rule FRelPath{ local _l _r ; # first strip off common parts _l = $(<) ; _r = $(>) ; FStripCommon _l : _r ; # now make path to root and path down _l = [ FSubDir $(_l) ] ; _r = [ FDirName $(_r) ] ; # Concatenate and save # XXX This should be better if $(_r) = $(DOT) { return $(_l) ; } else { return $(_r:R=$(_l)) ; }}rule FAppendSuffix{ # E.g., "FAppendSuffix yacc lex foo.bat : $(SUFEXE) ;" # returns (yacc,lex,foo.bat) on Unix and # (yacc.exe,lex.exe,foo.bat) on NT. if $(>) { local _i _o ; for _i in $(<) { if $(_i:S) { _o += $(_i) ; } else { _o += $(_i:S=$(>)) ; } } return $(_o) ; } else { return $(<) ; }}## Operating system specific utility rules# First, the (generic) UNIX versions#rule FQuote { return \\\"$(<)\\\" ; }rule FDefines { return -D$(<) ; }rule FIncludes { return -I$(<) ; }rule FDirName{ # Turn individual elements in $(<) into a usable path. local _i ; local _s = $(DOT) ; for _i in $(<) { _s = $(_i:R=$(_s)) ; } return $(_s) ;}if $(OS2){ rule FQuote { return \"$(<)\" ; } rule FIncludes { return /I$(<) ; }}else if $(NT){ rule FDefines { return /D$(<) ; } rule FIncludes { return /I$(<) ; }}else if $(MAC){ rule FQuote { return \"$(<)\" ; } rule FDefines { return "-define '$(<)'" ; } rule FIncludes { return \"$(<:J=,)\" ; }}else if $(VMS){ rule FQuote { return \"\"\"$(<)\"\"\" ; } rule FDefines { return "/define=( $(<:J=,) )" ; } rule FIncludes { return "/inc=( $(<:J=,) )" ; } rule FDirName { local _s _i ; # Turn individual elements in $(<) into a usable path. if ! $(<) { _s = $(DOT) ; } else { # This handles the following cases: # a -> [.a] # a b c -> [.a.b.c] # x: -> x: # x: a -> x:[a] # x:[a] b -> x:[a.b] switch $(<[1]) { case *:* : _s = $(<[1]) ; case \\[*\\] : _s = $(<[1]) ; case * : _s = [.$(<[1])] ; } for _i in [.$(<[2-])] { _s = $(_i:R=$(_s)) ; } } return $(_s) ; }}## Actions### First the defaults#actions updated together piecemeal Archive{ $(AR) $(<) $(>)}actions As{ $(AS) $(ASFLAGS) $(ASHDRS) -o $(<) $(>)}actions C++{ $(C++) -c -o $(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>)}actions Cc{ $(CC) -c -o $(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>)}actions Chgrp{ $(CHGRP) $(GROUP) $(<)}actions Chmod1{ $(CHMOD) $(MODE) $(<)}actions Chown{ $(CHOWN) $(OWNER) $(<)}actions piecemeal together existing Clean{ $(RM) $(>)}actions File{ $(CP) $(>) $(<)}actions GenFile1{ $(>[1]) $(<) $(>[2-])}actions Fortran{ $(FORTRAN) $(FORTRANFLAGS) -o $(<) $(>)}actions HardLink{ $(RM) $(<) && $(LN) $(>) $(<)}actions Install{ $(CP) $(>) $(<) }actions Lex{ $(LEX) $(>)}actions LexMv{ $(MV) lex.yy.c $(<)}actions Link bind NEEDLIBS{ $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) }actions MkDir1{ $(MKDIR) $(<)}actions together Ranlib{ $(RANLIB) $(<)}actions quietly updated piecemeal together RmTemps{ $(RM) $(>)}actions Shell{ $(AWK) ' NR == 1 { print "$(SHELLHEADER)" } NR == 1 && /^[#:]/ { next } /^##/ { next } { print } ' < $(>) > $(<)}actions SoftLink{ $(RM) $(<) && $(LN) -s $(>) $(<)}actions Yacc1{ $(YACC) $(YACCFLAGS) $(>)}actions YaccMv{ $(MV) $(YACCFILES).c $(<[1]) $(MV) $(YACCFILES).h $(<[2])}## RELOCATE - for compilers with broken -o flags#if $(RELOCATE){ actions C++ { $(C++) -c $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions Cc { $(CC) -c $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions ignore CcMv { [ $(<) != $(>:BS=$(SUFOBJ)) ] && $(MV) $(>:BS=$(SUFOBJ)) $(<) }}## NOARUPDATE - can't update an archive#if $(NOARUPDATE){ actions Archive { $(AR) $(<) $(>) }}## UNIX specific actions#if $(UNIX){ actions GenFile1 { PATH="$PATH:." $(>[1]) $(<) $(>[2-]) }}## NT specific actions#if $(NT) && $(MSVCNT){ actions updated together piecemeal Archive { if exist $(<) set _$(<:B)_=$(<) $(AR) /out:$(<) %_$(<:B)_% $(>) } actions As { $(AS) /Ml /p /v /w2 $(>) $(<) ,nul,nul; } actions Cc { $(CC) /c /Fo$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) /I$(STDHDRS) $(>) } actions C++ { $(C++) /c /Fo$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) /I$(STDHDRS) /Tp$(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) }}else if $(NT) && $(MSVC){ actions updated together piecemeal Archive { $(AR) $(<) -+$(>) } actions Cc { $(CC) /c /Fo$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions C++ { $(C++) /c /Fo$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) /Tp$(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) }}else if $(NT) && $(BCCROOT){ actions updated together piecemeal Archive { $(AR) $(<) -+$(>) } actions Link bind NEEDLIBS { $(LINK) -e$(<) $(LINKFLAGS) $(UNDEFS) -L$(LINKLIBS) $(NEEDLIBS) $(>) } actions C++ { $(C++) -c -o$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions Cc { $(CC) -c -o$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>) }}## OS2 specific actions#else if $(OS2) && $(WATCOM){ actions together piecemeal Archive { $(AR) $(<) +-$(>) } actions Cc { $(CC) /Fo=$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions C++ { $(C++) /Fo=$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) } actions Shell { $(CP) $(>) $(<) }}## VMS specific actions#else if $(VMS){ actions updated together piecemeal Archive { lib/replace $(<) $(>[1]) ,$(>[2-]) } actions Cc { $(CC)/obj=$(<) $(CCFLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions C++ { $(C++)/obj=$(<) $(C++FLAGS) $(CCDEFS) $(CCHDRS) $(>) } actions piecemeal together existing Clean { $(RM) $(>[1]);* ,$(>[2-]);* } actions together quietly CreLib { if f$search("$(<)") .eqs. "" then lib/create $(<) } actions GenFile1 { mcr $(>[1]) $(<) $(>[2-]) } actions Link bind NEEDLIBS { $(LINK)/exe=$(<) $(LINKFLAGS) $(>:J=,) ,$(NEEDLIBS)/lib ,$(LINKLIBS) } actions quietly updated piecemeal together RmTemps { $(RM) $(>[1]);* ,$(>[2-]);* } actions Shell { $(CP) $(>) $(<) }}## Mac specifc actions#else if $(MAC){ actions together Archive { $(LINK) -library -o $(<) $(>) } actions Cc { set -e MWCincludes $(CCHDRS) $(CC) -o $(<) $(CCFLAGS) $(CCDEFS) $(>) } actions C++ { set -e MWCincludes $(CCHDRS) $(CC) -o $(<) $(C++FLAGS) $(CCDEFS) $(>) } actions Link bind NEEDLIBS { $(LINK) -o $(<) $(LINKFLAGS) $(>) $(NEEDLIBS) "$(LINKLIBS)" }}if $(WIN98){ actions existing Clean { del $(>) }}## Backwards compatibility with jam 1, where rules were uppercased.#rule BULK { Bulk $(<) : $(>) ; }rule FILE { File $(<) : $(>) ; }rule HDRRULE { HdrRule $(<) : $(>) ; }rule INSTALL { Install $(<) : $(>) ; }rule LIBRARY { Library $(<) : $(>) ; }rule LIBS { LinkLibraries $(<) : $(>) ; }rule LINK { Link $(<) : $(>) ; }rule MAIN { Main $(<) : $(>) ; }rule SETUID { Setuid $(<) ; }rule SHELL { Shell $(<) : $(>) ; }rule UNDEFINES { Undefines $(<) : $(>) ; }# Old INSTALL* didn't take dest directory.rule INSTALLBIN { InstallBin $(BINDIR) : $(<) ; }rule INSTALLLIB { InstallLib $(LIBDIR) : $(<) ; }rule INSTALLMAN { InstallMan $(MANDIR) : $(<) ; }# Compatibility with jam 2.2.rule addDirName { $(<) += [ FDirName $(>) ] ; }rule makeCommon { FStripCommon $(<) : $(>) ; }rule _makeCommon { FStripCommon $(<) : $(>) ; }rule makeDirName { $(<) = [ FDirName $(>) ] ; }rule makeGrist { $(<) = [ FGrist $(>) ] ; }rule makeGristedName { $(<) = [ FGristSourceFiles $(>) ] ; }rule makeRelPath { $(<[1]) = [ FRelPath $(<[2-]) : $(>) ] ; }rule makeString { $(<) = $(>:J) ; }rule makeSubDir { $(<) = [ FSubDir $(>) ] ; }rule makeSuffixed { $(<[1]) = [ FAppendSuffix $(>) : $(<[2]) ] ; }## Now include the user's Jamfile.#include $(JAMFILE) ;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -