
#
#  Makefile for the 8086 mitc version of Xinu
#

.SUFFIXES:.o .c .s
DIR	=	/usr/ftp/pub/Xinu.8086/

CC	=	$(DIR)/bin/cc86
CFLAGS	=	-c -I../h
#CFLAGS	=	-c -I../h -DI550PRADDR -DI550DEBUG
# I550PRADDR forces i550 driver to print out address when starting
AFLAGS	=
AS	=	$(DIR)/bin/as86
LD	=	$(DIR)/bin/ld86
AR	=	/bin/ar
LORDER	=	$(DIR)/bin/lorder86
LIB	=	$(DIR)/lib
RANLIB  =	$(DIR)/bin/ranlib86

.c.o:
		$(CC) $(CFLAGS)	$<
.s.o:
		$(CC) $(CFLAGS)	$<

CFILES=		chprio.c clkinit.c close.c conf.c	\
		control.c create.c 			\
		dgstuff.c				\
		finput.c foutput.c freceive.c freebuf.c	\
		freemem.c frinit.c frsend.c frtimer.c	\
		getbuf.c getc.c getitem.c getmem.c	\
		getmid.c getpid.c getprio.c getstk.c	\
		initpic.c				\
		init.c initialize.c insert.c insertd.c	\
		ioerr.c ioinit.c ionull.c		\
		kill.c kprintf.c			\
		lfclose.c lfgetc.c lfinit.c lfputc.c	\
		lfread.c lfseek.c			\
		lfsetup.c 				\
		mark.c mdump.c mkpool.c			\
		netinit.c newqueue.c			\
		open.c					\
		pcount.c pcreate.c pdelete.c 		\
		pinit.c					\
		poolinit.c prdump.c preceive.c preset.c	\
		psend.c ptclear.c putc.c		\
		qdump.c queue.c				\
		read.c ready.c receive.c recvclr.c	\
		resched.c resume.c			\
		scount.c screate.c sdelete.c seek.c	\
		send.c sendf.c signal.c signaln.c	\
		sleep.c sleep10.c sreset.c ssclock.c	\
		suspend.c				\
		ttycntl.c ttygetc.c ttyiin.c		\
		ttyinit.c ttyoin.c ttyputc.c ttyread.c	\
		ttywrite.c				\
		udp.c userret.c				\
		wait.c wakeup.c write.c			\
		xdone.c
#		i550cntl.c 				\
#		i550intr.c i550init.c i550input.c ip_ether.c	\
#		i550misc.c				\
#		i550mrcv.c i550mxmt.c i550open.c	\
#		i550read.c  				\
#		i550tframe.c			\
#		i550write.c				\

SFILES=		acaia.s					\
		clkint.s 				\
		ctxsw.s					\
		ioaccess.s				\
		ioint.s					\
		lowcore.s				\
		panic.s					\
		setclkr.s sizmem.s startup.s usart.s

OFILES=		acia.o chprio.o clkinit.o close.o	\
		control.o create.o			\
		clkint.o  ctxsw.o 	 		\
		dgstuff.o				\
		finput.o foutput.o freceive.o freebuf.o	\
		freemem.o frinit.o frsend.o frtimer.o	\
		getbuf.o getc.o getitem.o getmem.o	\
		getmid.o getpid.o getprio.o getstk.o	\
		ioaccess.o				\
		initpic.o init.o insert.o insertd.o	\
		ioerr.o ioinit.o ioint.o ionull.o	\
		ioint.o					\
		kill.o kprintf.o			\
		lfclose.o lfgetc.o lfinit.o lfputc.o	\
		lfread.o lfseek.o			\
		lfsflush.o 				\
		lfsetup.o 				\
		netinit.o newqueue.o			\
		mark.o mdump.o mkpool.o			\
		open.o panic.o				\
		pcount.o pcreate.o pdelete.o 		\
		pinit.o					\
		poolinit.o prdump.o preceive.o preset.o	\
		psend.o ptclear.o putc.o		\
		panic.o					\
		qdump.o queue.o				\
		read.o ready.o receive.o recvclr.o	\
		resched.o resume.o			\
		scount.o screate.o sdelete.o seek.o	\
		send.o sendf.o signal.o signaln.o	\
		sleep.o sleep10.o sreset.o ssclock.o	\
		suspend.o 	 			\
		setclkr.o sizmem.o 			\
		ttycntl.o ttygetc.o ttyiin.o		\
		ttyinit.o ttyoin.o ttyputc.o ttyread.o	\
		ttywrite.o				\
		udp.o userret.o				\
		wait.o wakeup.o write.o			\
		xdone.o
