summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_lib_dgen.awk
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2016-07-26 20:32:40 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-08-01 09:24:28 +0200
commit66a451a613ba4e90faebb696db6c2091d8a03177 (patch)
treed78a3cfe8fdaaba5a3e414aec431e27a4d0cee3a /scripts/lib/ptxd_lib_dgen.awk
parent4ea1295e985f92e5597bc44e1f58b1da2201cfcf (diff)
downloadptxdist-66a451a613ba4e90faebb696db6c2091d8a03177.tar.gz
ptxdist-66a451a613ba4e90faebb696db6c2091d8a03177.tar.xz
ptxd_lib_dgen: make sure makefiles are only included once
There are usecases where more than on 'PACKAGES-... += ...' in one makefile is useful. This ensures that the makefile is only included once in this case. 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.awk9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/lib/ptxd_lib_dgen.awk b/scripts/lib/ptxd_lib_dgen.awk
index aeea3a8f0..e5cdd2c63 100644
--- a/scripts/lib/ptxd_lib_dgen.awk
+++ b/scripts/lib/ptxd_lib_dgen.awk
@@ -102,7 +102,11 @@ $1 ~ /^[A-Z_]*PACKAGES-/ {
PKG_to_pkg[this_PKG] = this_pkg;
pkg_to_PKG[this_pkg] = this_PKG;
- PKG_to_filename[this_PKG] = FILENAME;
+ # make sure each file is only included once
+ if (FILENAME) {
+ PKG_to_filename[this_PKG] = FILENAME;
+ FILENAME = "";
+ }
print "PTX_MAP_TO_package_" this_PKG "=\"" this_pkg "\"" > MAP_ALL;
print "PTX_MAP_TO_package_" this_PKG "=" this_pkg > MAP_ALL_MAKE;
@@ -201,7 +205,8 @@ function write_include(this_PKG) {
#
# include this rules file
#
- print "include " PKG_to_filename[this_PKG] > DGEN_RULESFILES_MAKE;
+ if (this_PKG in PKG_to_filename)
+ print "include " PKG_to_filename[this_PKG] > DGEN_RULESFILES_MAKE;
}
function write_maps(this_PKG, dep_type) {