gas-preprocessor icon indicating copy to clipboard operation
gas-preprocessor copied to clipboard

gcc options "-MT anything.o" should not be changed to "-MT -"

Open make4ppc opened this issue 15 years ago • 0 comments

The -MT option is used to specify the name of the make target that will be written to the file indicated by -MF. "-" is not a proper make target, thus "-MT anything.o" should not be changed to "-MT -".

A fix for this problem may look like this:

remove this line:

@preprocess_c_cmd = map { /.o$/ ? "-" : $_ } @preprocess_c_cmd;

add these lines:

Want to change "-o <anything.o>" into "-o -"

but it is not correct to change "-MT <anything.o>" into "-MT - "

my $i; my $o_flag = 0; for ($i = 1; $i < @preprocess_c_cmd; $i++) { if ($preprocess_c_cmd[$i] eq "-o") { $o_flag = 1; } elsif ($o_flag) { $o_flag = 0; if ($preprocess_c_cmd[$i] =~ /.o$/) { $preprocess_c_cmd[$i] = "-"; } } }

make4ppc avatar Jul 14 '10 01:07 make4ppc