Newer
Older
arseny.kapoulkine
committed
# Rules for Jamfile.jam
if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) || $(toolset:I=^bada) || $(toolset:I=^android) || $(toolset:I=^blackberry) )
arseny.kapoulkine
committed
{
arseny.kapoulkine
committed
if ( $(toolset:I=^gcc) )
arseny.kapoulkine
committed
{
GCCPATH = "" ;
}
arseny.kapoulkine@gmail.com
committed
else if ( $(toolset:I=^bada) )
{
GCCPATH = "%$(toolset)_PATH%\\Tools\\Toolchains\\ARM\\bin\\arm-bada-eabi-" ;
}
else if ( $(toolset:I=^blackberry) )
{
GCCPATH = "%$(toolset)_PATH%\\host\\win32\\x86\\usr\\bin\\ntoarmv7-" ;
}
arseny.kapoulkine@gmail.com
committed
else if ( $(toolset:I=^android) )
{
GCCPATH = "%$(toolset)_PATH%\\bin\\arm-linux-androideabi-" ;
}
arseny.kapoulkine
committed
else
{
GCCPATH = "%$(toolset)_PATH%\\bin\\" ;
arseny.kapoulkine
committed
}
arseny.kapoulkine
committed
arseny.kapoulkine
committed
if ( $(OS) != MACOSX )
arseny.kapoulkine
committed
{
arseny.kapoulkine
committed
ARCH = "" ;
arseny.kapoulkine
committed
arseny.kapoulkine@gmail.com
committed
if ( $(toolset:I=^bada) )
{
LDFLAGS += -lstdc++ -lsupc++-xnew -lc ;
}
else if ( $(OS) = NT || $(OS) = FREEBSD )
arseny.kapoulkine
committed
{
LDFLAGS += -static-libgcc -static ;
}
arseny.kapoulkine
committed
}
else
{
if ( $(toolset:I=_x64) )
{
ARCH = -arch x86_64 ;
}
else if ( $(toolset:I=_ppc) )
{
ARCH = -arch ppc ;
}
LDFLAGS += $(ARCH) ;
arseny.kapoulkine
committed
}
arseny.kapoulkine@gmail.com
committed
local VERSION = [ Shell "$(GCCPATH)gcc -dumpversion" ] ;
arseny.kapoulkine
committed
rule GetCFlags CONFIG : DEFINES
arseny.kapoulkine
committed
{
arseny.kapoulkine
committed
local RESULT = -D$(DEFINES) ;
arseny.kapoulkine
committed
RESULT += -W -Wall -Wextra -pedantic -Werror ;
RESULT += -Wabi -Wno-non-template-friend -Wcast-qual -Wcast-align ;
RESULT += -Woverloaded-virtual -Wno-pmf-conversions -Wsign-promo -Wformat=2 -Winit-self ;
RESULT += -Wunused -Wstrict-aliasing=2 -Wundef -Wshadow -Wredundant-decls ;
# gcc 4.0 has some warning regressions
arseny.kapoulkine@gmail.com
committed
if ( $(VERSION:X=4\.0) )
{
RESULT += -Wold-style-cast ; # gives warnings for fpclassify() on gcc 4.0.1
RESULT += -Wswitch-default ; # gives false-positives for couple of switches on template argument on gcc 4.0.1
RESULT += -Wctor-dtor-privacy ; # gives false-positives for structs on gcc 4.0.1
}
arseny.kapoulkine
committed
# these warnings are supported on newer GCC versions only
arseny.kapoulkine@gmail.com
committed
if ( $(VERSION) >= "4.4.0" )
{
RESULT += -Wstrict-null-sentinel -Wlogical-op -Wmissing-declarations ;
}
arseny.kapoulkine
committed
if ( $(toolset:I=_0x) )
{
RESULT += -std=c++0x ;
}
arseny.kapoulkine
committed
if ( $(fulldebug) )
{
RESULT += -g ;
}
if ( $(CONFIG) = "debug" )
{
RESULT += -D_DEBUG ;
}
else
{
RESULT += -DNDEBUG -O3 ;
}
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
{
RESULT += -fno-exceptions ;
}
arseny.kapoulkine
committed
RESULT += $(ARCH) ;
arseny.kapoulkine
committed
return $(RESULT) ;
arseny.kapoulkine
committed
}
arseny.kapoulkine
committed
actions ObjectAction
{
arseny.kapoulkine
committed
"$(GCCPATH)gcc" -c $(>) -o $(<) $(CCFLAGS)
arseny.kapoulkine
committed
}
actions LibraryAction
{
arseny.kapoulkine
committed
"$(GCCPATH)ar" rcs $(<) $(>)
arseny.kapoulkine
committed
}
actions LinkAction
{
arseny.kapoulkine
committed
"$(GCCPATH)g++" $(>) -o $(<) $(LDFLAGS)
arseny.kapoulkine
committed
}
}
else if ( $(toolset:I=^msvc) )
{
if ( $(fulldebug) )
{
LDFLAGS += /DEBUG ;
}
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
if ( $(toolset:I=_wince) )
{
postfix = "\\x86_arm" ;
LDFLAGS += /SUBSYSTEM:WINDOWSCE ;
LDFLAGS += coredll.lib corelibc.lib ccrtrtti.lib ;
LDFLAGS += "/LIBPATH:\"%$(toolset)_PATH%\\lib\\armv4\"" ;
LDFLAGS += "/LIBPATH:\"%WINCESDK_PATH%\\lib\\armv4\"" ;
}
else
{
local sdk_postfix ;
if ( $(toolset:I=x64$) )
{
postfix = "\\amd64" ;
sdk_postfix = "\\x64" ;
LDFLAGS += /MACHINE:X64 ;
}
else
{
postfix = "" ;
sdk_postfix = "" ;
}
LDFLAGS += "/LIBPATH:\"%$(toolset)_PATH%\\lib$(postfix)\"" ;
LDFLAGS += "/LIBPATH:\"%$(toolset)_PATH%\\PlatformSDK\\lib$(postfix)\"" ;
LDFLAGS += "/LIBPATH:\"%WINSDK_PATH%\\lib$(sdk_postfix)\"" ;
}
arseny.kapoulkine
committed
arseny.kapoulkine
committed
rule GetCFlags CONFIG : DEFINES
{
local RESULT = /D$(DEFINES) ;
if ( $(fulldebug) )
{
RESULT += /Z7 ;
}
local RUNTIME = "MT" ;
if ( $(toolset:I=_clr) )
{
RUNTIME = "MD" ;
}
arseny.kapoulkine
committed
if ( $(CONFIG) = "debug" )
{
arseny.kapoulkine
committed
}
else
{
arseny.kapoulkine
committed
}
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 ( $(toolset:I=_clr) )
{
RESULT += /clr ;
}
else if ( ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) ) )
arseny.kapoulkine
committed
{
RESULT += /EHsc ;
}
else if ( $(toolset) = "msvc6" || $(toolset) = "msvc71" || $(toolset:I=_wince) )
arseny.kapoulkine
committed
{
# No no-exception STL in MSVC6, buggy no-exception STL in MSVC71
# No proper runtime library variant for no-exception in WinCE (ccrtrtti.lib contains what() & dtor)
arseny.kapoulkine
committed
RESULT += /EHsc ;
}
else
{
RESULT += /D_HAS_EXCEPTIONS=0 ;
}
if ( $(toolset:I=_wince) )
{
RESULT += /D_WIN32_WCE /DARM ;
RESULT += "/I\"%$(toolset)_PATH%\\include\"" ;
RESULT += "/I\"%WINCESDK_PATH%\\Include\"" ;
}
else
{
RESULT += "/I\"%$(toolset)_PATH%\\include\"" ;
RESULT += "/I\"%$(toolset)_PATH%\\PlatformSDK\\include\"" ;
RESULT += "/I\"%WINSDK_PATH%\\Include\"" ;
}
arseny.kapoulkine
committed
return $(RESULT) ;
}
arseny.kapoulkine
committed
actions ObjectAction
{
"%$(toolset)_PATH%\bin$(postfix)\cl.exe" /WX /c $(>) /Fo$(<) /nologo $(CCFLAGS)
arseny.kapoulkine
committed
}
actions LibraryAction
{
"%$(toolset)_PATH%\bin$(postfix)\lib.exe" /NOLOGO /OUT:$(<) $(>)
}
actions LinkAction
{
"%$(toolset)_PATH%\bin$(postfix)\link.exe" /SUBSYSTEM:CONSOLE /NOLOGO /OUT:$(<) /PDB:$(<:S=.pdb) $(>) $(LDFLAGS)
arseny.kapoulkine
committed
}
}
arseny.kapoulkine
committed
else if ( $(toolset:I=^ic) )
arseny.kapoulkine
committed
{
if ( $(OS) = NT )
{
if ( $(toolset) = ic8 || $(toolset) = ic9 )
{
msvc = "msvc71" ;
}
else
{
msvc = "msvc8" ;
}
arseny.kapoulkine
committed
if ( $(toolset) = ic11 )
{
postfix = "\\ia32" ;
}
else if ( $(toolset) = ic11_x64 )
{
postfix = "\\intel64" ;
}
else
{
postfix = "" ;
}
arseny.kapoulkine
committed
if ( $(toolset:I=_x64$) )
{
msvc_postfix = "\\amd64" ;
LDFLAGS += /MACHINE:X64 ;
}
else
{
msvc_postfix = "" ;
}
arseny.kapoulkine
committed
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
rule GetCFlags CONFIG : DEFINES
{
local RESULT = /D$(DEFINES) ;
RESULT += /W3 /WX /Qvec_report0 ;
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) ;
}
arseny.kapoulkine
committed
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
actions ObjectAction
{
set PATH=%$(msvc)_PATH%\bin
"%$(toolset)_PATH%\bin$(postfix)\icl.exe" /I"%$(msvc)_PATH%\include" /I"%$(msvc)_PATH%\PlatformSDK\Include" /I"%$(toolset)_PATH%\include" /c $(>) /Fo$(<) /nologo $(CCFLAGS)
}
actions LibraryAction
{
"%$(msvc)_PATH%\bin\lib.exe" /NOLOGO /OUT:$(<) $(>)
}
actions LinkAction
{
"%$(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)
}
}
else
{
rule GetCFlags CONFIG : DEFINES
{
local RESULT = -D$(DEFINES) ;
RESULT += -fp-model strict ;
RESULT += -Wall -Werror -Wcheck ;
RESULT += -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-aliasing ;
RESULT += -Wstrict-prototypes -Wpointer-arith -Wuninitialized -Wdeprecated -Wabi ;
RESULT += -Wcast-qual -Wunused-function -Wunknown-pragmas -Wmain -Wcomment -Wconversion ;
RESULT += -Wreturn-type -Wextra-tokens -Wpragma-once -Wshadow -Woverloaded-virtual -Wtrigraphs ;
RESULT += -Wmultichar -Woverflow -Wwrite-strings -Wsign-compare -Wp64 -Wshorten-64-to-32 ;
if ( $(fulldebug) )
{
RESULT += -g ;
}
if ( $(CONFIG) = "debug" )
{
RESULT += -D_DEBUG ;
}
else
{
RESULT += -DNDEBUG -O3 ;
}
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
{
RESULT += -fno-exceptions ;
}
return $(RESULT) ;
}
arseny.kapoulkine
committed
actions ObjectAction
{
icc -c $(>) -o $(<) $(CCFLAGS)
}
actions LibraryAction
{
ar rcs $(<) $(>)
}
actions LinkAction
{
icc $(>) -o $(<) $(LDFLAGS)
}
}
arseny.kapoulkine
committed
}
else if ( $(toolset:I=^dmc) )
{
arseny.kapoulkine
committed
rule GetCFlags CONFIG : DEFINES
arseny.kapoulkine
committed
{
arseny.kapoulkine
committed
local RESULT = -D$(DEFINES) ;
arseny.kapoulkine
committed
arseny.kapoulkine
committed
RESULT += -wx -f ;
if ( $(CONFIG) = "debug" )
{
RESULT += -D_DEBUG ;
}
else
{
RESULT += -DNDEBUG -o ;
}
if ( ! ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) ) )
{
RESULT += -Ae ;
}
return $(RESULT) ;
arseny.kapoulkine
committed
}
actions ObjectAction
{
arseny.kapoulkine
committed
"%$(toolset)_PATH%\bin\dmc.exe" -c -I%$(toolset)_PATH%\stlport\stlport $(>) -o$(<) $(CCFLAGS)
arseny.kapoulkine
committed
}
actions LibraryAction
{
"%$(toolset)_PATH%\bin\lib.exe" -c $(<) $(>)
}
actions LinkAction
{
"%$(toolset)_PATH%\bin\link.exe" $(>:\\) , $(<:\\) , nul , $(LDFLAGS:\\) -L/co/ma
arseny.kapoulkine
committed
}
}
else if ( $(toolset:I=^cw) )
{
cw_bin = "%$(toolset)_PATH%\\Other Metrowerks Tools\\Command Line Tools" ;
arseny.kapoulkine
committed
rule GetCFlags CONFIG : DEFINES
arseny.kapoulkine
committed
{
arseny.kapoulkine
committed
local RESULT = -D$(DEFINES) ;
arseny.kapoulkine
committed
arseny.kapoulkine
committed
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) ;
arseny.kapoulkine
committed
}
actions ObjectAction
{
arseny.kapoulkine
committed
"$(cw_bin)\mwcc.exe" -c $(>) -o $(<) $(CCFLAGS)
arseny.kapoulkine
committed
}
actions LibraryAction
{
"$(cw_bin)\mwld.exe" -library -o $(<) $(>)
}
actions LinkAction
{
"$(cw_bin)\mwld.exe" -subsystem console -o $(<) $(>) $(LDFLAGS)
}
}
else if ( $(toolset:I=^bcc) )
{
arseny.kapoulkine
committed
rule GetCFlags CONFIG : DEFINES
arseny.kapoulkine
committed
{
arseny.kapoulkine
committed
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) ;
arseny.kapoulkine
committed
}
actions ObjectAction
{
arseny.kapoulkine
committed
"%$(toolset)_PATH%\bin\bcc32.exe" $(CCFLAGS) -c -q -Q -o $(<) $(>)
arseny.kapoulkine
committed
}
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
}
}
else if ( $(toolset:I=^suncc) )
{
if ( $(toolset:I=_x64) )
{
ARCH = -m64 ;
}
else
{
ARCH = -m32 ;
}
LDFLAGS += $(ARCH) ;
arseny.kapoulkine
committed
rule GetCFlags CONFIG : DEFINES
arseny.kapoulkine
committed
local RESULT = -D$(DEFINES) ;
arseny.kapoulkine
committed
RESULT += +w -xwe ;
if ( $(CONFIG) = "debug" )
{
RESULT += -D_DEBUG ;
}
else
{
RESULT += -DNDEBUG -O ;
}
if ( PUGIXML_NO_EXCEPTIONS in $(DEFINES) )
{
RESULT += -noex ;
}
arseny.kapoulkine
committed
return $(RESULT) ;
}
actions ObjectAction
{
arseny.kapoulkine
committed
sunCC $(CCFLAGS) -c -o $(<) $(>)
}
actions LibraryAction
{
ar rcs $(<) $(>)
}
actions LinkAction
{
sunCC $(>) -o $(<) $(LDFLAGS)
}
arseny.kapoulkine
committed
}
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
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)
}
}
arseny.kapoulkine
committed
else
{
exit "Unknown toolset $(toolset)!" ;
}
arseny.kapoulkine@gmail.com
committed
RUNRESULT = "success" ;
COVSUCCESS = "echo $" "(COVPREFIX) $" "(RUNRESULT)" ;
arseny.kapoulkine
committed
if ( $(toolset:I=^mingw) || $(toolset:I=^gcc) )
{
actions maxtargets 1 CoverageAction
arseny.kapoulkine
committed
@($(COVSUCCESS:J=):A)
"$(GCCPATH)gcov" $(>) $(GCOVFLAGS) | perl tests/gcov-filter.pl $(COVPREFIX)$(SPACE)gcov
arseny.kapoulkine
committed
else
{
arseny.kapoulkine
committed
actions CoverageAction
{
@($(COVSUCCESS:J=):A)
}
arseny.kapoulkine
committed
}
if ( $(UNIX) )
{
actions screenoutput RunAction
{
$(>)
}
actions RunSampleAction
{
cd docs/samples
../../$(>)
}
arseny.kapoulkine
committed
actions quietly ignore MakeDirAction
{
mkdir -p $(<)
}
actions quietly ignore DeleteAction
{
rm -f $(>)
}
}
else
{
if ( $(toolset:I=(^xbox360|^ps3|wince|^bada|^blackberry$)) )
arseny.kapoulkine
committed
{
arseny.kapoulkine@gmail.com
committed
RUNRESULT = "skiprun" ;
actions RunAction
{
}
arseny.kapoulkine
committed
actions RunSampleAction
{
}
}
else
actions screenoutput RunAction
{
$(>:\\)
}
actions RunSampleAction
{
cd docs\samples
..\..\$(>:\\)
}
arseny.kapoulkine
committed
actions quietly ignore MakeDirAction
{
mkdir $(<:\\) >nul 2>&1
}
actions quietly ignore DeleteAction
{
del /F $(>:\\) >nul 2>&1
}
}
arseny.kapoulkine
committed
actions QuickbookAction
{
%QUICKBOOK_PATH%\bin\quickbook.exe --output-file $(<) --input-file $(>) >nul
}
arseny.kapoulkine
committed
actions response XSLTProcAction
arseny.kapoulkine
committed
{
arseny.kapoulkine
committed
%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>) $(>)
arseny.kapoulkine
committed
}
arseny.kapoulkine
committed
rule MakeFileDir TARGET
{
local DIR = $(TARGET:D) ;
MakeDirAction $(DIR) ;
Needs $(TARGET) : $(DIR) ;
}
rule Alias TARGET : SOURCE
{
NotFile $(TARGET) ;
Always $(TARGET) ;
Depends $(TARGET) : $(SOURCE) ;
}
arseny.kapoulkine
committed
rule Object TARGET : SOURCE : CCFLAGS
arseny.kapoulkine
committed
{
HDRRULE on $(SOURCE) = C.HdrRule ;
HDRSCAN on $(SOURCE) = $(C.HDRPATTERN) ;
MakeFileDir $(TARGET) ;
arseny.kapoulkine
committed
arseny.kapoulkine
committed
ObjectAction $(TARGET) : $(SOURCE) ;
Depends $(TARGET) : $(SOURCE) ;
arseny.kapoulkine
committed
CCFLAGS on $(TARGET) = $(CCFLAGS) ;
UseCommandLine $(TARGET) : $(CCFLAGS) ;
arseny.kapoulkine
committed
}
arseny.kapoulkine
committed
rule Objects BUILD : SOURCES : CCFLAGS
arseny.kapoulkine
committed
{
local OBJECTS ;
for SOURCE in $(SOURCES)
{
local OBJECT = $(BUILD)/$(SOURCE:S=.o) ;
arseny.kapoulkine
committed
Object $(OBJECT) : $(SOURCE) : $(CCFLAGS) ;
arseny.kapoulkine
committed
OBJECTS += $(OBJECT) ;
}
return $(OBJECTS) ;
}
arseny.kapoulkine
committed
rule Library TARGET : SOURCES : CCFLAGS
arseny.kapoulkine
committed
{
# build object files
arseny.kapoulkine
committed
local OBJECTS = [ Objects $(TARGET:D) : $(SOURCES) : $(CCFLAGS) ] ;
arseny.kapoulkine
committed
# build library
arseny.kapoulkine
committed
MakeFileDir $(TARGET) ;
LibraryAction $(TARGET) : $(OBJECTS) ;
Depends $(TARGET) : $(OBJECTS) ;
arseny.kapoulkine
committed
# remember library objects for coverage
$(TARGET)_objects = $(OBJECTS) ;
}
arseny.kapoulkine
committed
rule Application TARGET : SOURCES : CCFLAGS : LIBRARIES
arseny.kapoulkine
committed
{
# build object files
arseny.kapoulkine
committed
local OBJECTS = [ Objects $(TARGET:D) : $(SOURCES) : $(CCFLAGS) ] ;
arseny.kapoulkine
committed
# set libraries
arseny.kapoulkine
committed
LDFLAGS on $(TARGET) = $(LDFLAGS) $(LIBRARIES) ;
arseny.kapoulkine
committed
# build application
arseny.kapoulkine
committed
MakeFileDir $(TARGET) ;
arseny.kapoulkine
committed
arseny.kapoulkine
committed
LinkAction $(TARGET) : $(OBJECTS) ;
Depends $(TARGET) : $(OBJECTS) $(LIBRARIES) ;
arseny.kapoulkine
committed
# 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) ;
# disable "independent target" warnings
NotFile $(FILES) ;
arseny.kapoulkine
committed
DeleteAction $(CLEAN_TARGET) : $(FILES) ;
}
rule Test TARGET : SOURCE
{
# make alias
Alias $(TARGET) : $(SOURCE) ;
# run tests
arseny.kapoulkine
committed
RunAction $(TARGET) : $(SOURCE) ;
arseny.kapoulkine
committed
# 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) ;
}
arseny.kapoulkine
committed
rule QuickbookImport SOURCE : IMPORT
{
Includes $(SOURCE) : $(SOURCE:D)/$(IMPORT) ;
}
arseny.kapoulkine
committed
rule FullPath FILE
{
local PWD = [ Subst [ Shell "cd" ] : "%c" : "" ] ;
return "$(PWD)/$(FILE)" ;
}
rule Documentation TARGET : SOURCE : STYLESHEET
arseny.kapoulkine
committed
{
# escape colon with %3A because colon is a path list separator
local XSLDIR = [ Subst $(QUICKBOOK_PATH) : ":" : "%%%%3A" ] ;
# quickbook import scan
HDRRULE on $(SOURCE) = QuickbookImport ;
HDRSCAN on $(SOURCE) = "\\[import[ ]+([^]]*)\\]" ;
arseny.kapoulkine
committed
# 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) ;
arseny.kapoulkine
committed
XSL on $(DOCBOOK) = $(QUICKBOOK_PATH)/boostbook/xsl/docbook.xsl ;
XSLPATH on $(DOCBOOK) = $(XSLDIR)/boostbook/dtd $(XSLDIR)/docbook-xml ;
arseny.kapoulkine
committed
XSLTProcAction $(DOCBOOK) : $(BOOSTBOOK) ;
Depends $(DOCBOOK) : $(BOOSTBOOK) ;
# docbook -> html
local HTML = $(TARGET) ;
arseny.kapoulkine
committed
XSL on $(HTML) = $(QUICKBOOK_PATH)/boostbook/xsl/html.xsl [ FullPath $(STYLESHEET) ] ;
XSLPATH on $(HTML) = $(XSLDIR)/docbook-xml $(XSLDIR)/docbook-xsl/html $(XSLDIR)/docbook-xsl/lib ;
arseny.kapoulkine
committed
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) ;
arseny.kapoulkine
committed
Depends $(HTML) : $(DOCBOOK) $(STYLESHEET) ;