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 four arguments to that script are special: $1 is the
8 # dependency directory and $2 is the object directory. These are used
9 # to prefix the .d and .o targets respectively. $3 is the directory
10 # that contains the *.cmdline.h files generated by gengetopt. Similarly,
11 # $4 is the command list directory which contains all files generated by
12 # the command_util script.
14 # As gcc outputs the dependencies on the *.cmdline.h files either as
15 # foo.cmdline.h or as $cmdline_dir/foo.cmdline.h, depending on whether the
16 # latter file exists, we prefix the former with $2/
27 LC_ALL=C cc -MM -MG "$@" \
28 | sed -e "s@^\(.*\)\.o:@$dep_dir/\1.d $object_dir/\1.o:@" \
29 -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.cmdline.h\)@ $cmdline_dir/\1@g" \
30 -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.command_list.h\)@ $cmdlist_dir/\1@g" \
31 -e "s@[ ^]\([a-zA-Z0-9_]\{1,\}\.completion.h\)@ $cmdlist_dir/\1@g"