[M3devel] cm3: what are *.mc files

Jay K jay.krell at cornell.edu
Tue Jun 9 22:12:51 CEST 2015


 I believe before the m3cc backend existed, these were actually C code. 
  (i.e. C backend used to be the one and only) 

Then they morphed into the intermediate representation fed to cm3cgwhich is what they are now.
See here:

https://github.com/modula3/cm3/tree/master/m3-sys/m3middle/src/M3CG_BinWr.m3
and m3-sys/m3cc/gcc/gcc/m3cg/parse.c
m3cgcat can dump the binary form into text.
_m3main.mc is the intermediate file that holds main.There is a configuration option to use it, vs. _m3main.c.I switched to _m3main.c. This is perhaps more portable if using C++ anywhere andwant to get the constructors/destructors run (though all modern implementationsdon't care really).

Try cm3 -keep to see them all. i.e. normally they get deleted.

 - Jay



> Date: Tue, 9 Jun 2015 22:02:45 +0200
> From: estellnb at elstel.org
> To: m3devel at elegosoft.com
> Subject: [M3devel] cm3: what are *.mc files
> 
> What are *.mc - files?
> They appear in TARGET - directories;
> most of them are just called _m3main.mc but some of them have other names.
> 
> I ask because I am writing a program which should recognize and clear 
> object files.
> It does not seem to be sufficient to check for uppercase directories 
> which are located together with an src directory.
> 
> Usually files of a specific type start with a 32bit magic;
> however the mc files all have different starting sequences.
> 
> Is there still a straight forward way to recognize an .mc file just by 
> its binary content?
> 
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150609/87c92fd5/attachment-0002.html>


More information about the M3devel mailing list