lc.exe question

lc.exe question

Post by riha » Thu, 06 Nov 2003 17:53:15


Could you please make it so that lc.exe can be told not to leave *.obj files
around (when invoked in the same "convenience mode" as lcc (gcc foo.c) gcc does
not leave *.o files around, for example).

Thank you.
 
 
 

lc.exe question

Post by jacob navi » Fri, 07 Nov 2003 06:51:58

OK I added:
iRet = _system ( strArg ); // call the linker

if ( iRet )
printf ("linker returned %d\n", iRet );
else { // everything went OK. Erase the intermediate object files
for (iCnt=0; iCnt<iFileCnt;iCnt++) {
p = strrchr(SourceFiles[iCnt],'.');
if (p && (!stricmp(p,".asm") || !stricmp(p,".c"))) {
sprintf(p,".obj");
remove(SourceFiles[iCnt]);
}
else if (p && !stricmp(p,".rc")) {
sprintf(p,".res");
remove(SourceFiles[iCnt]);
}
}
}

But I know that someone will ask me now to add an option to keep the object
files... OF COURSE!

Note the bug above, by the way. If the extension is ".c" or ".rc", I am overwriting
it with ".obj" 1 or two bytes more as it was allocated. I rewrote the allocator
(not shown) to allocate more space than necessary. Imagine how I found out :-)


Will be in next release

jacob

 
 
 

lc.exe question

Post by Mike Caeta » Fri, 07 Nov 2003 09:51:29


object

Um, yeah, having the option to produce .obj file would be nice - rather,
having the option to not produce them would be nicer, imo.

-Mike
 
 
 

lc.exe question

Post by riha » Fri, 07 Nov 2003 18:01:21

On Wed, 5 Nov 2003 22:51:58 +0100, "jacob navia" < XXXX@XXXXX.COM >



<snip>


Thanks a lot! :-)