#!/bin/sh

#
# Creates a new Makefile which includes this directory's
# Makefile.defs, the local dirs' Makefile.body, and this directory's
# Makefile.rules.
#
# Creates a new cfuncs.c by adding includes for the local dirs'
# cfuncs.h to this directory's cfuncs.c
#

echo creating ./Makefile

cat << --- > Makefile
# automatically generated by modules
# with parameters $*
#
include Makefile.defs
include Makefile.body
---

for dir do    (
	echo include $dir/Makefile.body >> Makefile
) done

echo include Makefile.rules >> Makefile


echo creating ./cfuncs.c

cat << --- > cfuncs.c

/***********************************************************************
 *
 *	Local definitions of C functions for GNU Smalltalk 
 *	Automatically generated by modules with parameters
 *	$*
 *
 *	\$Revision: 1.7.5$
 *	\$Date: 2000/05/28 16:56:52$
 *	\$Author: pb$
 *
 ***********************************************************************/


#include "gstpub.h"

#define CFUNC(smalltalk, c)	{ extern void c(); defineCFunc(smalltalk, c); }
#define CALL(c)			{ extern void c(); c(); }

void
initUserCFuncs()
{
---

for dir do (
	echo '  #include "'$dir'/cfuncs.h"' >> cfuncs.c
)
done

echo } >> cfuncs.c
