# ###################################################################### #
# The FEEL makefile...                                                   #
# ###################################################################### #

#
# $Id: Makefile,v 1.8 1992/04/29 12:44:17 pab Exp $
#
# $Log: Makefile,v $
# Revision 1.8  1992/04/29  12:44:17  pab
# another day, another change
#
# Revision 1.7  1992/03/14  18:17:59  pab
# Fixed headers
#
# Revision 1.6  1992/02/11  19:50:01  pab
# bytecode junk
#
# Revision 1.5  1992/01/21  22:53:41  pab
# added depend rule
#
# Revision 1.4  1992/01/09  23:08:00  pab
# Std Version
#
# Revision 1.3  1991/12/22  15:13:44  pab
# Xmas revision
#
# Revision 1.2  1991/11/15  16:51:59  pab
# new version
#
# Revision 1.1  1991/08/12  16:51:05  pab
# Initial revision
#
# Revision 1.7  1991/05/16  11:22:04  pab
# 'C' garbage collector support
#
# Revision 1.6  1991/05/15  20:05:52  kjp
# Various including /brad_export->/denton_export + hooks for building
# a FEEL including compiled lisp.
#
# Revision 1.5  1991/02/13  21:13:56  kjp
# Added rule for making a profiled version of you.
#
#

# Edit the following for your favourite machine.
# Currently we know about clippers, sun3s, sun4s & MIPS R2000s.

# ###################################################################### #
# Customisation section...                                               #
# ###################################################################### #

# Directories...
# Change me!
BASE = /net/brad/denton_export/denton/You/NewYou

# C compiler configuration... -DWITH_FUDGE -DWITH_PARANOIA

# Options...
#
#   Socketry...
#     WITH_SYSTEMV_SOCKETS - System V IP communication
#     WITH_BSD_SOCKETS     - BSD IP communication (4.3++)
#
#   Signals...
#     WITH_SYSTEMV_SIGNALS - System V signalling
#     WITH_BSD_SIGNALS     - BSD signalling
# -DWITH_SYSTEMV_SOCKETS
# -DWITH FUDGE		Makes tyhe reader work
# -DBCI 		Want a bytecode interpreter? This does not work on some machines!
# -DNOLOWTAGINTS	Use boxed integers. Low tag integers kind of work, 
#			but break the addons code (and maybe other things)

OPTS=  -g -DNODEBUG
FLAGS =  ${OPTS} -DWITH_FUDGE -DWITH_SYSTEMV_SOCKETS \
        -DDONT_HAVE_STDLIB_H  -DNOLOWTAGINTS -DBCI

# -DWITH_NOBBLING 

CC = gcc
LIBS = -lm 

# -DREADLINE
# readline stuff
# /opt/home/is/bash-1.05/readline/libreadline.a 
#       -lcurses -ltermlib -ltermcap

LEX = flex
YACC = bison -y -t

# Architecture and machine type...
# machine is ANY,BSD or SystemV. 
# ANY is any 'reasonable' architecture ---  things that run UNIX, and many others
# BSD is supported on any machine with a *-swith.s file in this 
# directory. See the note in the manual for what it does, and how to port it.
# SystemV is for sun3/4, Stardents and Alliant concentrix machines 
# It ought to work for any UNIX machine that has shared memory primitives 
# that BSD config. works for  

MACHINE = BSD
ARCH = sun4

# Local module path

MODULE_PATH = ${BASE}/Modules/

# Semaphoring...

SEMAPHORES = SOFTWARE

# Do the business...

# ###################################################################### #
# Working section...                                                     #
# ###################################################################### #

LOAD_PATH_NAME = FEEL_LOAD_PATH

MACHINEABBREV = ${ARCH}
DATE = `date`

# Reader specific sources...

READERSOURCES = lex.yy.c y.tab.c alloca.c

READEROBJECTS = lex.yy.o y.tab.o alloca.o

# Default Elvira sources...

ELVIRASOURCES = initelv.c

