Hi, Jack
I will attempt to answer your question, but I think it is not related to
what is generally known as "conditional compilation".
allow me to use a simple example to better explain the point and excuse me
if I say things which you already know or if I misunderstood your question.
Say that your program is made of two source files and one header file:
hello.c print.h print.c
-------- -------- --------
#include "print.h" #ifndef print_h #include <stdio.h>
int main() #define print_h #include "print.h"
{ void print(const
char *s)
print("Hello world"); void print(const char *); {
return 0; puts(s);
} #endif }
----------------------- -----------------------
-----------------------
After writing the above by Dev editor (and adding them to a project, oddly
one which I would, but can't, name "hello"!), say that you click the
"compile" button: Dev-C++ will compile the two source files and call the
linker to produce the executable file. This is Ok.
If you change something in "hello.c" only, and hit "compile" again you
expect to see:
1) hello.c compiled
2) the linker called to produce the updated executable file
Instead what Dev-C++ does is:
1) compile hello.c
2) compile print.c
3) call the linker to update the executable file
Well actually in my case Dev-C++ says "access violation ..." and refuses to
compile! But that is another story :-)
In any case there is no need to compile "print.c" because it hasn't changed
nor did the header file "print.h" change; IMHO the Dev-C++ approach,
consisting of "always compile everything", is time consuming.
There is more: if you generate a makefile using Dev, you will find out that
the makefile is no smarter than the IDE, I mean it too says: "always
compile everything"
It looks like the "project manager" of Dev-C++ doesn't build a "dependency
table", so it lacks the understanding about what needs to be compiled when;
for instance in the above small program a dependency table should look like
the following: (say that hello.exe is the name of the executable file)
file: depends on: should be updated when it is older than:
hello.exe hello.o, print.o hello.o or print.o by the linker
hello.o hello.c, print.h hello.c or print.h by the compiler
print.o print.c, print.h print.c or print.h by the compiler
So, in the end, you are missing no setting, "always compile everything" is
a bug of DEV-C++.
A possible solution: avoid using Dev-C++ to compile (and build the
executable), use it only as an editor (or use the editor "ConTEXT"
www.fixedsys.com/context), then resort to the program "make" and to a
makefile (of course not generated by Dev) to build/update the executable file.
If you are interested, I can supply an elementary program to generate
simple makefiles suitable for console applications (I lack knowledge of
Windows programming so don't know how to generate such applications); the
generator can be used from the command line or as an external tool of some
editor (for instance "ConTEXT").
At 23:10 24/01/02 +0600, Jack York wrote:
>Hello,
>
>I have a project with five source mods. If I alter one of them and select
>compile, that mod plus three of the others compile. In fact, if I press
>compile right after a compile finishes, it goes through another compile.
>Can someone tell me if this is normal behavior for Dev-C++ or am I
>missing a setting?
>
>Jack
>--
>E-Mail: jy...@tw...
>Alt: jy...@vo...
>Home: http://my.voyager.net/~jyork
>
>
>
>
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--
Luigi
gi...@li...
|