Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
make4ppc opened this issue Jul 14, 2010 · 0 comments
Open

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

make4ppc opened this issue Jul 14, 2010 · 0 comments

Comments

@make4ppc
Copy link

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] = "-";
}
}
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant