diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-09-10 17:38:14 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-10 14:06:28 +0200 |
commit | 2548d14b82b4baab29b7b680ec799042983dff8f (patch) | |
tree | a604fdea7675d3af51e069c7df1a839f89d7541d /bootstrap | |
parent | 629faf95046cddedc161ba9bc43fda925ca04ee5 (diff) |
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-x | bootstrap | 57 |
1 files changed, 47 insertions, 10 deletions
@@ -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/" |