change on-disk names
[AROS.git] / scripts / mkdep
blob3516281d7913358d4b7856ab2a9c7edd893501ae
1 #!/bin/sh
3 while [ $# != 0 ]; do
4 case "$1" in
5 -o)
6 dest="$2"
7 shift
8 ;;
9 -o*)
10 dest="`echo $1 | cut -c3-`"
12 -g|-Wall|-O*)
14 -D|-I)
15 args="$args '$1' '$2'"
16 shift
18 *.c)
19 files="$files '$1'"
21 *.cc)
22 files="$files '$1'"
24 *.cpp)
25 files="$files '$1'"
27 *.m)
28 files="$files '$1'"
31 args="$args '$1'"
33 esac
34 shift
35 done
37 if [ "x$files" = x ]; then
38 exit 0
41 if [ "x$dest" = x ]; then
42 echo "$0: Error: -o missing"
43 exit 1
46 if [ "x$AROS_CC" = x ]; then
47 echo "$0: Error: AROS_CC not defined"
48 exit 1
51 CMD="$AROS_CC -M $args $files | sed 's#^.*\.o:#`dirname $dest`/&#'"
52 #echo $CMD
54 eval $CMD > $dest