;ς |oPFc@s΄dZdkZdkZdkZdkZdkZdkZdkZdkZdkl Z l Z l Z gZ d„Z d„Zdfd„ƒYZhZd„Zhad„ZdS( s  genobj is an abstract class for declaring targets: - creates tasks (consisting of a task, an environment, a list of source and list of target) - sets environment on the tasks (which are copies most of the time) - modifies environments as needed - genobj cannot be used as it is, so you must create a subclass subclassing - makes it possible to share environment copies for several objects at once (efficiency) - be careful to call Object.genobj.__init__(...) in the __init__ of your subclass - examples are ccroot, ocamlobj, .. hooks - declare new kind of targets quickly (give a pattern ? and the action name) - several extensions are mapped to a single method - they do not work with all objects (work with ccroot) - cf bison.py and flex.py for more details on this scheme N(sdebugserrorsfatalcCsƒti}tddƒtitiƒ}|ii tiƒ}|i |i ƒo |i }ntiiotiiidƒ}nt}xσ|iD]θ}tddƒ|ioq“n|o%|i}|i |ƒ oq“qγn|oX|io|i|j otddƒq“n|i|j otddƒq“qBn|iƒtiidjodGtitiƒƒGHq“q“Wd S( s@object instances under the launch directory create the tasks nows'delayed operation Object.flush() calledsobjects,sposting objectsskipping because of namesskipping because of targetis flushed at N(sParamssg_buildstreesdebugsUtilss split_paths g_cwd_launchsdir_lstsm_rootsfind_dirslaunch_dir_nodes is_child_ofs m_bldnodes m_srcnodes g_optionsscompile_targetsssplitsNonesm_outstanding_objssobjsm_postedspathsobjnodesnamestargetspostsverbosestimesasctimes localtime(scompile_targetssobjslaunch_dir_nodestreesobjnodesdir_lst((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysflushs:             cCsYt|}||i| self.sourcesOBJECT ALREADY POSTEDNi( sselfsenvsParamssg_builds m_allenvssnamestargetssourcesserrorsAttributeErrorsm_postedsapply(sself((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pyspostss     i cCsG|tjo |i}nti|||ƒ}|ii|ƒ|SdS(s9the lower the nice is, the higher priority tasks will run at groups are sorted in ascending order [2, 3, 4], the tasks with lower nice will run first if tasks have an odd priority number, they will be run only sequentially if tasks have an even priority number, they will be allowed to be run in parallel N( senvsNonesselfsTaskstypesnicestasksm_taskssappend(sselfstypesenvsnicestask((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pys create_taskƒs  cCstdƒdS(s Subclass mes subclass me!N(sfatal(sself((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysapplyŽscCsdS(s subclass meN((sself((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysinstall’scCsdS(ssubclass me if necessaryN((sself((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pyscleanup–si€csNtddƒtii‰t‡d†|iƒ}t i |||d|ƒdS(Nsinstall results calledsobjectcs |iˆƒS(N(sas relpath_genscurrent(sa(scurrent(sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pyssschmod(sdebugsParamssg_builds m_curdirnodescurrentsmapstasks m_outputsslstsCommons install_filessvarssubdirschmod(sselfsvarssubdirstaskschmodscurrentslst((scurrentsM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysinstall_resultsšs  cCsmti|ƒ}t|ƒtijoti i ||_n ||_t i |ƒti i i |ƒ|SdS(N(sUtilsscopyobjsselfsnewobjstypesenvstypess StringTypesParamssg_builds m_allenvss g_allobjssappendsm_outstanding_objs(sselfsenvsnewobj((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysclone s  cCs,t|ƒtijo|iƒSn|SdS(shelper: returns a listN(stypesvaluestypess StringTypessplit(sselfsvalue((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysto_list­sc Cslg}|i|ƒ}|i|ƒ}g}||i7}y0x)|iidD]} ||i | 7}qKWWnt j onXxΑ|D]Ή}|i iti|ƒƒ} tii| ƒx…| iƒD]w} ti i| iƒ\}}||joI| i|i ƒ}||j o%||joqΒn|i|ƒq9qΒqΒWq„W|iƒ|i ddi!|ƒ|_ dS(ssubclass if necessarys all_hookss N("slstsselfsto_listsexcludessdirnamessext_lsts s_default_exts __class__s__dict__svarsenvsKeyErrorsnamespathsensure_node_from_lstsUtilss split_pathsanodesParamssg_buildsrescansfilessfilesosssplitextsm_namesbasesextsrelpathsssappendssortssourcesjoin( sselfsdirnamessexcludessextsnamessslstsext_lstsbasesanodesfilesvar((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysfind_sources_in_dirs²s6     (s__name__s __module__s__init__sget_valid_typessget_hookspostsNones create_tasksapplysinstallscleanupsinstall_resultssclonesto_listsfind_sources_in_dirs(((sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysgenobjKs        cs’tˆig|ƒ}y t|SWntj onXt‡d†|ƒ}t i |ƒ}t i o*t dt i|ƒt|ƒfdƒn|t|<|SdS(s ['CXX', ..] -> [env['CXX'], ..]cs ˆi|ƒS(N(senvsget_flatsa(sa(senv(sM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pysήss%s %ssenvhashN(sstrsenvsm_idxs vars_listsss g_cache_maxsKeyErrorsmapslstsParamssh_listsretsg_zonessdebugsvsig(senvs vars_listslstsretss((senvsM/mnt/gmirror/ports/audio/ruby-xmms2/work/xmms2-0.2DrJekyll/wafadmin/Object.pys sign_env_varsΥs  * cCs4|tjotd|dƒdSn|t|