Robert Schwebel wrote:
> On Fri, Nov 21, 2008 at 03:42:15PM -0700, Gary Thomas wrote:
>> From: Gary Thomas <[EMAIL PROTECTED]>
>>
>> By only including those [sub] makefiles which are actually used in the
>> build, the process runs faster and also avoids the dreaded error
>>   'bash: line too long'

Are you actually affected by this problem? Where do you think will it
hit us first?

>> Signed-off-by: Gary Thomas <[EMAIL PROTECTED]>
>> ---
>>
>> --- /work/ptxdist-trunk/rules/other/Toplevel.make    2008-11-19 
>> 07:55:29.000000000 -0700
>> +++ /tmp/ptx-2008_11_21/ptx/rules/other/Toplevel.make        2008-11-19 
>> 08:07:42.000000000 -0700
>> @@ -37,7 +37,7 @@ include $(wildcard $(PROJECTPRERULESDIR)
>>  endif
>>  
>>  #include $(PTX_DGEN_DEPS_PRE)
>> -include $(PTX_DGEN_RULESFILES_MAKE)
>> +include $(PTX_DGEN_RULESFILES_MAKE_MIN)
>>  include $(PTX_DGEN_DEPS_POST)
>>  
>>  include $(PTX_MAP_ALL_MAKE)
>> --- /work/ptxdist-trunk/scripts/lib/ptxd_lib_dgen.sh 2008-11-14 
>> 06:38:57.000000000 -0700
>> +++ /tmp/ptx-2008_11_21/ptx/scripts/lib/ptxd_lib_dgen.sh     2008-11-19 
>> 07:45:17.000000000 -0700
>> @@ -41,6 +41,30 @@ ptxd_dgen_rulesfiles() {
>>      ) > "${PTX_DGEN_RULESFILES}"
>>  
>>      sed -e "s/\(.*\)/include \1/" "${PTX_DGEN_RULESFILES}" > 
>> "${PTX_DGEN_RULESFILES_MAKE}"
>> +
>> +    # Compute minimal set of makefiles
>> +    
>> +    # Compute the package strings
>> +    xargs <${PTX_DGEN_RULESFILES} fgrep -h 'PACKAGES-$' 
>> >${PTXDIST_TEMPDIR}/pkg_names

Nice trick to get rid of the cmdline length limitation.

please use double quotes (") around the variables to protect against
spaces in files names. Ladis is working to get ptxdist running on windows.

>> +
>> +    cat >${PTXDIST_TEMPDIR}/show_pkgs <<EOF
>> +# Read in configuration
>> +include  ${PTXDIST_PTXCONFIG}
>> +include  ${PTXDIST_PLATFORMCONFIG}
>> +
>> +# Figure out packages
>> +include ${PTXDIST_TEMPDIR}/pkg_names
>> +
>> +all:
>> +    @echo \${PACKAGES-y} \${PACKAGES-m} \${HOST_PACKAGES-y} 
>> \${HOST_PACKAGES-m} \${CROSS_PACKAGES-y} \${CROSS_PACKAGES-m}

you'll miss the PACKAGES "-y-y" and "-y-m". See Toplevel.make

>> +EOF
>> +
>> +    PKGS=`make -f ${PTXDIST_TEMPDIR}/show_pkgs`
>> +    ( for i in ${PKGS}; do
>> +    grep /${i} ${PTX_DGEN_RULESFILES_MAKE}
>> +    done ) > "${PTX_DGEN_RULESFILES_MAKE_MIN}"

Here you assume, that the PKG correspond directly to the file name,
there might be subtle differences in case and/or usage of hyphen vs.
underscore.

We have a file "state/ptx_map_all.sh" which contains a "database" to map
from PACKAGE name to file name. This file can be extended to map from
package name to file name.

However the "grep" over the makefile names probably handles the case
when building a host packet while not enabling the target packet.

>> +
>> +
>>  }
>>  
>>  
>> --- /work/ptxdist-trunk/scripts/ptxdist_vars.sh      2008-11-14 
>> 06:38:57.000000000 -0700
>> +++ /tmp/ptx-2008_11_21/ptx/scripts/ptxdist_vars.sh  2008-11-19 
>> 07:45:18.000000000 -0700
>> @@ -27,6 +27,7 @@ PTX_DGEN_DEPS_PRE=${STATEDIR}/ptx_dgen_d
>>  PTX_DGEN_DEPS_POST=${STATEDIR}/ptx_dgen_deps.post
>>  PTX_DGEN_RULESFILES=${STATEDIR}/ptx_dgen_rulesfiles
>>  PTX_DGEN_RULESFILES_MAKE=${PTX_DGEN_RULESFILES}.make
>> +PTX_DGEN_RULESFILES_MAKE_MIN=${PTX_DGEN_RULESFILES}_min.make
>>  
>>  PTX_MAP_ALL=${STATEDIR}/ptx_map_all.sh
>>  PTX_MAP_ALL_MAKE=${PTX_MAP_ALL}.make

cheers, Marc

-- 
 Marc Kleine-Budde              Phone: +49-231-2826-924
 Pengutronix - Linux Solutions for Science and Industry
 Vertretung West/Dortmund     http://www.pengutronix.de

Attachment: signature.asc
Description: OpenPGP digital signature

--
ptxdist mailing list
[email protected]

Reply via email to