openssl/util/domd
Rich Salz 723acb1445 Merge error, wrong domd submitted.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-01-29 11:36:21 -05:00

35 lines
805 B
Bash
Executable File

#!/bin/sh
# Wrapper to portably run makedepend or equivalent compiler built-in.
# Runs on Makefile.in, generates Makefile
TOP=$1
shift
if [ "$1" = "-MD" ]; then
shift
MAKEDEPEND=$1
shift
if [ "$MAKEDEPEND" = "ccache" ]; then
MAKEDEPEND="$MAKEDEPEND $1"
shift
fi
fi
if [ -z "$MAKEDEPEND" ] ; then
MAKEDEPEND=makedepend
fi
if ${MAKEDEPEND} --version 2>&1 | egrep "clang|gcc" >/dev/null ; then
args=""
while [ $# -gt 0 ]; do
if [ "$1" != '--' ] ; then
args="$args $1"
fi
shift
done
${MAKEDEPEND} -Werror -DOPENSSL_DOING_MAKEDEPEND -M $args >Makefile.tmp || exit 1
cat Makefile.in Makefile.tmp >Makefile
rm Makefile.tmp
else
cp Makefile.in Makefile
${MAKEDEPEND} -DOPENSSL_DOING_MAKEDEPEND $@ || exit 1
fi