📄 jambase
字号:
# This handles the following cases: # a -> [.a] # a b c -> [.a.b.c] # x: -> x: # x: a -> x:[a] # x:[a] b -> x:[a.b] switch $(<[1]) { case *:* : _s = $(<[1]) ; case \\[*\\] : _s = $(<[1]) ; case * : _s = [.$(<[1])] ; } for _i in [.$(<[2-])] { _s = $(_i:R=$(_s)) ; } } else if $(MAC) { _s = $(DOT) ; for _i in $(<) { _s = $(_i:R=$(_s)) ; } } else { _s = $(<[1]) ; for _i in $(<[2-]) { _s = $(_i:R=$(_s)) ; } } return $(_s) ;}rule _makeCommon{ # strip common initial elements if $($(<)[1]) && $($(<)[1]) = $($(>)[1]) { $(<) = $($(<)[2-]) ; $(>) = $($(>)[2-]) ; _makeCommon $(<) : $(>) ; }}rule FRelPath{ local _l _r ; # first strip off common parts _l = $(<) ; _r = $(>) ; _makeCommon _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 $(<) ; }}rule unmakeDir{ if $(>[1]:D) && $(>[1]:D) != $(>[1]) && $(>[1]:D) != \\\\ { unmakeDir $(<) : $(>[1]:D) $(>[1]:BS) $(>[2-]) ; } else { $(<) = $(>) ; }}rule FConvertToSlashes{ local _d, _s, _i ; unmakeDir _d : $(<) ; _s = $(_d[1]) ; for _i in $(_d[2-]) { _s = $(_s)/$(_i) ; } return $(_s) ;}## Actions### First the defaults#actions updated together piecemeal Archive{ $(AR) $(<) $(>)}actions As{ $(AS) $(ASFLAGS) -I$(HDRS) -o $(<) $(>)}actions C++{ $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)}actions Cc{ $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o $(<) $(>)}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 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) $(OPTIM) -I$(HDRS) $(>) } actions Cc { $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) $(>) } actions ignore CcMv { [ $(<) != $(>:BS=$(SUFOBJ)) ] && $(MV) $(>:BS=$(SUFOBJ)) $(<) }}## NOARUPDATE - can't update an archive#if $(NOARUPDATE){ actions Archive { $(AR) $(<) $(>) }}## NT specific actions#if $(NT){ if $(TOOLSET) = VISUALC || $(TOOLSET) = VC7 || $(TOOLSET) = INTELC { 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 $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) $(>) } actions C++ { $(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /I$(STDHDRS) /Tp$(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) } } else if $(TOOLSET) = VISUALC16 { actions updated together piecemeal Archive { $(AR) $(<) -+$(>) } actions Cc { $(CC) /c $(CCFLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) $(>) } actions C++ { $(C++) /c $(C++FLAGS) $(OPTIM) /Fo$(<) /I$(HDRS) /Tp$(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) /out:$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) } } else if $(TOOLSET) = BORLANDC { actions updated together piecemeal Archive { $(AR) $(<) -+$(>) } actions Link bind NEEDLIBS { $(LINK) -e$(<) $(LINKFLAGS) $(UNDEFS) -L$(LINKLIBS) $(NEEDLIBS) $(>) } actions C++ { $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>) } actions Cc { $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>) } } else if $(TOOLSET) = MINGW { actions together piecemeal Archive { $(AR) $(<) $(>:T) } actions Cc { $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>) } actions C++ { $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>) } } else if $(TOOLSET) = WATCOM { actions together piecemeal Archive { $(AR) $(<) +-$(>) } actions Cc { $(CC) $(CCFLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>) } actions C++ { $(C++) $(C++FLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) } actions Shell { $(CP) $(>) $(<) } } else if $(TOOLSET) = LCC { actions together piecemeal Archive { $(AR) /out:$(<) $(>) } actions Cc { $(CC) $(CCFLAGS) $(OPTIM) -Fo$(<) -I$(HDRS) $(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) } actions Shell { $(CP) $(>) $(<) } }}## OS2 specific actions#else if $(OS2) { if $(TOOLSET) = WATCOM { actions together piecemeal Archive { $(AR) $(<) +-$(>) } actions Cc { $(CC) $(CCFLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>) } actions C++ { $(C++) $(C++FLAGS) $(OPTIM) /Fo=$(<) /I$(HDRS) $(>) } actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) /Fe=$(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) } actions Shell { $(CP) $(>) $(<) } } else if $(TOOLSET) = EMX { actions together piecemeal Archive { $(AR) $(<) $(>:T) } actions Cc { $(CC) -c $(CCFLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>) } actions C++ { $(C++) -c $(C++FLAGS) $(OPTIM) -I$(HDRS) -o$(<) $(>) } }}## VMS specific actions#else if $(VMS){ actions updated together piecemeal Archive { lib/replace $(<) $(>[1]) ,$(>[2-]) } actions Cc { $(CC)/obj=$(<) $(CCFLAGS) $(OPTIM) $(SLASHINC) $(>) } actions C++ { $(C++)/obj=$(<) $(C++FLAGS) $(OPTIM) $(SLASHINC) $(>) } 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) $(>[1]) ,$(>[2-]) ,$(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 $(MACINC) $(CC) -o $(<) $(CCFLAGS) $(OPTIM) $(>) } actions C++ { set -e MWCincludes $(MACINC) $(CC) -o $(<) $(C++FLAGS) $(OPTIM) $(>) } actions Link bind NEEDLIBS { $(LINK) -o $(<) $(LINKFLAGS) $(>) $(NEEDLIBS) "$(LINKLIBS)" }}## 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 makeDirName { $(<) = [ FDirName $(>) ] ; }rule makeGristedName { $(<) = [ FGristSourceFiles $(>) ] ; }rule makeRelPath { $(<[1]) = [ FRelPath $(<[2-]) : $(>) ] ; }rule makeSuffixed { $(<[1]) = [ FAppendSuffix $(>) : $(<[2]) ] ; }## Now include the user's Jamfile.#{ if $(JAMFILE) { include $(JAMFILE) ; }}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -