forked from Imagelibrary/rtems
build: Include header.am in cpukit/Makefile.am
Include all cpukit/*/header.am files in cpukit/Makefile.am. This gets rid of all subtree Makefile.am and the sudirs hack.
This commit is contained in:
57
bootstrap
57
bootstrap
@@ -81,21 +81,58 @@ headers)
|
||||
exit 1
|
||||
fi
|
||||
base="$PWD"
|
||||
|
||||
# Generate cpukit/header-dirs.am
|
||||
tmp="$base/cpukit/header-dirs.am.new"
|
||||
hdr_dirs=`for i in cpukit/include cpukit/libnetworking cpukit/score/cpu/*/include ; do
|
||||
cd "$i"
|
||||
find -mindepth 1 -type d
|
||||
cd "$base"
|
||||
done | sort -u | sed 's%^\./%%'`
|
||||
echo '## This file was generated by "./boostrap -H".' > "$tmp"
|
||||
echo 'include_HEADERS =' >> "$tmp"
|
||||
for dir in $hdr_dirs ; do
|
||||
am_dir=`echo $dir | sed 's%[/-]%_%g'`
|
||||
echo "include_${am_dir}dir = \$(includedir)/$dir" >> "$tmp"
|
||||
echo "include_${am_dir}_HEADERS =" >> "$tmp"
|
||||
done
|
||||
diff -q "$tmp" "cpukit/header-dirs.am" || mv "$tmp" "cpukit/header-dirs.am"
|
||||
rm -f "$tmp"
|
||||
|
||||
# Generate cpukit/*/headers.am
|
||||
tmp="$base/headers.am.new"
|
||||
for i in cpukit/include cpukit/score/cpu/*/include bsps/include bsps/*/include bsps/*/*/include ; do
|
||||
cpukit="$base/cpukit"
|
||||
cd "$cpukit"
|
||||
for inc in include score/cpu/*/include ; do
|
||||
echo '## This file was generated by "./boostrap -H".' > "$tmp"
|
||||
hdr=`dirname $inc`
|
||||
am_dir=""
|
||||
cd $inc
|
||||
for b in `find -type d | sort` ; do
|
||||
for j in `find $b -mindepth 1 -maxdepth 1 -name '*.h' | sed 's%^\.%%' | sed 's%^/%%' | sort` ; do
|
||||
dir=`dirname $j`
|
||||
if test x$dir != x. ; then
|
||||
am_dir=`echo $dir | sed 's%[/-]%_%g'`
|
||||
am_dir="_$am_dir"
|
||||
else
|
||||
am_dir=""
|
||||
fi
|
||||
echo "include${am_dir}_HEADERS += $inc/$j" >> "$tmp"
|
||||
done
|
||||
done
|
||||
cd "$cpukit"
|
||||
diff -q "$tmp" "${hdr}/headers.am" || mv "$tmp" "${hdr}/headers.am"
|
||||
done
|
||||
rm -f "$tmp"
|
||||
cd "$base"
|
||||
|
||||
# Generate bsps/*/headers.am
|
||||
tmp="$base/headers.am.new"
|
||||
for i in bsps/include bsps/*/include bsps/*/*/include ; do
|
||||
dir=""
|
||||
am_dir=""
|
||||
echo '## This file was generated by "./boostrap -H".' > "$tmp"
|
||||
case $i in
|
||||
cpukit/include)
|
||||
hdr="../"
|
||||
inc="include/"
|
||||
;;
|
||||
cpukit/score/cpu/*/include)
|
||||
hdr="../"
|
||||
inc=`echo $i | cut -d'/' -f5-`
|
||||
inc="$inc/"
|
||||
;;
|
||||
bsps/*/*/include)
|
||||
hdr="../"
|
||||
inc="../../../../../../$i/"
|
||||
|
||||
Reference in New Issue
Block a user