File: populate-makefiles.sh

package info (click to toggle)
syslog-ng 4.8.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 20,456 kB
  • sloc: ansic: 177,631; python: 13,035; cpp: 11,611; makefile: 7,012; sh: 5,147; java: 3,651; xml: 3,344; yacc: 1,377; lex: 599; perl: 193; awk: 190; objc: 162
file content (20 lines) | stat: -rwxr-xr-x 631 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/sh

root=$(cd $(dirname $0) && cd .. && pwd)

populate() {
        mfam="$1"
        dir="$(dirname ${mfam})"
        if [ "${dir}" != "." ] && [ "${dir}" != "${root}" ] && [ -d "${dir}" ]; then
                echo "${root}/Mk/subdir.mk" "=>" "${dir}/Makefile"
                ln -sf "${root}/Mk/subdir.mk" "${dir}/Makefile"
        fi
        if [ -e "${root}/${dir}/Makefile.am" ]; then
                incs=$(grep "^include" "${root}/${dir}/Makefile.am" | sed -e "s,^include ,,")
                for inc in ${incs}; do
                        populate "${inc}"
                done
        fi
}

populate ./Makefile.am