ELVIRAOBJECTS = initelv.o

# Garbage collector sources

GCOBJECTS = ../CGC/gc.o remalloc.o 

# Main sources...

SOURCES = copyalloc.c copy.c arith.c basic.c chars.c error.c \
	  main.c modules.c print.c read.c set.c streams.c \
	  table.c vectors.c bootstrap.c lists.c listops.c \
	  class.c slots.c ngenerics.c \
          symboot.c modboot.c toplevel.c root.c specials.c \
	  calls.c ccc.c macros.c system.c semaphores.c state.c \
	  format.c sockets.c sio.c modops.c lamport.c bvecs2.c 

OBJECTS = copyalloc.o copy.o arith.o basic.o chars.o error.o \
	  main.o modules.o print.o read.o set.o streams.o \
	  table.o vectors.o bootstrap.o lists.o listops.o \
	  class.o slots.o ngenerics.o  \
          symboot.o modboot.o toplevel.o root.o specials.o \
	  calls.o ccc.o macros.o system.o semaphores.o state.o \
	  format.o sockets.o sio.o modops.o lamport.o bvecs2.o 

HDRS = bootstrap.h   generics.h    modules.h     specials.h    toplevel.h \
	calls.h       global.h      ngenerics.h   state.h       vectors.h \
	ccc.h         lamport.h     objects.h     structs.h     version.h \
	class.h       lex_global.h  root.h        symboot.h     y.tab.h	  \
	copy.h        listops.h     runtime.h     syssockets.h	funcalls.h \
	defs.h        lists.h       semaphores.h  system_p.h	yyfudge.c	allocate.h  \
	error.h       macros.h      sio.h         system_t.h	bvf.h	modops.h garbage.h  \
	format.h      modboot.h     slots.h       table.h	threads.h iset.h sockets.h

COSOURCES = ${MACHINEABBREV}-switch.s threads.c 

COOBJECTS = ${MACHINEABBREV}-switch.o threads.o

DISTRIBCO = sun3-switch.s sun4-switch.s ard-switch.s clip-switch.s any-switch.s i860-switch.s \
	    Makefile 

KERNELLISP= defs.em extras0.em initcode.em macros0.em standard0.em


# Lisp object file

LISPOBJECTS = LispSrc/all-lisp.o

ISOURCES = interpreter.c
IOBJECTS = interp.o
# Lisp object file

LISPOBJECTS = LispSrc/all-lisp.o

you:	${OBJECTS} ${COOBJECTS} ${READEROBJECTS} ${ELVIRAOBJECTS} ${IOBJECTS}
	-touch you
	rm you
	${CC} -yinitialise_readstr -o you ${OBJECTS} ${COOBJECTS} \
		     ${READEROBJECTS} ${IOBJECTS} ${ELVIRAOBJECTS} ${LIBS}
	echo 

proyou:	${OBJECTS} ${COOBJECTS} ${READEROBJECTS} ${ELVIRAOBJECTS}
	${CC} -p -o proyou ${OBJECTS} ${COOBJECTS} \
		     	   ${READEROBJECTS} ${ELVIRAOBJECTS} ${LIBS}
	echo 

elvira:	${OBJECTS} ${COOBJECTS} ${READEROBJECTS} 
	ld -r -o feel_elvira.o ${OBJECTS} ${COOBJECTS} ${READEROBJECTS} ${IOBJECTS}
	mv feel_elvira.o ../Objs/${ARCH}-elvira.o
	echo 

feel_elvira.o:	elvira

feel:	feel_elvira.o ${LISPOBJECTS}
	(cd LispSrc; make all-lisp.o)
	ecc -o feel ${LISPOBJECTS}
	echo  

reader:		
	${LEX} comp.lex
	${YACC} test.yac

