
.SUFFIXES:
.SUFFIXES: .o  .lsp .lisp .c

CC=cc
LD_ORDINARY_CC=${CC}
# Need libX11.a and libtcl.a, machine.defs may say where..

CC = gcc 
HDIR	= ../h
ODIR	= ../o

GCLIB  = ../o/gcllib.a

# begin makedefs
GCLDIR=/LocalPrograms/GNU/gcl-2.2
SHELL=/bin/sh
MACHINE=NeXT32-i386
#could not find tk.tcl so using:
TK_LIBRARY=unknown
#could not find init.tcl so using:
TCL_LIBRARY=unknown
#could not find X11/Xlib.h so using:
X11_INCLUDE_DIR=unknown
#could not find tk.h so using:
TK_INCLUDE_DIR=unknown
#could not find libtk.* so using:
TK_LIBS_DIR=unknown
#could not find libtcl.* so using:
TCL_LIBS_DIR=unknown
#could not find libX11.* so using:
X11_LIBS_DIR=unknown
#could not find *.el* so using:
EMACS_SITE_LISP=unknown
#could not find dir so using:
INFO_DIR=unknown
TK_INCLUDE=-I${TK_INCLUDE_DIR}
X11_INCLUDE=-I${X11_INCLUDE_DIR}
TCL_LIBS=-L${TCL_LIBS_DIR} -ltcl
TK_LIBS=-L${TK_LIBS_DIR} -ltk
X11_LIBS=-L${X11_LIBS_DIR} -lX11
#
# NeXTSTEP 3.2, 3.3 for Intel
#

LBINDIR=/usr/local/bin

OFLAG=	-O4
LIBS=	-lsys_s -lm 
LIBC= 
ODIR_DEBUG=  

# NeXT's cc does not compile gcl correctly.
# However gcc-2.6.3 is OK.
CC=	xgcc -DVOL=volatile -I$(GCLDIR)/o -L/LocalPrograms/GNU/gcc-2.7.1 -fwritable-strings

# The option -seglinkedit is specified so that rld_load() can be used.
LDCC=	ld -X -seglinkedit -segprot __TEXT rwx rwx /lib/crt0.o

# bcmp(), bcopy(), and bzero() are already included in the NeXT C library.
LIBFILES=

CFLAGS	= -c $(DEFS)  -I../h

MAIN    = ../o/main.o

INITFORM=(setq compiler::*cc* "cc -DVOL=volatile -fwritable-strings")

MPFILES=$(MPDIR)/mpi-386d.o $(MPDIR)/libmport.a

# Use symbolic links
SYMB=-s

# the  make to use for saved_kcp the profiler.
KCP=kcp-next

# set path = (. /LocalPrograms/GNU/gcc-2.7.1 /cat/Library/Terminal /bin /etc /usr/bin /usr/etc /usr/ucb /usr/lib /usr/local/bin /LocalApps /NextApps /NextAdmin /NextDeveloper/Apps /cat/Apps)# end makedefs

CFLAGS1=$(CFLAGS) -I../o -I../h -I$(X11_INCLUDE_DIR) -I$(TK_INCLUDE_DIR)

all: gcltkaux1  tkl.o tinfo.o gcltksrv demos/gc-monitor.o

.lisp.o:
	echo "(compile-file \"$*.lisp\" :c-file nil :c-debug nil)" | ../unixport/saved_gcl

.lsp.o:
	echo "(compile-file \"$*.lsp\" :c-file t :c-debug t)" | ../unixport/saved_gcl



GUIOS = guis.o tkAppInit.o tkMain.o

clean::
	rm -f ${GUIOS} $(OFILES) gcltkaux gcltksrv *.o */*.o

.c.o:
	$(CC) -c $(CFLAGS1) ${ODIR_DEBUG}  $*.c


gcltkaux1: $(GUIOS)
	make gcltkaux "CC=`echo ${CC} | sed -e 's: -static : :g' -e 's:-Bstatic : :g'`"

gcltkaux:  $(GUIOS)
	$(LD_ORDINARY_CC) $(GUIOS) -o gcltkaux  ${TK_LIBS} ${TCL_LIBS}  ${X11_LIBS} ${LIBS} ${GCLIB}

gcltksrv: makefile
	cat gcltksrv.in | sed -e "s:TK_LIBRARY=.*:TK_LIBRARY=${TK_LIBRARY}:g" \
	-e "s:DIR=.*:DIR=${GCLDIR}/gcl-tk:g" > gcltksrv
	chmod a+x gcltksrv

INTERESTING=*.lsp *.lisp tk*.c guis.c sockets.c  comm.c Makefile  demos/*.lisp  *.h

tar:
	tar cvf - ${INTERESTING} | gzip -c > /u/wfs/sock-`date +%y%m%d`.tgz
tags:
	etags *.lsp *.lisp tk*.c guis.c sockets.c   guis.h our_io.c

tkAppInit.o : tkAppInit.c
tkMain.o : tkMain.c
tkXAppInit.o : tkXAppInit.c
tkXshell.o : tkXshell.c
guis.o : guis.c guis.h comm.c sheader.h
sockets.c: our_io.c sheader.h
socketsl.o: socketsl.lisp sockets.c

