[Dev-C++] bug related to makefile.win and "fast dependency generation"
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luigi S. <gi...@li...> - 2002-09-28 08:50:19
|
Hello Colin,
Probably I've found a bug in Dev-C++ 4.9.5.0.
I'm not sure, maybe I'm just missing something so allow me illustrate my
point using a simple example.
Among the compiler options one is allowed to set, there is one related to
how dependencies are generated within a makefile.
What I'm talking about is the option you find as follows:
menu : "Tools"->"Compiler Options"
tab : "Code Generation/Optimization"
section : "Makefile generation"
box : "Use fast but imperfect dependency generation"
Say that one has the following 3 unit program (all files are in the same
directory)
hello.c
--------
#include <stdio.h>
#include "newline.h"
int
main()
{
printf("Hello world!");
newline(); /* print a newline */
return 0;
}
--------
newline.h
---------
void
newline(void);
---------
newline.c
---------
#include <stdio.h>
#include "newline.h"
void
newline(void)
{
putchar('\n');
}
---------
And that the executable file has to be made using Dev-C++.
I would do the following:
- create a console application project which includes the 3 units
- ask Dev-C++ to compile the project
Dev-C++ deals with compilation of projects, by makefiles. Inside these one
finds rules telling when object files have to be remade.
Consider the case of the object file related to hello.c (generally, this
file is named hello.o). According to my limited experience, the rule for
that file ought to be:
file hello.o has to be remade when its time stamp is older than the one of
file hello.c or the one of file newline.h
Now, choosing to use the "fast but imperfect dependency generation", should
turn the above rule into the following:
file hello.o has to be remade when its time stamp is older than the one of
file hello.c
At this point I:
- made sure that "use fast but imperfect dependency ..." was *checked*
- put the 3 files in a project (note that I even added newline.h)
- asked Dev-C++ to compile the project
Examining file makefile.win I found that:
hello.o depends only on hello.c
That is ok, since I was using "fast dependencies"
Next I:
- placed the 3 files in a new directory (so no old makefile.win was around)
- made sure that "use fast but imperfect dependency ..." was *not checked*
- put the 3 files in a new project (so different name, different directory ...)
- asked Dev-C++ to compile the project
Examining file makefile.win I found that:
hello.o depends only on hello.c
According to me this is *not ok* :)
During the building, I did see in the "compile log" window messages about
gcc looking for dependencies of source files, so actually the command "gcc
-MM hello.c" was executed, but it seems that the output of these
preprocessing commands is ignored by the makefile generating process.
If I did something wrong, please tell me, if you too think it is a bug, let
me know.
Regards
--
gisan
|