# Sicko bytecode hacking
# preprocess explicitly, then compile the result, after stripping out
# cpp control codes. Ugh. Makes debugging easier though.
interp.o: interpret.c bytecodes.h interpret.h
	${CC} -E  interpret.c ${FLAGS} \
		 -DMACHINE_${MACHINE} \
		 -DMODULE_PATH=\"${MODULE_PATH}\" \
		 -DLOAD_PATH_NAME=\"${LOAD_PATH_NAME}\" \
		 -DSEMAPHORES_${SEMAPHORES} \
		 -DMAKE_DATE="\"${DATE}\"" \
	| grep -v "^#" | tee interp.E |sed -e "s/%%/@/g" | tr -s "@" "\012" > interp.c
	${CC} -O -c ${FLAGS} interp.c

.c.o:
	${CC} -c $*.c ${FLAGS} \
		 -DMACHINE_${MACHINE} \
		 -DMODULE_PATH=\"${MODULE_PATH}\" \
		 -DLOAD_PATH_NAME=\"${LOAD_PATH_NAME}\" \
		 -DSEMAPHORES_${SEMAPHORES} \
		 -DMAKE_DATE="\"${DATE}\"" 




version: ${SOURCES} ${COSOURCES} ${READERSOURCES} ${ELVIRASOURCES} ${DISTRIBCO} ${HDRS} ${KERNELLISP}
	rcsfreeze 

tar: ${SOURCES} ${COSOURCES} ${READERSOURCES} ${ELVIRASOURCES} ${DISTRIBCO} ${HDRS} ${KERNELLISP}
	tar chf -  ${SOURCES} ${COSOURCES} ${READERSOURCES} ${ELVIRASOURCES} ${DISTRIBCO} ${HDRS} ${KERNELLISP} \
	  | compress > you.tar.Z

# Rather assumes that you have X...

depend: ${SOURCES} ${HDRS} ${READERSOURCES} ${COSOURCES}
	makedepend -s "# DO NOT DELETE THIS LINE" -- ${FLAGS} -- ${SOURCES} ${COSOURCES} 

clean:
	rm ${OBJECTS} ${COOBJECTS} ${READEROBJECTS} you


${MACHINE}-coroutine.o:	${MACHINE}-coroutine.s
		${CC} -c ${MACHINE}-coroutine.s

#if there is odd stuff below this line, remove it and do make depend.

# DO NOT DELETE THIS LINE

