memcmp: Introduce and use consttime_memeq
[secnet] / depend.sh
CommitLineData
d3fe100d
SE
1#!/bin/sh
2
3# For more information see "Recursive Make Considered Harmful" at
4# http://www.canb.auug.org.au/~millerp/rmch/recu-make-cons-harm.html
5
6set -e
7set -u
8
9cutout="$1"
10shift
11
12# cutout may contain the character '.' which means a special thing to sed
13# Escape all '.'s (i.e. '..' -> '\.\.')
14cutout2="`echo ${cutout} | sed -e 's@\.@\\\.@g'`"
15
16# We don't bother depending on system header files (which have names
17# starting with '/'). We arrange for both the .o and the .d file to depend
18# on the appropriate header files. We're using VPATH, so we turn pathnames
19# of the form "${srcdir}/foo" into just "foo" (we expect srcdir to be
20# passed as our first command line argument)
21gcc -M -MG "$@" |
22sed -e 's@ /[^ ]*@@g' -e 's@^\(.*\)\.o:@\1.d \1.o:@' -e "s@${cutout2}/@@g"