summaryrefslogtreecommitdiff
path: root/src/modules/configure
blob: 453ba7de57bc8f3372e730b03b39536c82ffa751 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh

oldpath=`pwd`

if [ $1 ]; then
	cd $1
fi

echo2 () {
    $ECHO2 "$*$ECHO2SUF"    # these are defined later
}

ECHO2SUF=''
if [ "`echo -n a ; echo -n b`" = "ab" ] ; then
        ECHO2='echo -n'
elif [ "`echo 'a\c' ; echo 'b\c'`" = "ab" ] ; then
        ECHO2='echo' ; ECHO2SUF='\c'
elif [ "`printf 'a' 2>&1 ; printf 'b' 2>&1`" = "ab" ] ; then
        ECHO2='printf "%s"'
else
        # oh well...
        ECHO2='echo'
fi
export ECHO2 ECHO2SUF


echo2 "SRCS=" > ./Makefile.inc
FIRST=1
for oldfile in `ls -1 *.c *.cpp`
do
	if [ "$FIRST" = 1 ] ; then
		echo2 " "$oldfile >> ./Makefile.inc
	else
		echo "\\" >> ./Makefile.inc
		echo2 "     " $oldfile >> ./Makefile.inc
	fi
	FIRST=0
done
echo "" >> ./Makefile.inc

echo2 "SUBS=" >> ./Makefile.inc
FIRST=1
for dir in *
do
        if [ -d $dir ] ; then
	        if [ -f $dir/configure ] ; then
			cd $dir
			./configure
			cd ..
		fi
		if [ -f $dir/Makefile ] ; then
			if [ "$FIRST" = 1 ] ; then
				echo2 " "$dir >> ./Makefile.inc
		        else
				echo "\\" >> ./Makefile.inc
				echo2 "     " $dir >> ./Makefile.inc
			fi
			FIRST=0
		fi
	fi
done

cd $oldpath

exit 0