copyalloc.o: structs.h /usr/include/stdio.h /usr/include/setjmp.h system_t.h
copyalloc.o: system_p.h defs.h funcalls.h global.h state.h allocate.h error.h
copyalloc.o: table.h copy.h
copy.o: structs.h /usr/include/stdio.h /usr/include/setjmp.h system_t.h
copy.o: system_p.h defs.h funcalls.h global.h state.h copy.h
arith.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
arith.o: system_t.h system_p.h error.h funcalls.h global.h state.h
arith.o: /usr/include/math.h /usr/include/floatingpoint.h
arith.o: /usr/include/sys/ieeefp.h ngenerics.h modboot.h
basic.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
basic.o: system_t.h system_p.h funcalls.h error.h global.h state.h modboot.h
basic.o: specials.h /usr/include/sys/types.h /usr/include/sys/stdtypes.h
basic.o: /usr/include/sys/sysmacros.h
chars.o: /usr/include/string.h /usr/include/sys/stdtypes.h
chars.o: /usr/include/ctype.h funcalls.h defs.h structs.h
chars.o: /usr/include/stdio.h /usr/include/setjmp.h system_t.h system_p.h
chars.o: error.h global.h state.h modboot.h symboot.h calls.h
error.o: /usr/include/stdio.h /usr/include/string.h
error.o: /usr/include/sys/stdtypes.h defs.h structs.h /usr/include/setjmp.h
error.o: system_t.h system_p.h funcalls.h global.h state.h error.h
error.o: bootstrap.h slots.h class.h symboot.h modules.h specials.h modboot.h
error.o: ngenerics.h calls.h
main.o: version.h defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
main.o: system_t.h system_p.h funcalls.h error.h global.h state.h slots.h
main.o: garbage.h symboot.h modules.h toplevel.h root.h specials.h lists.h
main.o: listops.h calls.h ccc.h allocate.h modboot.h macros.h semaphores.h
main.o: format.h modops.h sio.h /usr/include/string.h
main.o: /usr/include/sys/stdtypes.h /usr/include/ctype.h
modules.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
modules.o: system_t.h system_p.h funcalls.h error.h global.h state.h
modules.o: allocate.h lists.h table.h modules.h toplevel.h symboot.h
modules.o: specials.h root.h class.h ngenerics.h calls.h bvf.h
print.o: /usr/include/stdio.h /usr/include/string.h
print.o: /usr/include/sys/stdtypes.h /usr/include/ctype.h defs.h structs.h
print.o: /usr/include/setjmp.h system_t.h system_p.h funcalls.h error.h
print.o: global.h state.h vectors.h table.h bootstrap.h modboot.h ngenerics.h
read.o: /usr/include/stdio.h /usr/include/string.h
read.o: /usr/include/sys/stdtypes.h /usr/include/ctype.h funcalls.h defs.h
read.o: structs.h /usr/include/setjmp.h system_t.h system_p.h error.h
read.o: global.h state.h garbage.h symboot.h
set.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h system_t.h
set.o: system_p.h funcalls.h error.h global.h state.h class.h ngenerics.h
streams.o: /usr/include/string.h /usr/include/sys/stdtypes.h
streams.o: /usr/include/stdio.h defs.h structs.h /usr/include/setjmp.h
streams.o: system_t.h system_p.h funcalls.h error.h global.h state.h
streams.o: modboot.h symboot.h ngenerics.h
table.o: funcalls.h defs.h structs.h /usr/include/stdio.h
table.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h state.h
table.o: modboot.h ngenerics.h calls.h
vectors.o: /usr/include/stdio.h funcalls.h defs.h structs.h
vectors.o: /usr/include/setjmp.h system_t.h system_p.h global.h state.h
vectors.o: error.h bootstrap.h modboot.h
bootstrap.o: /usr/include/stdio.h funcalls.h defs.h structs.h
bootstrap.o: /usr/include/setjmp.h system_t.h system_p.h global.h state.h
bootstrap.o: bootstrap.h symboot.h allocate.h copy.h slots.h ngenerics.h
lists.o: /usr/include/string.h /usr/include/sys/stdtypes.h funcalls.h defs.h
lists.o: structs.h /usr/include/stdio.h /usr/include/setjmp.h system_t.h
lists.o: system_p.h error.h global.h state.h allocate.h modboot.h
listops.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
listops.o: system_t.h system_p.h funcalls.h error.h global.h state.h
listops.o: modboot.h symboot.h calls.h modules.h ngenerics.h
class.o: /usr/include/stdio.h defs.h structs.h /usr/include/setjmp.h
class.o: system_t.h system_p.h funcalls.h global.h state.h error.h class.h
class.o: vectors.h table.h bootstrap.h slots.h ngenerics.h modules.h
class.o: modboot.h symboot.h garbage.h
slots.o: /usr/include/stdio.h funcalls.h defs.h structs.h
slots.o: /usr/include/setjmp.h system_t.h system_p.h global.h state.h error.h
slots.o: bootstrap.h table.h ngenerics.h class.h modboot.h slots.h
ngenerics.o: structs.h /usr/include/stdio.h /usr/include/setjmp.h system_t.h
ngenerics.o: system_p.h defs.h funcalls.h global.h state.h allocate.h
ngenerics.o: ngenerics.h bootstrap.h class.h table.h bvf.h modules.h
ngenerics.o: symboot.h specials.h modboot.h calls.h vectors.h
symboot.o: /usr/include/stdio.h funcalls.h defs.h structs.h
symboot.o: /usr/include/setjmp.h system_t.h system_p.h global.h state.h
symboot.o: error.h /usr/include/string.h /usr/include/sys/stdtypes.h
symboot.o: symboot.h allocate.h copy.h
modboot.o: /usr/include/stdio.h /usr/include/string.h
modboot.o: /usr/include/sys/stdtypes.h /usr/include/ctype.h funcalls.h defs.h
modboot.o: structs.h /usr/include/setjmp.h system_t.h system_p.h global.h
modboot.o: state.h allocate.h symboot.h ngenerics.h modules.h table.h error.h
modboot.o: modboot.h bvf.h
toplevel.o: funcalls.h defs.h structs.h /usr/include/stdio.h
toplevel.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h
toplevel.o: state.h symboot.h allocate.h modules.h specials.h toplevel.h
root.o: /usr/include/stdio.h /usr/include/string.h
root.o: /usr/include/sys/stdtypes.h funcalls.h defs.h structs.h
root.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h state.h
root.o: slots.h table.h garbage.h allocate.h modboot.h symboot.h modules.h
root.o: toplevel.h root.h copy.h
specials.o: funcalls.h defs.h structs.h /usr/include/stdio.h
specials.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h
specials.o: state.h slots.h garbage.h symboot.h modules.h toplevel.h root.h
specials.o: allocate.h specials.h
calls.o: funcalls.h defs.h structs.h /usr/include/stdio.h
calls.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h state.h
calls.o: allocate.h lists.h modules.h modboot.h class.h calls.h
ccc.o: /usr/include/stdio.h /usr/include/string.h /usr/include/sys/stdtypes.h
ccc.o: funcalls.h defs.h structs.h /usr/include/setjmp.h system_t.h
ccc.o: system_p.h error.h global.h state.h calls.h modboot.h ngenerics.h
macros.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
macros.o: system_t.h system_p.h error.h funcalls.h global.h state.h slots.h
macros.o: garbage.h symboot.h modules.h toplevel.h root.h allocate.h
macros.o: specials.h modboot.h
system.o: /usr/include/signal.h /usr/include/sys/signal.h
system.o: /usr/include/vm/faultcode.h funcalls.h defs.h structs.h
system.o: /usr/include/stdio.h /usr/include/setjmp.h system_t.h system_p.h
system.o: global.h state.h error.h allocate.h garbage.h threads.h
semaphores.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
semaphores.o: system_t.h system_p.h funcalls.h error.h global.h state.h
semaphores.o: calls.h modboot.h allocate.h modules.h threads.h
state.o: funcalls.h defs.h structs.h /usr/include/stdio.h
state.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h state.h
state.o: calls.h modboot.h allocate.h modules.h
format.o: /usr/include/string.h /usr/include/sys/stdtypes.h
format.o: /usr/include/stdio.h funcalls.h defs.h structs.h
format.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h
format.o: state.h modboot.h symboot.h ngenerics.h sio.h /usr/include/ctype.h
sio.o: /usr/include/string.h /usr/include/sys/stdtypes.h funcalls.h defs.h
sio.o: structs.h /usr/include/stdio.h /usr/include/setjmp.h system_t.h
sio.o: system_p.h error.h global.h state.h allocate.h symboot.h syssockets.h
sio.o: sio.h /usr/include/ctype.h
modops.o: funcalls.h defs.h structs.h /usr/include/stdio.h
modops.o: /usr/include/setjmp.h system_t.h system_p.h error.h global.h
modops.o: state.h symboot.h allocate.h modules.h specials.h modboot.h root.h
lamport.o: defs.h lamport.h
bvecs2.o: /usr/include/stdio.h funcalls.h defs.h structs.h
bvecs2.o: /usr/include/setjmp.h system_t.h system_p.h global.h state.h
bvecs2.o: error.h allocate.h class.h modboot.h bootstrap.h
threads.o: defs.h structs.h /usr/include/stdio.h /usr/include/setjmp.h
threads.o: system_t.h system_p.h funcalls.h global.h state.h error.h calls.h
threads.o: modboot.h symboot.h allocate.h modules.h threads.h class.h
threads.o: vectors.h garbage.h
