📄 build.jam
字号:
local o = $(s:S=.o) ;
LOCATE on $(o) = $(locate-target) ;
DEPENDS $(exe) : $(o) ;
DEPENDS $(o) : $(s) ;
DEPENDS $(o) : $(locate-target) ;
.cc. $(o) : $(s) ;
.clean $(o) ;
}
DEPENDS $(exe) : $(>:S=.o) ;
DEPENDS $(exe) : $(locate-target) ;
.ld. $(exe) : $(>:S=.o) ;
.clean $(exe) ;
}
else
{
DEPENDS $(exe) : $(>) ;
DEPENDS $(exe) : $(locate-target) ;
.cc. $(exe) : $(>) ;
.clean $(exe) ;
}
return $(exe) ;
}
if ! $(--def[2]) { actions .cc. {
$(--cc) $(--bin)$(<:D=) $(--dir)$(<:D) $(--out)$(<) $(--def)$(--defs) $(--flags) "$(--libs)" $(>)
} }
else { actions .cc. {
$(--cc) $(--bin)$(<:D=) $(--dir)$(<:D) $(--out)$(<) $(--def[1])$(--defs:J=$(--def[2]))$(--def[3]) $(--flags) "$(--libs)" $(>)
} }
if $(VMS) { actions .ld. {
$(--link) $(--link-bin)$(<:D=) $(--link-dir)$(<:D) $(--link-out)$(<) $(--link-def)$(--link-defs) $(--link-flags) "$(--link-libs)" $(>J=", ")
} }
else { actions .ld. {
$(--link) $(--link-bin)$(<:D=) $(--link-dir)$(<:D) $(--link-out)$(<) $(--link-def)$(--link-defs) $(--link-flags) "$(--link-libs)" $(>)
} }
rule .link
{
DEPENDS all : $(<) ;
DEPENDS $(<) : $(>) ;
.link. $(<) : $(>) ;
.clean $(<) ;
}
if $(NT) { actions .link. {
copy $(>) $(<)
} }
if $(UNIX) { actions .link. {
ln -f $(>) $(<)
} }
if $(VMS) { actions .link. {
COPY/REPLACE $(>) $(<)
} }
rule .move
{
DEPENDS $(<) : $(>) ;
.move. $(<) : $(>) ;
}
if $(NT) { actions .move. {
del /f $(<)
rename $(>) $(<)
} }
if $(UNIX) { actions .move. {
mv -f $(>) $(<)
} }
if $(VMS) { actions .move. {
RENAME $(>) $(<)
} }
# Generate the grammar tokens table, and the real yacc grammar.
rule .yyacc
{
local exe = [ .exe yyacc : yyacc.c ] ;
NOUPDATE $(exe) ;
DEPENDS $(<) : $(exe) $(>) ;
LEAVES $(<) ;
yyacc.exe on $(<) = $(exe:R=$(locate-target)) ;
.yyacc. $(<) : $(>) ;
}
actions .yyacc. {
$(--chmod+w)$(<[1])
$(--chmod+w)$(<[2])
$(yyacc.exe) $(<) $(>)
}
if $(grammar)
{
.yyacc jamgram.y jamgramtab.h : jamgram.yy ;
}
else
{
.exe yyacc : yyacc.c ;
}
# How to build the grammar.
if $(NT)
{
SUFEXE = .exe ;
# try some other likely spellings...
PATH ?= $(Path) ;
PATH ?= $(path) ;
}
SUFEXE ?= "" ;
yacc ?= [ GLOB $(PATH) : yacc$(SUFEXE) ] ;
yacc ?= [ GLOB $(PATH) : bison$(SUFEXE) ] ;
yacc ?= [ GLOB "$(ProgramFiles:J= )\\GnuWin32\\bin" "C:\\Program Files\\GnuWin32\\bin" : bison$(SUFEXE) ] ;
yacc = $(yacc[1]) ;
switch $(yacc:D=:S=)
{
case bison : yacc += -d --yacc ;
case yacc : yacc += -d ;
}
if $(debug) && $(yacc)
{
yacc += -t -v ;
}
yacc += $(YACCFLAGS) ;
rule .yacc
{
DEPENDS $(<) : $(>) ;
LEAVES $(<) ;
.yacc. $(<) : $(>) ;
}
if $(NT) { actions .yacc. {
"$(yacc)" $(>)
if not errorlevel 1 (
del /f $(<[1])
rename y.tab$(<[1]:S) $(<[1])
del /f $(<[2])
rename y.tab$(<[2]:S) $(<[2])
) else set _error_ =
} }
if $(UNIX) { actions .yacc. {
if ` "$(yacc)" $(>) ` ; then
mv -f y.tab$(<[1]:S) $(<[1])
mv -f y.tab$(<[2]:S) $(<[2])
else
exit 1
fi
} }
if $(VMS) { actions .yacc. {
IF "$(yacc)" $(>)
THEN
RENAME y_tab$(<[1]:S) $(<[1])
RENAME y_tab$(<[2]:S) $(<[2])
ENDIF
} }
if $(grammar) && ! $(yacc)
{
EXIT "Could not find the 'yacc' tool, and therefore can not build the grammar." ;
}
if $(grammar) && $(yacc)
{
.yacc jamgram.c jamgram.h : jamgram.y ;
}
# How to build the compiled in jambase.
rule .mkjambase
{
local exe = [ .exe mkjambase : mkjambase.c ] ;
DEPENDS $(<) : $(exe) $(>) ;
LEAVES $(<) ;
mkjambase.exe on $(<) = $(exe:R=$(locate-target)) ;
.mkjambase. $(<) : $(>) ;
}
actions .mkjambase. {
$(--chmod+w)$(<)
$(mkjambase.exe) $(<) $(>)
}
.mkjambase jambase.c : Jambase ;
# How to build Jam.
rule .jam
{
$(>).exe = [ .exe $(>) : $(jam.source) ] ;
$(<).exe = $(<:S=$($(>).exe:S)) ;
LOCATE on $($(<).exe) = $(locate-target) ;
.link $($(<).exe) : $($(>).exe) ;
DEPENDS all : $($(>).exe) $($(<).exe) ;
}
.jam bjam : jam ;
# Scan sources for header dependencies.
rule .scan
{
HDRRULE on $(<:D=) = .hdr.scan ;
HDRSCAN on $(<:D=) = "^[ ]*#[ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
}
rule .hdr.scan
{
local hdrs = [ GLOB . : $(>:D=) ] ;
INCLUDES $(<:D=) : $(hdrs:D=) ;
HDRRULE on $(>:D=) = .hdr.scan ;
HDRSCAN on $(>:D=) = "^[ ]*#[ ]*include[ ]*[<\"]([^\">]*)[\">].*$" ;
}
.scan [ GLOB . : *.c ] ;
# Distribution making from here on out.
dist.license =
[ GLOB . : LICENSE_$(LICENSE).txt ] [ GLOB [ .path .. .. .. ] : LICENSE_$(LICENSE).txt ] ;
dist.docs =
$(dist.license[1])
index.html
Porting
Jam.html
;
dist.source =
[ GLOB . : *.c *.h ]
;
dist.source = $(dist.source:D=)
$(dist.docs)
build.jam build.bat build.sh build_vms.com
Jambase
jamgram.y jamgram.yy
[ .path debian changelog ]
[ .path debian control ]
[ .path debian copyright ]
[ .path debian jam.man.sgml ]
[ .path debian rules ]
[ .path modules set.c ]
[ .path modules path.c ]
[ .path modules regex.c ]
[ .path modules property-set.c ]
[ .path modules sequence.c ]
boost-jam.spec
;
dist.bin =
bjam jam mkjambase yyacc
;
dist.bin =
$(dist.bin:S=$(bjam.exe:S))
;
if $(NT)
{
zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7zn.exe" ] ;
zip ?= [ GLOB $(PATH) : zip.exe ] ;
zip ?= zip ;
zip = $(zip[1]) ;
switch $(zip:D=:S=)
{
case 7zn : zip += a -r -tzip ;
case zip : zip += -9r ;
}
actions piecemeal .pack. {
"$(zip)" "$(<)" "$(>)"
}
actions piecemeal .zip. {
"$(zip)" "$(<)" "$(>)"
}
actions piecemeal .cp. {
copy /Y "$(>)" "$(<)"
}
}
if $(UNIX)
{
actions .pack. {
tar zcf "$(<)" "$(>)"
}
actions .zip. {
gzip -c9 "$(>)" > "$(<)"
}
actions .cp. {
cp -Rpf "$(>)" "$(<)"
}
}
# The single binary, compressed.
rule .binary
{
local zip = ;
if $(NT) { zip = $($(<).exe:S=.zip) ; }
if $(UNIX) { zip = $($(<).exe:S=.tgz) ; }
zip = $(zip:S=)-$(VERSION)-$(RELEASE)-$(platform)$(zip:S) ;
DEPENDS $(zip) : $($(<).exe) ;
DEPENDS dist : $(zip) ;
#~ LOCATE on $(zip) = $(locate-target) ;
if $(NT) { .zip. $(zip) : $($(<).exe) ; }
if $(UNIX) { .pack. $(zip) : $($(<).exe) ; }
.clean $(zip) ;
}
# Package some file.
rule .package ( dst-dir : src-files + )
{
local src-dirs ;
local dst-files ;
local dst-dirs ;
for local src-path in $(src-files)
{
local src-dir = $(src-path:D) ;
if ! $(src-dir) in $(src-dirs) &&
! $(src-dir) = "" &&
! $(src-dir:D=) != ".."
{
src-dirs += $(src-dir) ;
dst-dirs += $(src-dir:R=$(dst-dir)) ;
}
local src-file = $(src-path) ;
if $(src-dir:D=) = ".."
{
src-file = $(src-file:D=) ;
}
dst-files += $(src-file:R=$(dst-dir)) ;
}
local pack = ;
if $(NT) { pack = $(dst-dir).zip ; }
if $(UNIX) { pack = $(dst-dir).tgz ; }
DEPENDS dist : $(pack) ;
DEPENDS $(pack) : $(dst-files) ;
for local src-path in $(src-files)
{
local src-dir = $(src-path:D) ;
local src-file = $(src-path) ;
if $(src-dir:D=) = ".."
{
src-file = $(src-file:D=) ;
}
local dst-file = $(src-file:R=$(dst-dir)) ;
DEPENDS $(dst-file) : $(src-path) $(dst-file:D) ;
.mkdir $(dst-file:D) ;
.cp. $(dst-file) : $(src-path) ;
.clean $(dst-file) ;
}
.pack. $(pack) : $(dst-files) ;
.clean $(pack) ;
}
# RPM distro file.
rpm-tool = [ GLOB $(PATH) : "rpmbuild" "rpm" ] ;
rule .rpm ( name : source )
{
local rpm-arch = ;
switch $(OSPLAT)
{
case X86 : rpm-arch ?= i386 ;
case PPC : rpm-arch ?= ppc ;
case AXP : rpm-arch ?= alpha ;
# no guaranty for these:
case IA64 : rpm-arch ?= ia64 ;
case ARM : rpm-arch ?= arm ;
case SPARC : rpm-arch ?= sparc ;
case * : rpm-arch ?= other ;
}
local target = $(name)-rpm ;
NOTFILE $(target) ;
DEPENDS dist : $(target) ;
DEPENDS $(target) : $(name).$(rpm-arch).rpm $(name).src.rpm ;
DEPENDS $(name).$(rpm-arch).rpm : $(source) ;
DEPENDS $(name).src.rpm : $(name).$(rpm-arch).rpm ;
docs on $(target) = $(dist.docs:J=" ") ;
arch on $(target) = $(rpm-arch) ;
if $(rpm-arch) = ppc { target-opt on $(target) = --target= ; }
else { target-opt on $(target) = "--target " ; }
.rpm. $(target) : $(source) ;
.clean $(name).$(rpm-arch).rpm $(name).src.rpm ;
}
actions .rpm. {
export BOOST_JAM_TOOLSET="$(toolset)"
$(rpm-tool[1]) -ta $(target-opt)$(arch) $(>) | tee rpm.out
cp `grep -e '^Wrote:' rpm.out | sed 's/^Wrote: //'` .
rm -f rpm.out
}
# The distribution targets. Don't bother with the targets if
# distribution build not requested.
if dist in $(ARGV)
{
.binary bjam ;
.package $(NAME)-$(VERSION) : $(dist.source) ;
.package $(NAME)-$(VERSION)-$(RELEASE)-$(platform) : $(dist.bin) ;
if $(rpm-tool)
{
.rpm $(NAME)-$(VERSION)-$(RELEASE) : $(NAME)-$(VERSION).tgz ;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -