Please review my current prototype of porting from make to BB

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Please review my current prototype of porting from make to BB

Daniel Einspanjer
I have a presentation to my engineering team tomorrow where-in I hope to
demonstrate to them some of the advantages of moving away from makefiles to
BB.  The other alternative on the table is ant + cpptasks.

I started out by taking one directory (our util/common), which contains
primarily one library that is linked all over in our project tree and a
couple of stray utilities, and getting it building on Windows under bjam.  I
reverse engineered a lot of the funkiness of our old makefile system and
when I got it working there, moved over to Linux to work on that.

At this point, I am able to build on both platforms, but I am sure I've done
a hundred things that would make the experienced BB people here cringe.

I'm sincerely hoping one of those people might have a few minutes to look
over the Jamfiles in the attached zip (10 in all, none very large) and just
let me know if I've done something terrible.

I'm quite nervous about the presentation and I really like everything I've
learned about the BB system so far so I'm hoping to make the best
impression.

Thanks for your time,

Daniel Einspanjer


begin 666 BBdemo.zip
M4$L#! H``````)&M030````````````````.````0D)D96UO+V5N9VEN92]0
M2P,$"@``````D:U!- ```````````````!(```!"0F1E;6\O96YG:6YE+V-P
M<"]02P,$"@``````D:U!- ```````````````!<```!"0F1E;6\O96YG:6YE
M+V-P<"]U=&EL+U!+`P0*``````"1K4$T````````````````&P```$)"9&5M
M;R]E;F=I;F4O8W!P+W5T:6PO865S+U!+`P04````" #3@3\TX2"<WD8```!9
M````(@```$)"9&5M;R]E;F=I;F4O8W!P+W5T:6PO865S+TIA;69I;&4K*,K/
M2DTNX>52``(KA=+BQ/14W:+4PM+,HM3<U+R28@6;S+SDG-*45#L]B")K7BY>
MKIS,)(7$U.+DHLH"N%X@7R\9K@8`4$L#! H``````.*N030`````````````
M```>````0D)D96UO+V5N9VEN92]C<' O=71I;"]C;VUM;VXO4$L#!!0````(
M`.*N030J6D_-D@$``*0#```E````0D)D96UO+V5N9VEN92]C<' O=71I;"]C
M;VUM;VXO2F%M9FEL9752P4[C,!"]1\H_C.@5U=(>`<&!$Q("I-V5N"%G,B6F
M3FQY;-+P]8R=%EI0G,B.W[QY,W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*;T&[-+U>-O0X>^Z[L5W<YL%)7L#)H$`2+P%(J,K=\*9=Q2S%#B
M[%NH8F)A*Z+'ODMQH/EQ[?ONAWV"[+8;U^S*V,)4GP]QK[9'2&Q8?)IC61!S
M&-A=WPZL]O9GN-D$>.9]5?.R:/%<+::'J)WVN3M02P,$"@``````D:U!- ``
M`````````````!0```!"0F1E;6\O97AT97)N86QL:6)S+U!+`P0*``````"1
MK4$T````````````````& ```$)"9&5M;R]E>'1E<FYA;&QI8G,O8W!P+U!+
M`P0*``````"1K4$T````````````````'P```$)"9&5M;R]E>'1E<FYA;&QI
M8G,O8W!P+V,M87)E<R]02P,$"@``````4:]!- ```````````````"P```!"
M0F1E;6\O97AT97)N86QL:6)S+V-P<"]C+6%R97,O8RUA<F5S+3$N,RXP+U!+
M`P04````" !1KT$T'J8)C5D!``"T`P``,P```$)"9&5M;R]E>'1E<FYA;&QI
M8G,O8W!P+V,M87)E<R]C+6%R97,M,2XS+C O2F%M9FEL9752P4[#, R]]RLL
M<68?`-,X(R%N2-RJ-'&WL#3.')>M?X\S!MJ6UE*K]CT[?N^UB>D+K32@]01C
M-EM\9#R,GG' *!G6/MHP.MRLSCW/3?,`LO,9@N\,FPGTD6*8=!8==!/8D8,B
MRL?QM-)N;1C,WL<MF @X))G !&^ROCH]"B-D%"G\FO+F[?7]XQ,*"U<Z])B>
M^']Q&8,.L\!1%0B!(_#RTA3*&L;\Z^=\+U6@UIIH,:SL+=K:0!G;3':/DBMV
MB]+N*(MJJ#A&XUJUB?>,4V5,TSV,IZ26VVB&:J)WU>J>$9=6GSG=H:'=4RJX
M#'63<8X7R3D-/OIJT; _C,B5DV18,S.:0 H+9!)>H)DLYLKN[)Z,ANVN1J.K
M,&%DILJQ^ %IK'Q](V=/\0H^^NCHJ/*(J^[+AYL/_)*%UKQ?S;RD[6-/5Y3^
M-=*6*\F-C,Y+M$.J.H7^L.?F!U!+`P0*``````"1K4$T````````````````
M'0```$)"9&5M;R]E>'1E<FYA;&QI8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9J--A2[&BY
M-\2"O;P&;?L[%EE&>6(X`D[P1*Z9X(J@CV(92ZD\,)_ 5RZC;UCK%$[-<J$4
M6Z9P\IYI(5)\9\:,:TA'MULJ.9ZNQLAJ%XUJMAPK7%+XM75F?K!X/79:9/=1
MY+!)]IQF+(YBJO1=R8#VN1&WRF]["[VAYS1(/E\/70;??R"E./0ZSV]<^K_R
MWZT:R;J%U=7(/4AHR'$;JH^\E$L:XX6 K(2TI5^KTB(SA;<U+@P3,UY.GASS
M>47RE,9@^P-+:DIIC-K5'/BD*C#(.J1F0MM(WUHG=J1[,CRZIHL$+S1+<7H`
MQ^D%W3C/NT92*<U5+OI7'&V<=S@G.$U1HBS$0?7ULG=1L*3)U<H=?A2S<!ZN
MD3J<UA(T;7 KY0['GQA7@Y\5.]SB0J9-ES-RNT0W46\8]9P85)97/0-I&TWU
MT^YU!AVO:KG0E-U2!C:;X.G>#D$?FZ/@Y:B5ADFPLRCR"X\W9M2JO=*0F8DK
M<?Y!V8P(ANAE(\([R/UV`_@'I=-!-!36G4EHRO!_`Q*.(),)B2DG\48(98=K
MV8$8B&G@JD')\[S3,MFCR3O-V<"TSZCB2KR%T;SA=2%MTH@4FL08D&R2RSR6
M>G@NWRH1OS4Y;!G/LG-QKC#2AFB29?P1I;0O^;#66)HH=P<2?'W^,0VB^?/B
MY6%ZA\/6N-I4FG*82ELB&=5L4T%^D-;@!]IQ01P27@L.>:X%-KWUKLQJO2V3
M66^K'![W)G7'<$W&CK@V40VQ!V$5^+]02P,$"@``````?:Y!- ``````````
M``````<```!"0F1E;6\O4$L!`A0`"@``````D:U!- ````````````````X`
M```````````0`````````$)"9&5M;R]E;F=I;F4O4$L!`A0`"@``````D:U!
M- ```````````````!(````````````0````+ ```$)"9&5M;R]E;F=I;F4O
M8W!P+U!+`0(4``H``````)&M030````````````````7````````````$ ``
M`%P```!"0F1E;6\O96YG:6YE+V-P<"]U=&EL+U!+`0(4``H``````)&M030`
M```````````````;````````````$ ```)$```!"0F1E;6\O96YG:6YE+V-P
M<"]U=&EL+V%E<R]02P$"% `4````" #3@3\TX2"<WD8```!9````(@``````
M```!`" ```#*````0D)D96UO+V5N9VEN92]C<' O=71I;"]A97,O2F%M9FEL
M95!+`0(4``H``````.*N030````````````````>````````````$ ```% !
M``!"0F1E;6\O96YG:6YE+V-P<"]U=&EL+V-O;6UO;B]02P$"% `4````" #B
MKD$T*EI/S9(!``"D`P``)0`````````!`" ```",`0``0D)D96UO+V5N9VEN
M92]C<' O=71I;"]C;VUM;VXO2F%M9FEL95!+`0(4``H``````/FN030`````
M```````````=````````````$ ```&$#``!"0F1E;6\O96YG:6YE+V-P<"]U
M=&EL+V=R971A+U!+`0(4`!0````(`/FN03207*7VC@```,8````D````````
M``$`( ```)P#``!"0F1E;6\O96YG:6YE+V-P<"]U=&EL+V=R971A+TIA;69I
M;&502P$"% `*```````)KT$T````````````````' ```````````! ```!L
M! ``0D)D96UO+V5N9VEN92]C<' O=71I;"]Z;&EB+U!+`0(4`!0````(``FO
M031B$:@EJ0````@!```C``````````$`( ```*8$``!"0F1E;6\O96YG:6YE
M+V-P<"]U=&EL+WIL:6(O2F%M9FEL95!+`0(4``H``````)&M030`````````
M```````4````````````$ ```) %``!"0F1E;6\O97AT97)N86QL:6)S+U!+
M`0(4``H``````)&M030````````````````8````````````$ ```,(%``!"
M0F1E;6\O97AT97)N86QL:6)S+V-P<"]02P$"% `*``````"1K4$T````````
M````````'P```````````! ```#X!0``0D)D96UO+V5X=&5R;F%L;&EB<R]C
M<' O8RUA<F5S+U!+`0(4``H``````%&O030````````````````L````````
M````$ ```#4&``!"0F1E;6\O97AT97)N86QL:6)S+V-P<"]C+6%R97,O8RUA
M<F5S+3$N,RXP+U!+`0(4`!0````(`%&O030>I@F-60$``+0#```S````````
M``$`( ```'\&``!"0F1E;6\O97AT97)N86QL:6)S+V-P<"]C+6%R97,O8RUA
M<F5S+3$N,RXP+TIA;69I;&502P$"% `*``````"1K4$T````````````````
M'0```````````! ````I" ``0D)D96UO+V5X=&5R;F%L;&EB<R]C<' O8W5R
M;"]02P$"% `*``````!;KT$T````````````````*0```````````! ```!D
M" ``0D)D96UO+V5X=&5R;F%L;&EB<R]C<' O8W5R;"]C=7)L7S=?,31?,2]0
M2P$"% `4````" !;KT$T1L6"I&4!``"(! ``, `````````!`" ```"K" ``
M0D)D96UO+V5X=&5R;F%L;&EB<R]C<' O8W5R;"]C=7)L7S=?,31?,2]*86UF
M:6QE4$L!`A0`"@``````D:U!- ```````````````" ````````````0````
M7@H``$)"9&5M;R]E>'1E<FYA;&QI8G,O8W!P+VQI8GAM;#(O4$L!`A0`% ``
M``@`I91!-$ZL3@Z#````# $``"<``````````0`@````G H``$)"9&5M;R]E
M>'1E<FYA;&QI8G,O8W!P+VQI8GAM;#(O2F%M9FEL95!+`0(4``H``````'RO
M030````````````````=````````````$ ```&0+``!"0F1E;6\O97AT97)N
M86QL:6)S+V-P<"]U=6ED+U!+`0(4`!0````(`'RO030-TR_CJP```/D````D
M``````````$`( ```)\+``!"0F1E;6\O97AT97)N86QL:6)S+V-P<"]U=6ED
M+TIA;69I;&502P$"% `4````" !ZKD$TC4G7/1($``"^"P``#@`````````!
M`" ```",# ``0D)D96UO+TIA;7)O;W102P$"% `*``````!]KD$T````````
M````````!P```````````! ```#*$ ``0D)D96UO+U!+!08`````&0`9`'('
(``#O$ ``````
`
end


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Please review my current prototype of porting from make to BB

Phillip Seaver
Daniel Einspanjer wrote:
> I have a presentation to my engineering team tomorrow where-in I hope to
> demonstrate to them some of the advantages of moving away from makefiles to
> BB.  The other alternative on the table is ant + cpptasks.
>  
Hopefully, by "tomorrow" you mean Friday.

I don't know about the best way to do it, since I'm not an expert.  I'll
give my opinion, though.  :-)

You could shorten your Jamfile a good bit by doing things like:

local NTDEFINES = _WIN _USE_32BIT_TIME_T WIN32_LEAN_AND_MEAN _WIN32 WIN32 _WIN _WIN32_WINNT=0x0500


..and replace the long list with "<os>NT:<define>$(NTDEFINES)"
http://public.perforce.com/public/jam/src/Jam.html#varexp

The defines that depend on build parameters can be done with a feature.
To borrow from the "variant" feature:

feature demobuild : : implicit composite propagated symmetric ;
feature.compose <demobuild>internal : <define>_AN_INTERNAL_BUILD ;
feature.compose <demobuild>acme : <define>CUSTOMER=Acme ;


Then, you can do "bjam demobuild=internal" or even "bjam internal" (due
to the "implicit" above) to do the builds with _AN_INTERNAL_BUILD
defined.  A potential downside to that is that everything will be built
separately just like debug and release builds.  I haven't quite figured
out yet how to apply a feature like this to selected projects and how to
selectively propagate it to projects that are used by it.

As for things like "<variant>debug:<define>DEBUG", I have them in my
Jamroot as well.  I have _DEBUG defined for debug builds and NDEBUG
defined for release builds.  It seems like a good place to put them to
me.  I also have "build-dir ../bbuild" on the project in Jamroot so that
everything gets built outside of the source tree.

I think the "<os>NT:<cflags>/wd####" lines are specific to Visual C++ .
So, I believe you want "<toolset>msvc:<cflags>...."

Good luck!  I hope this helps.

Phillip Seaver

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Please review my current prototype of porting from make to BB

Daniel Einspanjer
This is fantastic input and exactly the sort of tips I was hoping to hear.
Thank you so much for pointing these things out!

If anyone else has some feedback, I'd love to hear more.

Daniel

"Phillip Seaver" <[hidden email]> wrote in message
news:[hidden email]...

> Daniel Einspanjer wrote:
>> I have a presentation to my engineering team tomorrow where-in I hope to
>> demonstrate to them some of the advantages of moving away from makefiles
>> to
>> BB.  The other alternative on the table is ant + cpptasks.
>>
> Hopefully, by "tomorrow" you mean Friday.
>
> I don't know about the best way to do it, since I'm not an expert.  I'll
> give my opinion, though.  :-)
>
> You could shorten your Jamfile a good bit by doing things like:
>
> local NTDEFINES = _WIN _USE_32BIT_TIME_T WIN32_LEAN_AND_MEAN _WIN32 WIN32
> _WIN _WIN32_WINNT=0x0500
>
>
> ..and replace the long list with "<os>NT:<define>$(NTDEFINES)"
> http://public.perforce.com/public/jam/src/Jam.html#varexp
>
> The defines that depend on build parameters can be done with a feature.
> To borrow from the "variant" feature:
>
> feature demobuild : : implicit composite propagated symmetric ;
> feature.compose <demobuild>internal : <define>_AN_INTERNAL_BUILD ;
> feature.compose <demobuild>acme : <define>CUSTOMER=Acme ;
>
>
> Then, you can do "bjam demobuild=internal" or even "bjam internal" (due
> to the "implicit" above) to do the builds with _AN_INTERNAL_BUILD
> defined.  A potential downside to that is that everything will be built
> separately just like debug and release builds.  I haven't quite figured
> out yet how to apply a feature like this to selected projects and how to
> selectively propagate it to projects that are used by it.
>
> As for things like "<variant>debug:<define>DEBUG", I have them in my
> Jamroot as well.  I have _DEBUG defined for debug builds and NDEBUG
> defined for release builds.  It seems like a good place to put them to
> me.  I also have "build-dir ../bbuild" on the project in Jamroot so that
> everything gets built outside of the source tree.
>
> I think the "<os>NT:<cflags>/wd####" lines are specific to Visual C++ .
> So, I believe you want "<toolset>msvc:<cflags>...."
>
> Good luck!  I hope this helps.
>
> Phillip Seaver
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost-build
>



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build