does csc.exe rebuild source files every time?

S

seannakasone

I'm a newbie to csharp. I've just read that there are no object files
(*.obj) in C#. So a command such as this will build my.exe straight
from the source files.

csc.exe /out:my.exe *.cs

Does csc.exe build every source file everytime this command is issued?
Or does it somehow know which source files are newer and build
selectively.
 
B

Barry Kelly

I'm a newbie to csharp. I've just read that there are no object files
(*.obj) in C#. So a command such as this will build my.exe straight
from the source files.

csc.exe /out:my.exe *.cs

Does csc.exe build every source file everytime this command is issued?
Yes.

Or does it somehow know which source files are newer and build
selectively.

C# is not compilable on a forward-only basis like C, C++ & Delphi, and
there are no intermediate files as you know, so it compiles everything.

Typically, the unit of dependency analysis is the assembly. One can use
MSBuild or NAnt or even make to determine whether or not to build an
assembly based on its sources.

-- Barry
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

I'm a newbie to csharp. I've just read that there are no object files
(*.obj) in C#. So a command such as this will build my.exe straight
from the source files.

csc.exe /out:my.exe *.cs

Does csc.exe build every source file everytime this command is issued?
Or does it somehow know which source files are newer and build
selectively.

It build everything, but that is usually not a problem.

Computers are fast today.

And what takes time in a C/C++ compiler is usually:
- the disk IO for temporary files that csc does not have
- the optimization process which is not done by csc but by
the runtime JIT

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top