##	Makefile for the SR runtime system, srlib.o.


CFLAGS = -g
LD = ld
SHELL = /bin/sh

OBJ =	main.o alloc.o co.o debug.o event.o invoke.o io.o iop.o \
	machine.o misc.o net.o oper.o process.o \
	remote.o res.o semaphore.o socket.o vm.o

XOBJ =	srx.o debug.o netpath.o socket.o

ASM =	bobcat.s encore.s m68k.s mips.s sparc.s spectrum.s vax.s


all:	srlib srx
srlib:	srlib.o

srlib.o:  $(OBJ) Makefile
	$(LD) -r -o srlib.o $(OBJ) 

machine.o:  machine.c $(ASM)
	$(CC) $(CFLAGS) -E machine.c | grep -v '^$$' | grep -v '^#' >machine.s
	$(AS) -o machine.o machine.s

srx:	$(XOBJ)
	$(CC) $(CFLAGS) -o srx $(XOBJ)


# csw is a porting test and is built only by explicit request

csw:	csw.o machine.o		
	$(CC) $(CFLAGS) -o csw csw.o machine.o

cswtest: csw
	-csw >csw.out
	diff csw.out csw.stdout


# csloop is for timing context switches and is also built only on request.
# It needs -O to run successfully on MIPS, reason not investigated.

csloop:	csloop.c machine.o		
	$(CC) -O -o csloop csloop.c machine.o



install:
	cd ..; make i-rts

# for "clean", don't use *.o -- it would delete srlib.o also
clean:
	rm -f $(OBJ) machine.s $(XOBJ) csw.o csw csloop.o csloop core

depend:	
	sh ../depend.sh


lint:
	lint `ls *.c | egrep -v 'csw|csloop|srx|netpath|machine'`  >lint.raw
	echo =====						  >>lint.raw
	lint srx.c netpath.c debug.c 				  >>lint.raw
	sed -f lint.sed <lint.raw >lint.out


tar:
	@tar cBf - [A-Z]* *.[chs] *.sed *.stdout


tags:
	/usr/local/gnuemacs/etc/etags *.c
TAGS:
	ctags *.c


# build a fast version, suppressing error checks (not recommended in general)
fast:
	make CFLAGS='-O -DNDEBUG -DNOCHECK'


################################################################################
# The rest of this file is generated by `make depend'.  Don't change it by hand.
################################################################################

