SED=cat
: ${CC=cc} # use cc by default
-: ${CC_MKDEP=$CC} # select default compiler to generate dependencies
-: ${CC_MKDEP_FLAGS="-M"} # cc -M usually produces dependencies
while :
do case "$1" in
SRCDIR=$2
shift; shift ;;
- # -c allows you to select a compiler to use to generate
- # dependencies. Leaves $CC alone.
+ # -c allows you to override the default compiler.
-c)
+ CC=$2
+ shift; shift ;;
+
+ # -m allows you to override the compiler used to generate
+ # dependencies.
+ -m)
CC_MKDEP=$2
shift; shift ;;
+ # -m allows you to override the compiler flags used to generate
+ # dependencies.
+ -x)
+ CC_MKDEP_FLAGS=$2
+ shift; shift ;;
+
# the -p flag produces "program: program.c" style dependencies
# so .o's don't get produced
-p)
esac
done
+: ${CC_MKDEP=$CC} # select default compiler to generate dependencies
+: ${CC_MKDEP_FLAGS="-M"} # cc -M usually produces dependencies
+
if test $# = 0 ; then
- echo 'usage: mkdep [-p] [-s] [-c cc] [-f makefile] [-d srcdir] [flags] file ...'
+ echo 'usage: mkdep [-p] [-s] [-c cc] [-m cc] [-x flags] [-f makefile] [-d srcdir] [cppflags] file ...'
exit 1
fi
files="$files $i"
fi
done
- CC="$CC -I$SRCDIR"
+
+ CC_MKDEP_FLAGS="$CC_MKDEP_FLAGS -I$SRCDIR"
fi
cat << _EOF_ >> $TMP