This directory contains the source for programs used to build GM.

gm_make_depend.c:
	The source for a program that takes a list of C source files
	and headers on STDIN and outputs Makefile rules describing
	their conservatively determined interdependencies to STDOUT.
	Used to build the file `dependencies.'

gm_preproc.c:
	The source for a program to help generate the .c.c and .h.h files.
	A sed script, scripts/misc/__GM_FUNCTION__.sed, converts myfile.c 
	from this:
        	#include <stdio.h>
		#include "header.h"

		function()
 		{
			blah_de_blah();
		}
	into this:
        	#include <stdio.h>
		#include "header.h.h"
		%%SKIP%%#define __GM_FILE__ 
		%%SKIP%%#define __GM_FILE__ "___GM_FILE___"
		%%LINENO%%

		function()
		%%SKIP%%#undef GM_FUNCTION
		%%SKIP%%#define GM_FINCTION function
		%%SKIP%%#undef __GM_FUNCTION__
		%%SKIP%%#define __GM_FINCTION__ "function"
		%%LINENO%%
 		{
			blah_de_blah();
		}
		%%SKIP%%#undef GM_FUNCTION
		%%SKIP%%#define GM_FINCTION GM_UNKNOWN_FUNCTION
		%%SKIP%%#undef __GM_FUNCTION__
		%%SKIP%%#define __GM_FINCTION__ __GM_UNKNOWN_FUNCTION__
		%%LINENO%%

	We take that input, print a little prologue, strip the %%SKIP%%s,
	and replace the %%LINENO%% lines with line counts ignoring the 
	%%SKIP%% lines.  So, our output is:
		#undef __GM_FILE__
		#define __GM_FILE__ "___GM_FILE___"
		#line 1 "myfile.c"
        	#include <stdio.h>
		#include "header.h.h"
		#define __GM_FILE__ 
		#define __GM_FILE__ "___GM_FILE___"
		#line 3

		function()
		#undef GM_FUNCTION
		#define GM_FINCTION function
		#undef __GM_FUNCTION__
		#define __GM_FINCTION__ "function"
		#line 5
 		{
			blah_de_blah();
		}
		#undef GM_FUNCTION
		#define GM_FINCTION GM_UNKNOWN_FUNCTION
		#undef __GM_FUNCTION__
		#define __GM_FINCTION__ __GM_UNKNOWN_FUNCTION__
		#line 8

	Then, a final sed command replaces all the ___GM_FILE___ strings
	with the actual file name.
