3 # Call gcc to output a rule suitable for make describing the dependencies of
4 # the given input file and parse the output to add a *.d target with the same
7 # The first two arguments to that script are special: $1 is the object
8 # directory. This string is prefixed to both the .o and the .d target. $2 is
9 # the directory that contains the *.cmdline.h files generated by gengetopt.
11 # As gcc outputs the dependencies on the *.cmdline.h files either as either
12 # foo.cmdline.h or as $cmdline_dir/foo,cmdline.h, depending on whether the
13 # latter file exists, we prefix the former with $2/
20 LC_ALL=C gcc -MM -MG "$@" \
21 | sed -e "s@^\(.*\)\.o:@$object_dir/\1.d $object_dir/\1.o:@" \
22 -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.cmdline.h\)@ $cmdline_dir/\1@g"