summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_lib_dgen.awk
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2010-07-16 21:57:15 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2010-07-19 16:59:13 +0200
commitc1fbf9f85e5947780b4e6a87ac310cf6b55d4f5a (patch)
tree693630ad26116021222897596224e230a7ef492a /scripts/lib/ptxd_lib_dgen.awk
parent04441e3da0055f13f0401c9af0b87f38329914f2 (diff)
downloadptxdist-c1fbf9f85e5947780b4e6a87ac310cf6b55d4f5a.tar.gz
ptxdist-c1fbf9f85e5947780b4e6a87ac310cf6b55d4f5a.tar.xz
[dgen] create non-existing source stages
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_lib_dgen.awk')
-rw-r--r--scripts/lib/ptxd_lib_dgen.awk27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index 728fecd3c..b6188124a 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -108,6 +108,28 @@ $1 ~ /^[A-Z_]*PACKAGES/ {
next;
}
+#
+# Look for <PKG>_SOURCE definitions and corresponding rules to determine
+# which rules must be generated.
+# This assumes:
+# "<PKG>_SOURCE := ...." defined a new source.
+# "<PKG>_SOURCE = ...." reuses another source ('=' because the order is unknown)
+# "(<PKG>_SOURCE):" defined a souce rule.
+#
+# Default rules will be generated for all new souces with no source rule.
+#
+# out:
+# PKG_source_url array with value '1' for all PKG with new source.
+# PKG_source_rule array with value '1' for all PKG with source rule.
+#
+$0 ~ /^[A-Z0-9_]*_SOURCE[[:space:]]*:=.*/ {
+ PKG = gensub(/^([A-Z0-9_]*)_SOURCE[[:space:]]*:=.*/, "\\1", "g");
+ PKG_source_url[PKG] = 1;
+}
+$1 ~ /^\$\([A-Z0-9_]*_SOURCE\):$/ {
+ PKG = gensub(/^\$\(([A-Z0-9_]*)_SOURCE\):$/, "\\1", "g", $1);
+ PKG_source_rule[PKG] = 1;
+}
#
# parses "PTX_MAP_DEP_PKG=FOO" lines, which are the raw dependencies
@@ -289,6 +311,11 @@ END {
print "$(STATEDIR)/" this_pkg ".targetinstall: " "$(STATEDIR)/" this_pkg ".install.post" > DGEN_DEPS_POST;
print "$(STATEDIR)/" this_pkg ".targetinstall.post: " "$(STATEDIR)/" this_pkg ".targetinstall" > DGEN_DEPS_POST;
}
+ if ((this_PKG in PKG_source_url) && !(this_PKG in PKG_source_rule)) {
+ print "$(" this_PKG "_SOURCE):" > DGEN_DEPS_POST;
+ print " @$(call targetinfo)" > DGEN_DEPS_POST;
+ print " @$(call get, " this_PKG ")" > DGEN_DEPS_POST;
+ }
#
# conditional dependency on autogen script