. ../../config/system
. ../../config/site

if [ _$load_obj != _ ]; then more_targets=xt.pre; fi

echo Building Makefile.local...
cat <<EOT >Makefile.local
# This Makefile was produced by running ./build in this directory.

SHELL=/bin/sh

CC= ${cc-cc}
CFLAGS= $cflags $obj_cflags
LINTFLAGS= $lintflags

INC=	../../include

H=	\$(INC)/config.h\\
	\$(INC)/param.h\\
	\$(INC)/object.h\\
	\$(INC)/extern.h\\
	\$(INC)/misc.h\\
	\$(INC)/stkmem.h\\
	\$(INC)/cstring.h\\
	../xlib/xlib.h\\
	xt.h

C=	accelerator.c\\
	action.c\\
	callback.c\\
	class.c\\
	classname.c\\
	context.c\\
	converter.c\\
	error.c\\
	function.c\\
	identifier.c\\
	init.c\\
	objects.c\\
	popup.c\\
	resource.c\\
	translation.c\\
	widget.c

O=	accelerator.o\\
	action.o\\
	callback.o\\
	class.o\\
	classname.o\\
	context.o\\
	converter.o\\
	error.o\\
	function.o\\
	identifier.o\\
	init.o\\
	objects.o\\
	popup.o\\
	resource.o\\
	translation.o\\
	widget.o

all: \$(O) $more_targets

.c.o:
	\$(CC) \$(CFLAGS) -I\$(INC) $x11_incl -c \$<

accelerator.o:	\$(H) accelerator.c
action.o:	\$(H) action.c
callback.o:	\$(H) callback.c
class.o:	\$(H) class.c
classname.o:	\$(H) classname.c
context.o:	\$(H) context.c
converter.o:	\$(H) converter.c
error.o:	\$(H) error.c
function.o:	\$(H) function.c
identifier.o:	\$(H) identifier.c
init.o:		\$(H) init.c
objects.o:	\$(H) objects.c
popup.o:	\$(H) popup.c
resource.o:	\$(H) resource.c
translation.o:	\$(H) translation.c
widget.o:	\$(H) widget.c

EOT
if [ _$load_obj != _ ]; then
cat <<EOT >>Makefile.local
xt.pre: \$(O) ../xlib/xlib.pre
	../../scripts/linkext-$load_obj \$@ \$(O) ../xlib/*.o

install: xt.pre
	-@if [ ! -d $lib_dir ]; then \\
	    echo mkdir $lib_dir; \\
	    mkdir $lib_dir; \\
	fi
	cp xt.pre $lib_dir/xt.o
EOT
else
cat <<EOT >>Makefile.local
install:
EOT
fi
cat <<EOT >>Makefile.local

lint:
	lint \$(LINTFLAGS) -I\$(INC) $x11_incl \$(C)

clean:
	rm -f *.o xt.pre core

distclean:
	rm -f *.o xt.pre core lint.out Makefile.local
EOT
