HomeFreeBSD

Fix regression from r289734 that caused crunchgen "subdirs" to not be

Description

Fix regression from r289734 that caused crunchgen "subdirs" to not be
properly recursed.

The .for loop was defining a ${dir} variable that was being set at a
different evaluation time than the target itself, so every 'cd ${
dir}'
became the last value that was in ${__dir}. This resulted in 'make obj'
not properly being ran in the tree that would leave .depend files
scattered around when 'make all' was ran in rescue/.

To fix this, define a CRUNCH_SRCDIR_* for every prog if it does not
already have one and then use that variable in every relevant place.
This allows simplifying some logic as well.

Reported by: emaste
X-MFC-With: r289734
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division

Details

Provenance
bdreweryAuthored on
Parents
rS289845: Fix various Coverity issues in sbin/savecore/savecore.c:
Branches
Unknown
Tags
Unknown