
.SUFFIXES:
.SUFFIXES: .fn .o .c .lsp



PORTDIR	= ../unixport
CAT=cat

OBJS	= arraylib.o assert.o defmacro.o defstruct.o describe.o evalmacros.o \
	iolib.o listlib.o mislib.o module.o numlib.o packlib.o predlib.o \
	seq.o seqlib.o setf.o top.o trace.o sloop.o debug.o info.o



COMPILE_FILE=$(PORTDIR)/saved_gcl $(PORTDIR) -system-p -c-file -data-file \
	-o-file nil -h-file -compile
CFLAGS	= -c -O -I../h 

.lsp.c: 
	@ ../xbin/if-exists $(PORTDIR)/saved_gcl \
	"rm -f $*.c $*.h $*.data $*.o" \
	"$(COMPILE_FILE) $* "

.lsp.o: 
	 @ ../xbin/if-exists $(PORTDIR)/saved_gcl \
	"rm -f $*.c $*.h $*.data $*.o" \
	"$(COMPILE_FILE) $* " \
	"$(CC) $(OFLAG) $(CFLAGS) $*.c " \
	"../xbin/append ${NULLFILE} $*.data $*.o "

# 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















all:	$(OBJS)



.c.o:
	$(CC) $(OFLAG) $(CFLAGS) $*.c
	$(CAT) ${NULLFILE} $*.data >> $*.o

.lsp.fn: ../cmpnew/collectfn.o
	../xbin/make-fn $*.lsp

all:	$(OBJS)

fns1:	$(FNS)

fns:	../cmpnew/collectfn.o
	make fns1 -e "FNS=`echo ${OBJS} | sed -e 's:\.o:\.fn:g'`"

../cmpnew/collectfn.o: ../cmpnew/collectfn.lsp
	(cd ../cmpnew ; $(PORTDIR)/saved_gcl $(PORTDIR)/ collectfn.lisp collectfn S1000)


clean:
	rm -f *.o core a.out
allclean:
	rm -f *.h *.data *.c

dummy3 $(NEWCFILES): sys-proclaim.lisp

sys-proclaim.lisp:
	echo '(in-package "SYSTEM")' \
	'(load "../cmpnew/collectfn")'\
	'(compiler::make-all-proclaims "*.fn")' | ../xbin/gcl


newc:	
	make $(OBJS) -e "NEWCFILES=`echo $(OBJS) | sed -e 's:\.o:.c:g'`"


