[M3devel] proposal to batch C compilation, and change extensions

Jay K jay.krell at cornell.edu
Sun Sep 22 04:15:45 CEST 2013


With Microsoft Visual C++, it is very much faster to say:
  cl -c 1.c 2.c 3.c 4.c  
 than 
  cl -c 1.c  
  cl -c 2.c  
  cl -c 3.c  
  cl -c 4.c  



 I'm assuming the same pattern works with other 
 compilers, and is generally never slower. 



 This requires the output names followed an assumed 
 pattern -- replace ".c" with ".o" or ".obj". 


When compiling a single file you can specify an arbitrary output name.
When compiling multiple files, you can only specify an output directory.



 It also requires the same command line switches 
 for compiling each file, i.e. -I, -D, etc. 



 Traditionally this didn't matter much 
 because we have relatively little C.



 I would like to "fix" this. 
 I would like to change the build to record 
 what all C files need compiling, then compile 
 them all "at once". 



 And for foo.m3 => foo.m3.c => foo.m3.obj or foo.m3.o 
 instead of the current foo.m3 => foo.m3.c -> foo.mo 



 And, might as well do similar for the gcc backend? 
  foo.m3 => foo.mc => foo.m3.o instead of  
  foo.m3 => foo.mc => foo.mo  



 Or, for some purported MS-DOS compatibility (only one dot): 
  foo.m3 => foo_m3.c => foo_m3.obj or foo_m3.o  
  foo.m3 => foo.mc => foo_m3.obj or foo_m3.o  
 


Ok?
I think nix the MS-DOS part.
(Is anyone interested in a DJGPP version?)




 - Jay
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20130922/31f4ba8f/attachment-0001.html>


More information about the M3devel mailing list