libs/neuronet: Implemented the new function NNet_GetMaster.
[neuro.git] / scripts / addVPath.sh
blob9e0b9a39286085425a80c61192ed707f3baf1f26
1 #! /bin/bash
3 vpathEntry="srcdir = @srcdir@\nVPATH = @srcdir@"
5 elemCont="^[ \t]\+.*\\\\"
6 elemEnd="^[ #\t]\+.*"
8 outputRest=": r; {N; b r}"
10 globSubdirsTail=": t; /$elemEnd/ {n; b t}; {a\
11 \\\\n$vpathEntry
12 ; $outputRest}"
14 #cat $1 | sed -e "/SUBDIRS/,$ {/$elemCont/! {/$elemEnd/ {$globSubdirsTail}}}" | sed -e "/\(srcdir\|VPATH\)/ {$outputRest}; {$ a\
15 #$vpathEntry
16 #}"
18 if [ `cat $1 | sed -n -e "/\(srcdir\|VPATH\)/ {s/.*/1/p; q}; $ s/.*/0/p"` == "0" ]; then
19 sed -i -e "/SUBDIRS/,$ {/$elemCont/! {/$elemEnd/ {$globSubdirsTail}}}" $1
20 sed -i -e "/\(srcdir\|VPATH\)/ {$outputRest}; {$ a\
21 \\\\n$vpathEntry
22 }" $1