- foreach (@{$depends{$dest}}) {
- my $d = cleanfile($sourced, $_, $blddir);
- my $d2 = cleanfile($buildd, $_, $blddir);
+ foreach my $f (@{$depends{$dest}}) {
+ # If the dependency destination is generated, dependencies
+ # may have an extra syntax to separate the intended inclusion
+ # directory from the module to be loaded: a | instead of a
+ # / as directory separator.
+ # Do note that this has to be handled in the build file
+ # template as well.
+ # $i = inclusion path in source directory
+ # $i2 = inclusion path in build directory
+ # $m = module path (within the inclusion path)
+ # $i = full module path in source directory
+ # $i2 = full module path in build directory
+ my $i; my $i2; my $m; my $d; my $d2;
+ if ($unified_info{generate}->{$ddest}
+ && $f =~ m/^(.*?)\|(.*)$/) {
+ $i = $1;
+ $m = $2;
+ # We must be very careful to modify $i last
+ $d = cleanfile($sourced, "$i/$m", $blddir, 1);
+ $d2 = cleanfile($buildd, "$i/$m", $blddir);
+ $i2 = cleandir($buildd, $i, $blddir);
+ $i = cleandir($sourced, $i, $blddir, 1);
+ } else {
+ $d = cleanfile($sourced, $f, $blddir, 1);
+ $d2 = cleanfile($buildd, $f, $blddir);
+ }