[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #18963] -include suppressing errors for too long?
From: |
Tobias Blomberg |
Subject: |
[bug #18963] -include suppressing errors for too long? |
Date: |
Sat, 21 Apr 2007 11:10:15 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070313 Fedora/1.5.0.10-5.fc6 Firefox/1.5.0.10 |
Follow-up Comment #4, bug #18963 (project make):
Is this really the way it is supposed to work. It didn't work like that in
previous releases of make. To exemplify, I want a makefile with automatic
dependencies. If I write it like this:
--- Makefile ---
all: hello
include hello.d
%.d: %.c
$(CC) -M -MG -MT "$*.o $@" -MF $@ $<
------
--- hello.c ---
#include <stdio.h>
int main()
{
printf("Hello\n");
}
------
I will get the following output if hello.d does not exist.
Makefile:6: hello.d: No such file or directory
cc -M -MG -MT "hello.o hello.d" -MF hello.d hello.c
cc -c -o hello.o hello.c
cc hello.o -o hello
I want to get rid of the error message (because it isn't an error) so I put a
"-" infront of the include directive in the makefile. Everything looks fine
until I try to include a file that does not exist (e.g. hello.h) in hello.c.
Then I will get the following output:
cc -M -MG -MT "hello.o hello.d" -MF hello.d hello.c
The compilation just stops with no error message. The exit code is 2 if one
checks it. What I expect is a row like:
make: *** No rule to make target `hello.h', needed by `hello.d'. Stop.
This was the way it worked in earlier releases of make. Maybe there is
another way around this but I cannot find it.
Regards,
Tobias
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?18963>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #18963] -include suppressing errors for too long?,
Tobias Blomberg <=