#		i550cntl.o  				\
#		i550intr.o i550init.o i550input.o ip_ether.o	\
#		i550misc.o				\
#		i550mrcv.o i550mxmt.o i550open.o	\
#		i550read.o 				\
#		i550tframe.o				\
#		i550write.o				\

XOFILES=	lowcore.o startup.o initialize.o conf.o

HFILES=		../h/bufpool.h	\
		../h/conf.h	\
		../h/disk.h	\
		../h/dir.h	\
		../h/dlc.h	\
		../h/dtc.h	\
		../h/file.h	\
		../h/frame.h	\
		../h/i550.h	\
		../h/io.h	\
		../h/kernel.h	\
		../h/mark.h	\
		../h/mem.h	\
		../h/pfile.h	\
		../h/ports.h	\
		../h/proc.h	\
		../h/q.h 	\
		../h/sem.h	\
		../h/sleep.h	\
		../h/slu.h	\
		../h/tty.h	\
		../h/udp.h	\
		../h/xebec.h

all:		xinu86.o libx86.a

install:        all 
		cp libx86.a $(LIB)/libx86.a
		$(RANLIB) $(LIB)/libx86.a
		cp xinu86.o $(LIB)/xinu86.o

fastinstall:
		cp libx86.a $(LIB)/libx86.a
		$(RANLIB) $(LIB)/libx86.a
		cp xinu86.o $(LIB)/xinu86.o

clean:
		-rm -rnf *.o ,* .,*
		-rm -rnf libx86.a a.out core make.out
		-rm -rnf *.CKP ../h/*.CKP ../con/*.CKP

everything:	a.out xref checkup sizes lint

down:		a.out
		download -s

d:		a.out
		download -a4 ; odt

lint:		,lint

,lint:		$(CFILES)
		lint -n -I../h $(CFILES) | Flint > ,lint

print:
		cprint -c Cover ../h/*.h *.c *.s

listings:	xref sizes
		cprint -c Cover Configuration ../h/*.h *.c *.s \
		    ,xref ,sizes ,ssizes Makefile

checkup:
		Checkup

sizes:		,sizes ,ssizes

,sizes:		$(OFILES) $(XOFILES) a.out
		size11 *.o a.out > ,sizes

,ssizes:	$(CFILES) $(SFILES) $(HFILES)
		Dosizes

libx86.a:		$(OFILES)
		/bin/rm -nf  libx86.a
		$(AR) cr libx86.a `$(LORDER) $(OFILES) | tsort`
		$(RANLIB) libx86.a

testw:		testw.o $(LIB)/libx86.a 
		$(CC) -o testw testw.o  
testr:		testr.o $(LIB)/libx86.a i550init.o
		$(CC) -o testr testr.o  i550init.o

test2:		test2.o $(LIB)/libx86.a
		${CC} -o test2 test2.o

testarp:	test_arp.o  $(LIB)/libx86.a 
		$(CC) -o testarp test_arp.o 

simple:		simple.o i550init.o
		$(CC) -o simple simple.o i550init.o

a86.out:	i550test.o $(LIB)/libx86.a
		$(CC) i550test.o
		nm86 a86.out | grep extern > a86.nm

i550clove:	i550clove.o $(LIB)/libx86.a
		$(CC) -o i550clove i550clove.o
		nm86 i550clove | grep extern > i550clove.nm

i550cinn:	i550cinn.o $(LIB)/libx86.a
		$(CC) -o i550cinn i550cinn.o
		nm86 i550cinn | grep extern > i550cinn.nm

symtab:
		(sort a86.nm|pr;sort +0.12 -0.16 a86.nm|pr)|spr &

xinu86.o:	$(XOFILES)
		$(LD) -r $(XOFILES) -o xinu86.o

a.out:		libx86.a xinu86.o test.o
		$(LD) -e start xinu86.o test.o libx86.a $(LIB)/libxc.a libx86.a
		Mknlist ,nm

nm:		,nm

,nm:		a.out
		Mknlist ,nm

tags:		,tags

,tags:		$(CFILES) $(HFILES)
		ctags $(CFILES)	$(HFILES)
		mv tags ,tags

xref:		,xref

,xref:		,tags
		Doxref

../h/conf.h:	Configuration
		config
#		rm $(DIR)/include/conf.h
#		ln ../h/conf.h $(DIR)/include/conf.h

conf.c:		Configuration
		config

depend:
		grep '^#include' $(CFILES) $(HFILES)		\
		| sed	-e 's/</"..\/h\//;s/>/"/'		\
			-e 's/:[^"]*"\([^"]*\)".*/: \1/'	\
		| sed	's/\.c/.o/' >makedep
		echo '/^# DO NOT DELETE	THIS LINE/+2,$$d' >eddep
		echo '$$r makedep' >>eddep
		echo 'w' >>eddep
		cp Makefile .,oldmake
		cp Makefile ,Makefile
		ed - ,Makefile < eddep
		/bin/rm eddep makedep
		echo '#	DEPENDENCIES MUST END AT END OF	FILE' >>,Makefile
		echo '#	IF YOU PUT STUFF HERE IT WILL GO AWAY'>>,Makefile
		echo '#	see make depend	above'>>,Makefile
		/bin/mv ,Makefile Makefile
