2010-04-20 20:44:06 +00:00
|
|
|
# Rules for Jamfile.jam
|
|
|
|
|
2010-05-20 07:32:49 +00:00
|
|
|
if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) )
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-05-20 07:32:49 +00:00
|
|
|
if ( $(toolset:I=^gcc) )
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
|
|
|
GCCPATH = "" ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-05-06 20:28:36 +00:00
|
|
|
GCCPATH = "%$(toolset)_PATH%\\bin\\" ;
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
if ( $(OS) != MACOSX )
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
LDFLAGS += -static-libgcc -static ;
|
2010-06-10 17:52:08 +00:00
|
|
|
ARCH = "" ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( $(toolset:I=_x64) )
|
|
|
|
{
|
|
|
|
ARCH = -arch x86_64 ;
|
|
|
|
}
|
|
|
|
else if ( $(toolset:I=_ppc) )
|
|
|
|
{
|
|
|
|
ARCH = -arch ppc ;
|
|
|
|
}
|
|
|
|
|
|
|
|
LDFLAGS += $(ARCH) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule GetCFlags CONFIG : DEFINES
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
local RESULT = -D$(DEFINES) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
2010-12-19 10:16:37 +00:00
|
|
|
RESULT += -W -Wall -Wextra -pedantic -Werror ;
|
|
|
|
RESULT += -Wabi -Wctor-dtor-privacy -Wno-non-template-friend -Wold-style-cast -Wcast-qual -Wcast-align ;
|
|
|
|
RESULT += -Woverloaded-virtual -Wno-pmf-conversions -Wsign-promo -Wformat=2 -Winit-self -Wswitch-default ;
|
|
|
|
RESULT += -Wunused -Wstrict-aliasing=2 -Wundef -Wshadow -Wredundant-decls ;
|
|
|
|
|
2010-12-19 11:57:11 +00:00
|
|
|
local REG_GCC44_PLUS = "(gcc|mingw)4.?[4-9]" ;
|
|
|
|
|
|
|
|
if ( $(toolset:I=$(REG_GCC44_PLUS)) )
|
2010-12-19 10:16:37 +00:00
|
|
|
{
|
|
|
|
RESULT += -Wstrict-null-sentinel -Wlogical-op -Wmissing-declarations ;
|
|
|
|
}
|
2010-06-02 06:25:40 +00:00
|
|
|
|
2010-06-07 16:07:03 +00:00
|
|
|
if ( $(toolset:I=_0x) )
|
|
|
|
{
|
|
|
|
RESULT += -std=c++0x ;
|
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
if ( $(fulldebug) )
|
|
|
|
{
|
|
|
|
RESULT += -g ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += -D_DEBUG ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += -DNDEBUG -O3 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
|
|
|
|
{
|
|
|
|
RESULT += -fno-exceptions ;
|
|
|
|
}
|
|
|
|
|
2010-06-10 17:52:08 +00:00
|
|
|
RESULT += $(ARCH) ;
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
return $(RESULT) ;
|
2010-05-20 07:32:49 +00:00
|
|
|
}
|
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
actions ObjectAction
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
"$(GCCPATH)gcc" -c $(>) -o $(<) $(CCFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
2010-05-20 07:32:49 +00:00
|
|
|
"$(GCCPATH)ar" rcs $(<) $(>)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
2010-05-20 07:32:49 +00:00
|
|
|
"$(GCCPATH)g++" $(>) -o $(<) $(LDFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( $(toolset:I=^msvc) )
|
|
|
|
{
|
2010-05-09 10:20:43 +00:00
|
|
|
if ( $(fulldebug) )
|
|
|
|
{
|
|
|
|
LDFLAGS += /DEBUG ;
|
|
|
|
}
|
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
if ( $(toolset:I=x64$) )
|
|
|
|
{
|
|
|
|
postfix = "\\amd64" ;
|
|
|
|
sdk_postfix = "\\x64" ;
|
|
|
|
LDFLAGS += /MACHINE:X64 ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
postfix = "" ;
|
|
|
|
sdk_postfix = "" ;
|
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule GetCFlags CONFIG : DEFINES
|
|
|
|
{
|
|
|
|
local RESULT = /D$(DEFINES) ;
|
|
|
|
|
|
|
|
if ( $(fulldebug) )
|
|
|
|
{
|
|
|
|
RESULT += /Z7 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += /D_DEBUG /MTd ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += /DNDEBUG /Ox /MT ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(toolset) = msvc7 || $(toolset) = msvc71 || $(toolset) = msvc8 )
|
|
|
|
{
|
|
|
|
RESULT += /Wp64 ; # Wp64 is deprecated from msvc9
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(toolset) != msvc6 )
|
|
|
|
{
|
|
|
|
RESULT += /W4 ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += /W3 ; # lots of warnings at W4 in standard library
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) ) )
|
|
|
|
{
|
|
|
|
RESULT += /EHsc ;
|
|
|
|
}
|
|
|
|
else if ( $(toolset) = "msvc6" || $(toolset) = "msvc71" )
|
|
|
|
{
|
|
|
|
# No no-exception STL in MSVC6, buggy no-exception STL in MSVC71
|
|
|
|
RESULT += /EHsc ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += /D_HAS_EXCEPTIONS=0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
|
|
|
}
|
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
actions ObjectAction
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
"%$(toolset)_PATH%\bin$(postfix)\cl.exe" /WX /I"%$(toolset)_PATH%\include" /I"%$(toolset)_PATH%\PlatformSDK\include" /I"%WINSDK_PATH%\Include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"%$(toolset)_PATH%\bin$(postfix)\lib.exe" /NOLOGO /OUT:$(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
2010-05-08 21:08:03 +00:00
|
|
|
"%$(toolset)_PATH%\bin$(postfix)\link.exe" /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) /PDB:$(<:S=.pdb) $(>) /LIBPATH:"%$(toolset)_PATH%\lib$(postfix)" /LIBPATH:"%$(toolset)_PATH%\PlatformSDK\lib$(postfix)" /LIBPATH:"%WINSDK_PATH%\Lib$(sdk_postfix)" $(LDFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
}
|
2010-06-01 05:41:26 +00:00
|
|
|
else if ( $(toolset:I=^ic) )
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-06-01 05:41:26 +00:00
|
|
|
if ( $(toolset) = ic8 || $(toolset) = ic9 )
|
|
|
|
{
|
|
|
|
msvc = "msvc71" ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
msvc = "msvc8" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(toolset) = ic11 )
|
|
|
|
{
|
|
|
|
postfix = "\\ia32" ;
|
|
|
|
}
|
|
|
|
else if ( $(toolset) = ic11_x64 )
|
|
|
|
{
|
|
|
|
postfix = "\\intel64" ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
postfix = "" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(toolset:I=_x64$) )
|
|
|
|
{
|
|
|
|
msvc_postfix = "\\amd64" ;
|
|
|
|
LDFLAGS += /MACHINE:X64 ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
msvc_postfix = "" ;
|
|
|
|
}
|
2010-04-20 20:44:06 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule GetCFlags CONFIG : DEFINES
|
2010-06-01 06:40:43 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
local RESULT = /D$(DEFINES) ;
|
2010-06-01 06:40:43 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
RESULT += /W3 /WX /Qvec_report0 ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
if ( $(toolset) != ic8 )
|
|
|
|
{
|
|
|
|
RESULT += /fp:precise ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += /D_DEBUG /Od /MTd ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += /DNDEBUG /Ox /MT ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) ) )
|
|
|
|
{
|
|
|
|
RESULT += /EHsc ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
2010-06-01 05:41:26 +00:00
|
|
|
set PATH=%$(msvc)_PATH%\bin
|
2010-06-02 06:25:40 +00:00
|
|
|
"%$(toolset)_PATH%\bin$(postfix)\icl.exe" /I"%$(msvc)_PATH%\include" /I"%$(msvc)_PATH%\PlatformSDK\Include" /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"%$(msvc)_PATH%\bin\lib.exe" /NOLOGO /OUT:$(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
2010-06-01 05:41:26 +00:00
|
|
|
"%$(msvc)_PATH%\bin\link.exe" /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) $(>) /LIBPATH:"%$(toolset)_PATH%\lib$(postfix)" /LIBPATH:"%$(msvc)_PATH%\lib$(msvc_postfix)" /LIBPATH:"%$(msvc)_PATH%\PlatformSDK\lib$(msvc_postfix)" $(LDFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( $(toolset:I=^dmc) )
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
rule GetCFlags CONFIG : DEFINES
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
local RESULT = -D$(DEFINES) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
RESULT += -wx -f ;
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += -D_DEBUG ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += -DNDEBUG -o ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) ) )
|
|
|
|
{
|
|
|
|
RESULT += -Ae ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
"%$(toolset)_PATH%\bin\dmc.exe" -c -I%$(toolset)_PATH%\stlport\stlport $(>) -o$(<) $(CCFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"%$(toolset)_PATH%\bin\lib.exe" -c $(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
2010-05-06 20:28:36 +00:00
|
|
|
"%$(toolset)_PATH%\bin\link.exe" $(>:\\) , $(<:\\) , nul , $(LDFLAGS:\\) -L/co/ma
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( $(toolset:I=^cw) )
|
|
|
|
{
|
|
|
|
cw_bin = "%$(toolset)_PATH%\\Other Metrowerks Tools\\Command Line Tools" ;
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule GetCFlags CONFIG : DEFINES
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
local RESULT = -D$(DEFINES) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
RESULT += -cwd include -ansi strict -iso_templates on -msext off -w all,cmdline,iserror,nonotused,nonotinlined,noimplicitconv,nounwanted ;
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += -D_DEBUG ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += -DNDEBUG -O4 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
|
|
|
|
{
|
|
|
|
RESULT += -Cpp_exceptions off ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
"$(cw_bin)\mwcc.exe" -c $(>) -o $(<) $(CCFLAGS)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"$(cw_bin)\mwld.exe" -library -o $(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
|
|
|
"$(cw_bin)\mwld.exe" -subsystem console -o $(<) $(>) $(LDFLAGS)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( $(toolset:I=^bcc) )
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
rule GetCFlags CONFIG : DEFINES
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
local RESULT = -D$(DEFINES) ;
|
|
|
|
|
|
|
|
RESULT += -fp -w -w! -w-8026 -w-8027 -w-8091 -w-8004 ;
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += -D_DEBUG ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += -DNDEBUG -Ox ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
"%$(toolset)_PATH%\bin\bcc32.exe" $(CCFLAGS) -c -q -Q -o $(<) $(>)
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"%$(toolset)_PATH%\bin\tlib.exe" /C $(<:\\) -+$(>:\\)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
|
|
|
"%$(toolset)_PATH%\bin\ilink32.exe" -L"%$(toolset)_PATH%\lib" -Tpe -ap -Gn -x -c "%$(toolset)_PATH%\lib\c0x32.obj" $(>:\\) , $(<:\\) , , $(LDFLAGS:\\) cw32 import32
|
|
|
|
}
|
|
|
|
}
|
2010-05-25 21:50:46 +00:00
|
|
|
else if ( $(toolset:I=^suncc) )
|
|
|
|
{
|
2010-06-11 07:30:36 +00:00
|
|
|
if ( $(toolset:I=_x64) )
|
|
|
|
{
|
|
|
|
ARCH = -m64 ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ARCH = -m32 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
LDFLAGS += $(ARCH) ;
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule GetCFlags CONFIG : DEFINES
|
2010-05-25 21:50:46 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
local RESULT = -D$(DEFINES) ;
|
2010-05-25 21:50:46 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
RESULT += +w -xwe ;
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += -D_DEBUG ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += -DNDEBUG -O ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
|
|
|
|
{
|
|
|
|
RESULT += -noex ;
|
|
|
|
}
|
|
|
|
|
2010-06-11 07:30:36 +00:00
|
|
|
RESULT += $(ARCH) ;
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
return $(RESULT) ;
|
2010-05-25 21:50:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
sunCC $(CCFLAGS) -c -o $(<) $(>)
|
2010-05-25 21:50:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
ar rcs $(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
|
|
|
sunCC $(>) -o $(<) $(LDFLAGS)
|
|
|
|
}
|
2010-06-02 06:25:40 +00:00
|
|
|
}
|
2010-07-15 09:29:32 +00:00
|
|
|
else if ( $(toolset:I=^xbox360) )
|
|
|
|
{
|
|
|
|
rule GetCFlags CONFIG : DEFINES
|
|
|
|
{
|
|
|
|
local RESULT = /D$(DEFINES) ;
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += /D_DEBUG /MTd ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += /DNDEBUG /Ox /MT ;
|
|
|
|
}
|
|
|
|
|
|
|
|
RESULT += /W4 ;
|
|
|
|
|
|
|
|
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) ) )
|
|
|
|
{
|
|
|
|
RESULT += /EHsc ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += /D_HAS_EXCEPTIONS=0 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
|
|
|
"%XEDK%\bin\win32\cl.exe" /WX /I"%XEDK%\include\xbox" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"%XEDK%\bin\win32\lib.exe" /NOLOGO /OUT:$(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
|
|
|
"%XEDK%\bin\win32\link.exe" /NOLOGO /OUT:$(<) /PDB:$(<:S=.pdb) $(>) /LIBPATH:"%XEDK%\lib\xbox" $(LDFLAGS)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( $(toolset:I=^ps3_gcc) )
|
|
|
|
{
|
|
|
|
rule GetCFlags CONFIG : DEFINES
|
|
|
|
{
|
|
|
|
local RESULT = -D$(DEFINES) ;
|
|
|
|
|
|
|
|
RESULT += -W -Wall -Wextra -Werror ;
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += -D_DEBUG ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += -DNDEBUG -O3 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
|
|
|
|
{
|
|
|
|
RESULT += -fno-exceptions ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
|
|
|
"%SCE_PS3_ROOT%\host-win32\ppu\bin\ppu-lv2-gcc" -c $(>) -o $(<) $(CCFLAGS)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"%SCE_PS3_ROOT%\host-win32\ppu\bin\ppu-lv2-ar" rcs $(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
|
|
|
"%SCE_PS3_ROOT%\host-win32\ppu\bin\ppu-lv2-g++" $(>) -o $(<) $(LDFLAGS)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( $(toolset:I=^ps3_snc) )
|
|
|
|
{
|
|
|
|
rule GetCFlags CONFIG : DEFINES
|
|
|
|
{
|
|
|
|
local RESULT = -D$(DEFINES) ;
|
|
|
|
|
|
|
|
RESULT += -Werror -Xuninitwarn=0 ;
|
|
|
|
|
|
|
|
if ( $(CONFIG) = "debug" )
|
|
|
|
{
|
|
|
|
RESULT += -D_DEBUG ;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RESULT += -DNDEBUG -O3 ;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
|
|
|
|
{
|
|
|
|
RESULT += -Xc+=exceptions ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(RESULT) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions ObjectAction
|
|
|
|
{
|
|
|
|
"%SCE_PS3_ROOT%\host-win32\sn\bin\ps3ppusnc" -c $(>) -o $(<) $(CCFLAGS)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LibraryAction
|
|
|
|
{
|
|
|
|
"%SCE_PS3_ROOT%\host-win32\sn\bin\ps3snarl" rcs $(<) $(>)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions LinkAction
|
|
|
|
{
|
|
|
|
"%SCE_PS3_ROOT%\host-win32\sn\bin\ps3ppuld" $(>) -o $(<) $(LDFLAGS)
|
|
|
|
}
|
|
|
|
}
|
2010-06-02 06:25:40 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
exit "Unknown toolset $(toolset)!" ;
|
|
|
|
}
|
2010-05-25 21:50:46 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
COVSUCCESS = "echo $" "(COVPREFIX) success" ;
|
|
|
|
|
|
|
|
if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) )
|
|
|
|
{
|
|
|
|
actions maxtargets 1 CoverageAction
|
2010-05-25 21:50:46 +00:00
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
@($(COVSUCCESS:J=):A)
|
|
|
|
"$(GCCPATH)gcov" $(>) $(GCOVFLAGS) | perl tests/gcov-filter.pl $(COVPREFIX)$(SPACE)gcov
|
2010-05-25 21:50:46 +00:00
|
|
|
}
|
|
|
|
}
|
2010-04-20 20:44:06 +00:00
|
|
|
else
|
|
|
|
{
|
2010-06-02 06:25:40 +00:00
|
|
|
actions CoverageAction
|
|
|
|
{
|
|
|
|
@($(COVSUCCESS:J=):A)
|
|
|
|
}
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( $(UNIX) )
|
|
|
|
{
|
|
|
|
actions screenoutput RunAction
|
|
|
|
{
|
|
|
|
$(>)
|
|
|
|
}
|
|
|
|
|
2010-06-27 11:58:24 +00:00
|
|
|
actions RunSampleAction
|
|
|
|
{
|
|
|
|
cd docs/samples
|
|
|
|
../../$(>)
|
|
|
|
}
|
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
actions quietly ignore MakeDirAction
|
|
|
|
{
|
|
|
|
mkdir -p $(<)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions quietly ignore DeleteAction
|
|
|
|
{
|
|
|
|
rm -f $(>)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-07-15 09:29:32 +00:00
|
|
|
if ( $(toolset:I=^(xbox360|ps3)) )
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
2010-07-15 09:29:32 +00:00
|
|
|
actions RunAction
|
|
|
|
{
|
|
|
|
}
|
2010-04-20 20:44:06 +00:00
|
|
|
|
2010-07-15 09:29:32 +00:00
|
|
|
actions RunSampleAction
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2010-06-27 11:58:24 +00:00
|
|
|
{
|
2010-07-15 09:29:32 +00:00
|
|
|
actions screenoutput RunAction
|
|
|
|
{
|
|
|
|
$(>:\\)
|
|
|
|
}
|
|
|
|
|
|
|
|
actions RunSampleAction
|
|
|
|
{
|
|
|
|
cd docs\samples
|
|
|
|
..\..\$(>:\\)
|
|
|
|
}
|
2010-06-27 11:58:24 +00:00
|
|
|
}
|
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
actions quietly ignore MakeDirAction
|
|
|
|
{
|
|
|
|
mkdir $(<:\\) >nul 2>&1
|
|
|
|
}
|
|
|
|
|
|
|
|
actions quietly ignore DeleteAction
|
|
|
|
{
|
|
|
|
del /F $(>:\\) >nul 2>&1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-06-23 13:58:46 +00:00
|
|
|
actions QuickbookAction
|
|
|
|
{
|
|
|
|
%QUICKBOOK_PATH%\bin\quickbook.exe --output-file $(<) --input-file $(>) >nul
|
|
|
|
}
|
|
|
|
|
2010-07-10 19:36:50 +00:00
|
|
|
actions response XSLTProcAction
|
2010-06-23 13:58:46 +00:00
|
|
|
{
|
2010-07-10 19:36:50 +00:00
|
|
|
%QUICKBOOK_PATH%\bin\xsltproc.exe --path$(SPACE)$(XSLPATH:C) --stringparam$(SPACE)$(XSLPARAM) --output $(<) @(<?xml version="1.0"?>
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
|
|
<xsl:import$(SPACE)href="file:///$(XSL:/)"$(SPACE)/>
|
|
|
|
</xsl:stylesheet>) $(>)
|
2010-06-23 13:58:46 +00:00
|
|
|
}
|
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
rule MakeFileDir TARGET
|
|
|
|
{
|
|
|
|
local DIR = $(TARGET:D) ;
|
|
|
|
|
|
|
|
MakeDirAction $(DIR) ;
|
|
|
|
Needs $(TARGET) : $(DIR) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
rule Alias TARGET : SOURCE
|
|
|
|
{
|
|
|
|
NotFile $(TARGET) ;
|
|
|
|
Always $(TARGET) ;
|
|
|
|
Depends $(TARGET) : $(SOURCE) ;
|
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule Object TARGET : SOURCE : CCFLAGS
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
|
|
|
HDRRULE on $(SOURCE) = C.HdrRule ;
|
|
|
|
HDRSCAN on $(SOURCE) = $(C.HDRPATTERN) ;
|
|
|
|
|
|
|
|
MakeFileDir $(TARGET) ;
|
2010-06-02 06:25:40 +00:00
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
ObjectAction $(TARGET) : $(SOURCE) ;
|
|
|
|
Depends $(TARGET) : $(SOURCE) ;
|
2010-06-02 06:25:40 +00:00
|
|
|
|
|
|
|
CCFLAGS on $(TARGET) = $(CCFLAGS) ;
|
|
|
|
UseCommandLine $(TARGET) : $(CCFLAGS) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule Objects BUILD : SOURCES : CCFLAGS
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
|
|
|
local OBJECTS ;
|
|
|
|
|
|
|
|
for SOURCE in $(SOURCES)
|
|
|
|
{
|
|
|
|
local OBJECT = $(BUILD)/$(SOURCE:S=.o) ;
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
Object $(OBJECT) : $(SOURCE) : $(CCFLAGS) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
OBJECTS += $(OBJECT) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $(OBJECTS) ;
|
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule Library TARGET : SOURCES : CCFLAGS
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
|
|
|
# build object files
|
2010-06-02 06:25:40 +00:00
|
|
|
local OBJECTS = [ Objects $(TARGET:D) : $(SOURCES) : $(CCFLAGS) ] ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
|
|
|
# build library
|
2010-06-02 06:25:40 +00:00
|
|
|
MakeFileDir $(TARGET) ;
|
|
|
|
LibraryAction $(TARGET) : $(OBJECTS) ;
|
|
|
|
Depends $(TARGET) : $(OBJECTS) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
|
|
|
# remember library objects for coverage
|
|
|
|
$(TARGET)_objects = $(OBJECTS) ;
|
|
|
|
}
|
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
rule Application TARGET : SOURCES : CCFLAGS : LIBRARIES
|
2010-04-20 20:44:06 +00:00
|
|
|
{
|
|
|
|
# build object files
|
2010-06-02 06:25:40 +00:00
|
|
|
local OBJECTS = [ Objects $(TARGET:D) : $(SOURCES) : $(CCFLAGS) ] ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
|
|
|
# set libraries
|
2010-06-02 06:25:40 +00:00
|
|
|
LDFLAGS on $(TARGET) = $(LDFLAGS) $(LIBRARIES) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
|
|
|
# build application
|
2010-06-02 06:25:40 +00:00
|
|
|
MakeFileDir $(TARGET) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
2010-06-02 06:25:40 +00:00
|
|
|
LinkAction $(TARGET) : $(OBJECTS) ;
|
|
|
|
Depends $(TARGET) : $(OBJECTS) $(LIBRARIES) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
|
|
|
# remember executable objects for coverage
|
|
|
|
$(TARGET)_objects = $(OBJECTS) $($(LIBRARIES)_objects) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
rule CleanCoverage TARGET
|
|
|
|
{
|
|
|
|
# make target
|
|
|
|
local CLEAN_TARGET = $(TARGET)_clean_coverage ;
|
|
|
|
|
|
|
|
NotFile $(CLEAN_TARGET) ;
|
|
|
|
Always $(CLEAN_TARGET) ;
|
|
|
|
Depends $(TARGET) : $(CLEAN_TARGET) ;
|
|
|
|
|
|
|
|
# clean object files
|
|
|
|
local FILES = $($(SOURCE)_objects:S=.gcda) ;
|
|
|
|
|
2010-05-06 20:28:36 +00:00
|
|
|
# disable "independent target" warnings
|
|
|
|
NotFile $(FILES) ;
|
|
|
|
|
2010-04-20 20:44:06 +00:00
|
|
|
DeleteAction $(CLEAN_TARGET) : $(FILES) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
rule Test TARGET : SOURCE
|
|
|
|
{
|
|
|
|
# make alias
|
|
|
|
Alias $(TARGET) : $(SOURCE) ;
|
|
|
|
|
|
|
|
# run tests
|
2010-06-02 06:25:40 +00:00
|
|
|
RunAction $(TARGET) : $(SOURCE) ;
|
2010-04-20 20:44:06 +00:00
|
|
|
|
|
|
|
# remember executable objects for coverage
|
|
|
|
$(TARGET)_objects = $($(SOURCE)_objects) ;
|
|
|
|
|
|
|
|
# clean coverage files before run
|
|
|
|
CleanCoverage $(TARGET) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
rule Coverage TARGET : SOURCE
|
|
|
|
{
|
|
|
|
local FILES = $($(SOURCE)_objects:S=.gcda) ;
|
|
|
|
|
|
|
|
# disable "independent target" warnings
|
|
|
|
NotFile $(FILES) ;
|
|
|
|
|
|
|
|
CoverageAction $(TARGET) : $(FILES) ;
|
|
|
|
Depends $(TARGET) : $(SOURCE) ;
|
|
|
|
}
|
2010-06-23 13:58:46 +00:00
|
|
|
|
2010-06-24 19:54:17 +00:00
|
|
|
rule QuickbookImport SOURCE : IMPORT
|
|
|
|
{
|
|
|
|
Includes $(SOURCE) : $(SOURCE:D)/$(IMPORT) ;
|
|
|
|
}
|
|
|
|
|
2010-07-10 19:36:50 +00:00
|
|
|
rule FullPath FILE
|
|
|
|
{
|
|
|
|
local PWD = [ Subst [ Shell "cd" ] : "%c" : "" ] ;
|
|
|
|
return "$(PWD)/$(FILE)" ;
|
|
|
|
}
|
|
|
|
|
|
|
|
rule Documentation TARGET : SOURCE : STYLESHEET
|
2010-06-23 13:58:46 +00:00
|
|
|
{
|
2010-06-23 17:07:25 +00:00
|
|
|
# escape colon with %3A because colon is a path list separator
|
|
|
|
local XSLDIR = [ Subst $(QUICKBOOK_PATH) : ":" : "%%%%3A" ] ;
|
|
|
|
|
2010-06-24 19:54:17 +00:00
|
|
|
# quickbook import scan
|
|
|
|
HDRRULE on $(SOURCE) = QuickbookImport ;
|
|
|
|
HDRSCAN on $(SOURCE) = "\\[import[ ]+([^]]*)\\]" ;
|
|
|
|
|
2010-06-23 13:58:46 +00:00
|
|
|
# quickbook -> boostbook
|
|
|
|
local BOOSTBOOK = $(BUILD)/$(SOURCE:S=.bb.xml) ;
|
|
|
|
|
|
|
|
MakeFileDir $(BOOSTBOOK) ;
|
|
|
|
QuickbookAction $(BOOSTBOOK) : $(SOURCE) ;
|
|
|
|
Depends $(BOOSTBOOK) : $(SOURCE) ;
|
|
|
|
|
|
|
|
# boostbook -> docbook
|
|
|
|
local DOCBOOK = $(BUILD)/$(SOURCE:S=.db.xml) ;
|
|
|
|
|
2010-07-10 19:36:50 +00:00
|
|
|
XSL on $(DOCBOOK) = $(QUICKBOOK_PATH)/boostbook/xsl/docbook.xsl ;
|
2010-06-23 17:07:25 +00:00
|
|
|
XSLPATH on $(DOCBOOK) = $(XSLDIR)/boostbook/dtd $(XSLDIR)/docbook-xml ;
|
2010-06-23 13:58:46 +00:00
|
|
|
XSLTProcAction $(DOCBOOK) : $(BOOSTBOOK) ;
|
|
|
|
Depends $(DOCBOOK) : $(BOOSTBOOK) ;
|
|
|
|
|
|
|
|
# docbook -> html
|
|
|
|
local HTML = $(TARGET) ;
|
|
|
|
|
2010-07-10 19:36:50 +00:00
|
|
|
XSL on $(HTML) = $(QUICKBOOK_PATH)/boostbook/xsl/html.xsl [ FullPath $(STYLESHEET) ] ;
|
2010-06-23 17:07:25 +00:00
|
|
|
XSLPATH on $(HTML) = $(XSLDIR)/docbook-xml $(XSLDIR)/docbook-xsl/html $(XSLDIR)/docbook-xsl/lib ;
|
2010-06-23 13:58:46 +00:00
|
|
|
|
|
|
|
XSLPARAM on $(HTML) =
|
|
|
|
"generate.manifest 0"
|
|
|
|
"html.stylesheet pugixml.css"
|
|
|
|
"root.filename $(TARGET:B)"
|
|
|
|
"generate.section.toc.level 1"
|
|
|
|
"toc.section.depth 3"
|
|
|
|
"admon.graphics.path images/"
|
|
|
|
"navig.graphics.path images/"
|
|
|
|
;
|
|
|
|
|
|
|
|
XSLTProcAction $(HTML) : $(DOCBOOK) ;
|
2010-07-10 19:36:50 +00:00
|
|
|
Depends $(HTML) : $(DOCBOOK) $(STYLESHEET) ;
|
2010-06-23 13:58:46 +00:00
|
|
|
}
|