Experimental fix to remove unrequired dependencies.

This commit is contained in:
Luka Vandervelden 2019-07-08 04:29:05 +02:00
parent 1d141a64d6
commit 939295f95a
2 changed files with 13 additions and 3 deletions

View File

@ -174,10 +174,20 @@ function duplicated {
function dirdep {
dirname="$(dirname "$1")"
local sources=(${(@s/ /)2})
local depends=(${(@s/ /)3})
if [[ "$dirname" != "." ]]; then
echo "$dirname"
for dep in ${sources[@]} ${depends[@]}; do
if [[ "$(dirname $dep)" == "$dirname" ]]; then
return 0
fi
done
if [[ "$dirname" == "." ]]; then
return 0
fi
echo "$dirname"
}
for dir in "@SHAREDIR@/build.zsh" ./build; do

View File

@ -1,7 +1,7 @@
function ofile.build {
local dirname="$(dirname "$target")"
write -n "${target}: ${target%.o}.c $(dirdep $target)"
write -n "${target}: ${target%.o}.c $(dirdep $target "${target%.o}.c ${sources[$target]}" "${depends[@target]}")"
sed '/^#include "/!d;s/^#include "//;s/"$//' "${target%.o}.c" | \
while read h; do