diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-07-02 13:57:17 +0200 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2018-07-10 13:53:59 +0200 |
commit | a49969a3cc4854e3c1729bafb8b71dbed67d47cf (patch) | |
tree | b53db8d4c9501e44977f4eabbeac356707fdd114 /scripts/lib/ptxd_lib_dgen.awk | |
parent | a835af354d8b2413744dd54f18db4fc72b288daa (diff) | |
download | ptxdist-a49969a3cc4854e3c1729bafb8b71dbed67d47cf.tar.gz ptxdist-a49969a3cc4854e3c1729bafb8b71dbed67d47cf.tar.xz |
improve dependency handling
Check the content of make and in files for packages in addition to the
package options to trigger the prepare stage.
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.awk | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk index aa38eadfb..93f72d3c6 100644 --- a/scripts/lib/ptxd_lib_dgen.awk +++ b/scripts/lib/ptxd_lib_dgen.awk @@ -78,6 +78,20 @@ $0 ~ /^include[[:space:]]+\/.*\.make$/ { } +function dump_file(src, dst) { + if (!src) + return + + old_RS = RS + RS = "^$" + getline tmp < src + print tmp >> dst + RS = old_RS + close(src) + close(dst) +} + + # # parse "PACKAGES-$(PTXCONF_PKG) += pkg" lines, i.e. rules-files from # rules/*.make. Setup mapping between upper and lower case pkg names @@ -100,6 +114,7 @@ $1 ~ /^[A-Z_]*PACKAGES-/ { exit 1 } + PKG_to_makefile[this_PKG] = FILENAME; PKG_to_pkg[this_PKG] = this_pkg; pkg_to_PKG[this_pkg] = this_PKG; # make sure each file is only included once @@ -168,6 +183,12 @@ $1 ~ /^PTX_MAP_._DEP/ { next; } +$1 ~ /^PTX_MAP_._SOURCE/ { + this_PKG = gensub(/PTX_MAP_._SOURCE_/, "", "g", $1); + if (this_PKG in PKG_to_pkg) + PKG_to_infile[this_PKG] = $2; + next; +} # # parse the ptx- and platformconfig @@ -316,6 +337,7 @@ function write_deps_pkg_active(this_PKG, this_pkg, prefix) { print "$(STATEDIR)/" this_pkg ".extract: " "$(STATEDIR)/" this_pkg ".get" > DGEN_DEPS_POST; print "$(STATEDIR)/" this_pkg ".extract.post: " "$(STATEDIR)/" this_pkg ".extract" > DGEN_DEPS_POST; print "$(STATEDIR)/" this_pkg ".prepare: " "$(STATEDIR)/" this_pkg ".extract.post" > DGEN_DEPS_POST; + print "$(STATEDIR)/" this_pkg ".prepare: " "$(STATEDIR)/" this_pkg ".$(" this_PKG "_CFGHASH).cfghash" > DGEN_DEPS_POST; print "$(STATEDIR)/" this_pkg ".tags: " "$(STATEDIR)/" this_pkg ".prepare" > DGEN_DEPS_POST; print "$(STATEDIR)/" this_pkg ".compile: " "$(STATEDIR)/" this_pkg ".prepare" > DGEN_DEPS_POST; print "$(STATEDIR)/" this_pkg ".install: " "$(STATEDIR)/" this_pkg ".compile" > DGEN_DEPS_POST; @@ -470,6 +492,11 @@ END { } else write_deps_pkg_active_image(this_PKG, this_pkg, this_pkg_prefix) + + if (this_PKG in PKG_to_infile) + dump_file(PKG_to_infile[this_PKG], PTXDIST_TEMPDIR "/pkghash-" this_PKG); + if (this_PKG in PKG_to_makefile) + dump_file(PKG_to_makefile[this_PKG], PTXDIST_TEMPDIR "/pkghash-" this_PKG); } close(PKG_HASHFILE); |