# >>DO NOT DELETE THIS LINE<< #
#   "make depend" was last run:  Fri Jul 21 22:17:50 MST 1989
alloc.o: alloc.c
alloc.o: rts.h
alloc.o: ../libc.h
alloc.o: ../config.h
alloc.o: ../srsys.h
alloc.o: types.h
alloc.o: procsem.h
alloc.o: netw.h
alloc.o: oper.h
alloc.o: res.h
alloc.o: funcs.h
alloc.o: macros.h
alloc.o: globals.h
co.o: co.c
co.o: rts.h
co.o: ../libc.h
co.o: ../config.h
co.o: ../srsys.h
co.o: types.h
co.o: procsem.h
co.o: netw.h
co.o: oper.h
co.o: res.h
co.o: funcs.h
co.o: macros.h
co.o: globals.h
csloop.o: csloop.c
csw.o: csw.c
debug.o: debug.c
debug.o: rts.h
debug.o: ../libc.h
debug.o: ../config.h
debug.o: ../srsys.h
debug.o: types.h
debug.o: procsem.h
debug.o: netw.h
debug.o: oper.h
debug.o: res.h
debug.o: funcs.h
debug.o: macros.h
debug.o: globals.h
event.o: event.c
event.o: rts.h
event.o: ../libc.h
event.o: ../config.h
event.o: ../srsys.h
event.o: types.h
event.o: procsem.h
event.o: netw.h
event.o: oper.h
event.o: res.h
event.o: funcs.h
event.o: macros.h
event.o: globals.h
invoke.o: invoke.c
invoke.o: rts.h
invoke.o: ../libc.h
invoke.o: ../config.h
invoke.o: ../srsys.h
invoke.o: types.h
invoke.o: procsem.h
invoke.o: netw.h
invoke.o: oper.h
invoke.o: res.h
invoke.o: funcs.h
invoke.o: macros.h
invoke.o: globals.h
io.o: io.c
io.o: rts.h
io.o: ../libc.h
io.o: ../config.h
io.o: ../srsys.h
io.o: types.h
io.o: procsem.h
io.o: netw.h
io.o: oper.h
io.o: res.h
io.o: funcs.h
io.o: macros.h
io.o: globals.h
iop.o: iop.c
iop.o: rts.h
iop.o: ../libc.h
iop.o: ../config.h
iop.o: ../srsys.h
iop.o: types.h
iop.o: procsem.h
iop.o: netw.h
iop.o: oper.h
iop.o: res.h
iop.o: funcs.h
iop.o: macros.h
iop.o: globals.h
machine.o: machine.c
machine.o: vax.s
main.o: main.c
main.o: rts.h
main.o: ../libc.h
main.o: ../config.h
main.o: ../srsys.h
main.o: types.h
main.o: procsem.h
main.o: netw.h
main.o: oper.h
main.o: res.h
main.o: funcs.h
main.o: macros.h
main.o: globals.h
misc.o: misc.c
misc.o: rts.h
misc.o: ../libc.h
misc.o: ../config.h
misc.o: ../srsys.h
misc.o: types.h
misc.o: procsem.h
misc.o: netw.h
misc.o: oper.h
misc.o: res.h
misc.o: funcs.h
misc.o: macros.h
misc.o: globals.h
net.o: net.c
net.o: rts.h
net.o: ../libc.h
net.o: ../config.h
net.o: ../srsys.h
net.o: types.h
net.o: procsem.h
net.o: netw.h
net.o: oper.h
net.o: res.h
net.o: funcs.h
net.o: macros.h
net.o: globals.h
netpath.o: netpath.c
netpath.o: ../config.h
netpath.o: ../libc.h
netpath.o: macros.h
oper.o: oper.c
oper.o: rts.h
oper.o: ../libc.h
oper.o: ../config.h
oper.o: ../srsys.h
oper.o: types.h
oper.o: procsem.h
oper.o: netw.h
oper.o: oper.h
oper.o: res.h
oper.o: funcs.h
oper.o: macros.h
oper.o: globals.h
process.o: process.c
process.o: rts.h
process.o: ../libc.h
process.o: ../config.h
process.o: ../srsys.h
process.o: types.h
process.o: procsem.h
process.o: netw.h
process.o: oper.h
process.o: res.h
process.o: funcs.h
process.o: macros.h
process.o: globals.h
remote.o: remote.c
remote.o: rts.h
remote.o: ../libc.h
remote.o: ../config.h
remote.o: ../srsys.h
remote.o: types.h
remote.o: procsem.h
remote.o: netw.h
remote.o: oper.h
remote.o: res.h
remote.o: funcs.h
remote.o: macros.h
remote.o: globals.h
res.o: res.c
res.o: rts.h
res.o: ../libc.h
res.o: ../config.h
res.o: ../srsys.h
res.o: types.h
res.o: procsem.h
res.o: netw.h
res.o: oper.h
res.o: res.h
res.o: funcs.h
res.o: macros.h
res.o: globals.h
semaphore.o: semaphore.c
semaphore.o: rts.h
semaphore.o: ../libc.h
semaphore.o: ../config.h
semaphore.o: ../srsys.h
semaphore.o: types.h
semaphore.o: procsem.h
semaphore.o: netw.h
semaphore.o: oper.h
semaphore.o: res.h
semaphore.o: funcs.h
semaphore.o: macros.h
semaphore.o: globals.h
socket.o: socket.c
socket.o: rts.h
socket.o: ../libc.h
socket.o: ../config.h
socket.o: ../srsys.h
socket.o: types.h
socket.o: procsem.h
socket.o: netw.h
socket.o: oper.h
socket.o: res.h
socket.o: funcs.h
socket.o: macros.h
socket.o: globals.h
srx.o: srx.c
srx.o: ../paths.h
srx.o: rts.h
srx.o: ../libc.h
srx.o: ../config.h
srx.o: ../srsys.h
srx.o: types.h
srx.o: procsem.h
srx.o: netw.h
srx.o: oper.h
srx.o: res.h
srx.o: funcs.h
srx.o: macros.h
srx.o: globals.h
vm.o: vm.c
vm.o: rts.h
vm.o: ../libc.h
vm.o: ../config.h
vm.o: ../srsys.h
vm.o: types.h
vm.o: procsem.h
vm.o: netw.h
vm.o: oper.h
vm.o: res.h
vm.o: funcs.h
vm.o: macros.h
vm.o: globals.h
