From 2548d14b82b4baab29b7b680ec799042983dff8f Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 10 Sep 2018 17:38:14 +0200 Subject: 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. --- bootstrap | 57 +++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 10 deletions(-) (limited to 'bootstrap') 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/" -- cgit v1.2.3