summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-10 17:38:14 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-10 14:06:28 +0200
commit2548d14b82b4baab29b7b680ec799042983dff8f (patch)
treea604fdea7675d3af51e069c7df1a839f89d7541d /bootstrap
parent629faf95046cddedc161ba9bc43fda925ca04ee5 (diff)
downloadrtems-2548d14b82b4baab29b7b680ec799042983dff8f.tar.bz2
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.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap57
1 files changed, 47 insertions, 10 deletions
diff --git a/bootstrap b/bootstrap
index 8e284a552e..7ed592d435 100755
--- a/bootstrap
+++ b/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/"