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'
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
+
+ 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}
+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}"
+
+
}
--- /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
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
ptxdist mailing list
[email protected]