setclkr.o: setclkr.s
	@echo Warning messages are OK for setclkr.s
	$(CC) $(CFLAGS) setclkr.s
clkint.o: clkint.s
	@echo Warning messages are OK for clkint.s
	$(CC) $(CFLAGS) clkint.s
acia.o: acia.s
	@echo Warning messages are OK for acia.s
	$(CC) $(CFLAGS) acia.s
	
# DO NOT DELETE	THIS LINE
# DEPENDENCIES MUST END	AT END OF FILE
chprio.o: ../h/conf.h
chprio.o: ../h/kernel.h
chprio.o: ../h/proc.h
clkinit.o: ../h/conf.h
clkinit.o: ../h/kernel.h
clkinit.o: ../h/sleep.h
close.o: ../h/conf.h
close.o: ../h/kernel.h
close.o: ../h/io.h
conf.o: ../h/conf.h
control.o: ../h/conf.h
control.o: ../h/kernel.h
control.o: ../h/io.h
create.o: ../h/conf.h
create.o: ../h/kernel.h
create.o: ../h/proc.h
create.o: ../h/mem.h
finput.o: ../h/conf.h
finput.o: ../h/kernel.h
finput.o: ../h/frame.h
foutput.o: ../h/conf.h
foutput.o: ../h/kernel.h
foutput.o: ../h/frame.h
foutput.o: ../h/dlc.h
freceive.o: ../h/conf.h
freceive.o: ../h/kernel.h
freceive.o: ../h/frame.h
freebuf.o: ../h/conf.h
freebuf.o: ../h/kernel.h
freebuf.o: ../h/mark.h
freebuf.o: ../h/bufpool.h
freemem.o: ../h/conf.h
freemem.o: ../h/kernel.h
freemem.o: ../h/mem.h
frinit.o: ../h/conf.h
frinit.o: ../h/kernel.h
frinit.o: ../h/frame.h
frsend.o: ../h/conf.h
frsend.o: ../h/kernel.h
frsend.o: ../h/frame.h
frsend.o: ../h/dlc.h
frtimer.o: ../h/conf.h
frtimer.o: ../h/kernel.h
frtimer.o: ../h/frame.h
getbuf.o: ../h/conf.h
getbuf.o: ../h/kernel.h
getbuf.o: ../h/mark.h
getbuf.o: ../h/bufpool.h
getc.o: ../h/conf.h
getc.o: ../h/kernel.h
getc.o: ../h/io.h
getitem.o: ../h/conf.h
getitem.o: ../h/kernel.h
getitem.o: ../h/q.h
getmem.o: ../h/conf.h
getmem.o: ../h/kernel.h
getmem.o: ../h/mem.h
getmid.o: ../h/conf.h
getmid.o: ../h/kernel.h
getmid.o: ../h/frame.h
getpid.o: ../h/conf.h
getpid.o: ../h/kernel.h
getpid.o: ../h/proc.h
getprio.o: ../h/conf.h
getprio.o: ../h/kernel.h
getprio.o: ../h/proc.h
getstk.o: ../h/conf.h
getstk.o: ../h/kernel.h
getstk.o: ../h/mem.h
i550cntl.o: ../h/conf.h
i550cntl.o: ../h/kernel.h
i550cntl.o: ../h/i550.h
i550cntl.o: ../h/proc.h
i550intr.o: ../h/i550.h
i550intr.o: ../h/kernel.h
i550init.o: ../h/i550.h
i550init.o: ../h/conf.h
i550init.o: ../h/kernel.h
i550input.o: ../h/i550.h
i550input.o: ../h/kernel.h
i550input.o: ../h/conf.h
ip_ether.o: ../h/io.h
ip_ether.o: ../h/kernel.h
ip_ether.o: ../h/conf.h
ip_ether.o: ../h/i550.h
i550mrcv.o: ../h/i550.h
i550mrcv.o: ../h/kernel.h
i550mxmt.o: ../h/i550.h
i550mxmt.o: ../h/kernel.h
i550open.o: ../h/i550.h
i550open.o: ../h/kernel.h
i550open.o: ../h/conf.h
i550open.o: ../h/mark.h
i550read.o: ../h/conf.h
i550read.o: ../h/proc.h
i550read.o: ../h/i550.h
i550read.o: ../h/mark.h
i550read.o: ../h/kernel.h
i550tframe.o: ../h/i550.h
i550tframe.o: ../h/proc.h
i550write.o: ../h/conf.h
i550write.o: ../h/proc.h
i550write.o: ../h/i550.h
i550write.o: ../h/kernel.h
i550write.o: ../h/mark.h
initpic.o: ../h/kernel.h
init.o: ../h/conf.h
init.o: ../h/kernel.h
init.o: ../h/io.h
initialize.o: ../h/conf.h
initialize.o: ../h/kernel.h
initialize.o: ../h/proc.h
initialize.o: ../h/sem.h
initialize.o: ../h/mem.h
initialize.o: ../h/io.h
initialize.o: ../h/slu.h
initialize.o: ../h/tty.h
initialize.o: ../h/q.h
initialize.o: ../h/disk.h
insert.o: ../h/conf.h
insert.o: ../h/kernel.h
insert.o: ../h/q.h
insertd.o: ../h/conf.h
insertd.o: ../h/kernel.h
insertd.o: ../h/q.h
ioerr.o: ../h/conf.h
ioerr.o: ../h/kernel.h
ioinit.o: ../h/conf.h
ioinit.o: ../h/kernel.h
ioinit.o: ../h/io.h
ionull.o: ../h/conf.h
ionull.o: ../h/kernel.h
kill.o: ../h/conf.h
kill.o: ../h/kernel.h
kill.o: ../h/proc.h
kill.o: ../h/sem.h
kill.o: ../h/mem.h
kprintf.o: ../h/conf.h
kprintf.o: ../h/kernel.h
kprintf.o: ../h/io.h
kprintf.o: ../h/slu.h
kprintf.o: ../h/tty.h
lfclose.o: ../h/conf.h
lfclose.o: ../h/kernel.h
lfclose.o: ../h/proc.h
lfclose.o: ../h/disk.h
lfclose.o: ../h/lfile.h
lfgetc.o: ../h/conf.h
lfgetc.o: ../h/kernel.h
lfgetc.o: ../h/proc.h
lfgetc.o: ../h/disk.h
lfgetc.o: ../h/lfile.h
lfgetc.o: ../h/dir.h
lfinit.o: ../h/conf.h
lfinit.o: ../h/kernel.h
lfinit.o: ../h/disk.h
lfinit.o: ../h/lfile.h
lfputc.o: ../h/conf.h
lfputc.o: ../h/kernel.h
lfputc.o: ../h/proc.h
lfputc.o: ../h/disk.h
lfputc.o: ../h/lfile.h
lfputc.o: ../h/dir.h
lfread.o: ../h/conf.h
lfread.o: ../h/kernel.h
lfread.o: ../h/disk.h
lfread.o: ../h/lfile.h
lfread.o: ../h/dir.h
lfseek.o: ../h/conf.h
lfseek.o: ../h/kernel.h
lfseek.o: ../h/disk.h
lfseek.o: ../h/lfile.h
lfseek.o: ../h/dir.h
lfsetup.o: ../h/conf.h
lfsetup.o: ../h/kernel.h
lfsetup.o: ../h/disk.h
lfsetup.o: ../h/lfile.h
lfsetup.o: ../h/dir.h
mark.o: ../h/conf.h
mark.o: ../h/kernel.h
mark.o: ../h/mark.h
mdump.o: ../h/kernel.h
mdump.o: ../h/mem.h
mkpool.o: ../h/conf.h
mkpool.o: ../h/kernel.h
mkpool.o: ../h/mark.h
mkpool.o: ../h/bufpool.h
netinit.o: ../h/conf.h
netinit.o: ../h/kernel.h
netinit.o: ../h/frame.h
newqueue.o: ../h/conf.h
newqueue.o: ../h/kernel.h
newqueue.o: ../h/q.h
open.o: ../h/conf.h
open.o: ../h/kernel.h
open.o: ../h/io.h
pcount.o: ../h/conf.h
pcount.o: ../h/kernel.h
pcount.o: ../h/mark.h
pcount.o: ../h/ports.h
pcreate.o: ../h/conf.h
pcreate.o: ../h/kernel.h
pcreate.o: ../h/mark.h
pcreate.o: ../h/ports.h
pdelete.o: ../h/conf.h
pdelete.o: ../h/kernel.h
pdelete.o: ../h/mark.h
pdelete.o: ../h/ports.h
pinit.o: ../h/conf.h
pinit.o: ../h/kernel.h
pinit.o: ../h/mark.h
pinit.o: ../h/ports.h
poolinit.o: ../h/conf.h
poolinit.o: ../h/kernel.h
poolinit.o: ../h/mark.h
poolinit.o: ../h/bufpool.h
prdump.o: ../h/conf.h
prdump.o: ../h/kernel.h
prdump.o: ../h/proc.h
prdump.o: ../h/q.h
preceive.o: ../h/conf.h
preceive.o: ../h/kernel.h
preceive.o: ../h/mark.h
preceive.o: ../h/ports.h
preset.o: ../h/conf.h
preset.o: ../h/kernel.h
preset.o: ../h/mark.h
preset.o: ../h/ports.h
psend.o: ../h/conf.h
psend.o: ../h/kernel.h
psend.o: ../h/mark.h
psend.o: ../h/ports.h
ptclear.o: ../h/conf.h
ptclear.o: ../h/kernel.h
ptclear.o: ../h/mark.h
ptclear.o: ../h/ports.h
putc.o: ../h/conf.h
putc.o: ../h/kernel.h
putc.o: ../h/io.h
qdump.o: ../h/conf.h
qdump.o: ../h/kernel.h
qdump.o: ../h/proc.h
qdump.o: ../h/q.h
queue.o: ../h/conf.h
queue.o: ../h/kernel.h
queue.o: ../h/q.h
read.o: ../h/conf.h
read.o: ../h/kernel.h
read.o: ../h/io.h
ready.o: ../h/conf.h
ready.o: ../h/kernel.h
ready.o: ../h/proc.h
ready.o: ../h/q.h
receive.o: ../h/conf.h
receive.o: ../h/kernel.h
receive.o: ../h/proc.h
recvclr.o: ../h/conf.h
recvclr.o: ../h/kernel.h
recvclr.o: ../h/proc.h
resched.o: ../h/conf.h
resched.o: ../h/kernel.h
resched.o: ../h/proc.h
resched.o: ../h/q.h
resume.o: ../h/conf.h
resume.o: ../h/kernel.h
resume.o: ../h/proc.h
scount.o: ../h/conf.h
scount.o: ../h/kernel.h
scount.o: ../h/sem.h
screate.o: ../h/conf.h
screate.o: ../h/kernel.h
screate.o: ../h/proc.h
screate.o: ../h/q.h
screate.o: ../h/sem.h
sdelete.o: ../h/conf.h
sdelete.o: ../h/kernel.h
sdelete.o: ../h/proc.h
sdelete.o: ../h/q.h
sdelete.o: ../h/sem.h
seek.o: ../h/conf.h
seek.o: ../h/kernel.h
seek.o: ../h/io.h
send.o: ../h/conf.h
send.o: ../h/kernel.h
send.o: ../h/proc.h
sendf.o: ../h/conf.h
sendf.o: ../h/kernel.h
sendf.o: ../h/proc.h
signal.o: ../h/conf.h
signal.o: ../h/kernel.h
signal.o: ../h/proc.h
signal.o: ../h/q.h
signal.o: ../h/sem.h
signaln.o: ../h/conf.h
signaln.o: ../h/kernel.h
signaln.o: ../h/proc.h
signaln.o: ../h/q.h
signaln.o: ../h/sem.h
sleep.o: ../h/conf.h
sleep.o: ../h/kernel.h
sleep.o: ../h/proc.h
sleep.o: ../h/q.h
sleep.o: ../h/sleep.h
sleep10.o: ../h/conf.h
sleep10.o: ../h/kernel.h
sleep10.o: ../h/proc.h
sleep10.o: ../h/q.h
sleep10.o: ../h/sleep.h
sreset.o: ../h/conf.h
sreset.o: ../h/kernel.h
sreset.o: ../h/proc.h
sreset.o: ../h/q.h
sreset.o: ../h/sem.h
ssclock.o: ../h/conf.h
ssclock.o: ../h/kernel.h
ssclock.o: ../h/proc.h
ssclock.o: ../h/q.h
ssclock.o: ../h/sleep.h
suspend.o: ../h/conf.h
suspend.o: ../h/kernel.h
suspend.o: ../h/proc.h
ttycntl.o: ../h/conf.h
ttycntl.o: ../h/kernel.h
ttycntl.o: ../h/io.h
ttycntl.o: ../h/slu.h
ttycntl.o: ../h/tty.h
ttygetc.o: ../h/conf.h
ttygetc.o: ../h/kernel.h
ttygetc.o: ../h/io.h
ttygetc.o: ../h/slu.h
ttygetc.o: ../h/tty.h
ttyiin.o: ../h/conf.h
ttyiin.o: ../h/kernel.h
ttyiin.o: ../h/io.h
ttyiin.o: ../h/slu.h
ttyiin.o: ../h/tty.h
ttyinit.o: ../h/conf.h
ttyinit.o: ../h/kernel.h
ttyinit.o: ../h/io.h
ttyinit.o: ../h/slu.h
ttyinit.o: ../h/tty.h
ttyoin.o: ../h/conf.h
ttyoin.o: ../h/kernel.h
ttyoin.o: ../h/io.h
ttyoin.o: ../h/slu.h
ttyoin.o: ../h/tty.h
ttyputc.o: ../h/conf.h
ttyputc.o: ../h/kernel.h
ttyputc.o: ../h/io.h
ttyputc.o: ../h/slu.h
ttyputc.o: ../h/tty.h
ttyread.o: ../h/conf.h
ttyread.o: ../h/kernel.h
ttyread.o: ../h/io.h
ttyread.o: ../h/slu.h
ttyread.o: ../h/tty.h
ttywrite.o: ../h/conf.h
ttywrite.o: ../h/kernel.h
ttywrite.o: ../h/io.h
ttywrite.o: ../h/slu.h
ttywrite.o: ../h/tty.h
userret.o: ../h/conf.h
userret.o: ../h/kernel.h
wait.o: ../h/conf.h
wait.o: ../h/kernel.h
wait.o: ../h/proc.h
wait.o: ../h/q.h
wait.o: ../h/sem.h
wakeup.o: ../h/conf.h
wakeup.o: ../h/kernel.h
wakeup.o: ../h/proc.h
wakeup.o: ../h/q.h
wakeup.o: ../h/sleep.h
write.o: ../h/conf.h
write.o: ../h/kernel.h
write.o: ../h/io.h
../h/disk.h: ../h/xebec.h
../h/disk.h: ../h/dtc.h
#	DEPENDENCIES MUST END AT END OF	FILE
#	IF YOU PUT STUFF HERE IT WILL GO AWAY
#	see make depend	above
