#############################################################################
#	Program Name:	BRIDGE for stanley
#
#	Filename:	Makefile
#
#	Creation Date:	5.8.91
#
#	Date:		5.8.91
#
#	Version:	1.0
#
#	Programmers:	K Kong
#
#	Modifications:
#
#	Comments:	The is the makefile for the remote console 
#					
#
#	Copyright (c) 1991 by Hughes LAN Systems
#
#############################################################################
# Defaults to GNU/960 tool set:
#
.LOGFILE .c_v(.c)
.LOGFILE .s_v(.s)
.LOGFILE .h_v(.h)

CC	= gcc960			# gnu960 cross C compiler 
ARCH	= -ACA				# This is CA architecture
OPT	= -O3 -c  			# O3 - optimization level 3
					# c  - compile only
CFLAGS	= ${ARCH} -I${IDIR2} -I${IDIR1} -I${IDIR3} ${OPT} -mstrict-align
					#
					# I - 	specify the search path for
					# 	any include files
					# mstrict-align
					#	Sequences of smaller memory
					#	reference are used instead
					#	of larger ones which might
					#	not be correctly aligned.
AS	= gas960			# gnu960 assembler
ASFLAGS	= ${ARCH}
LD	= gld960  			# gnu960 linker
TOOLSET = ${GFLAG}

GETOPTS	= -q
# Essential under System V, harmless elsewhere
SHELL = /bin/sh

# Standard rules
#
.c_v.c:
	=get $(GETOPTS) $<\($@\)

.h_v.h:
	=get $(GETOPTS) $<\($@\)

.s_v.s:
	=get $(GETOPTS) $<\($@\)

.c.s:
	${CC} ${CFLAGS} -S $*.c

.c.o:
	${CC} ${CFLAGS} $*.c

.s.o:
	${AS} ${ASFLAGS} -o $*.o $*.s


#------------------------------------------------------------------------------
# Where to find things (include files, ROM images)
#------------------------------------------------------------------------------
ROOT	= /b/gregs
PIDIR1	= ${ROOT}/bridge/include	# where the .h_v files are
PIDIR2	= ${ROOT}/i960/include
PSDIR	= ${ROOT}/bridge/netio		# where the .c_v and .s_v files are

IDIR1	= ../include
IDIR2	= ../../i960/include
IDIR3	= ../declike/inc
.PATH.h_v = ${PSDIR}; ${PIDIR1} ;${PIDIR2} 
.PATH.h   = . ;${IDIR1} ;${IDIR2} 
.PATH.c_v = ${PSDIR}
.PATH.s_v = ${PSDIR}


LDIR    = ../lib

#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------
OBJS= netio.o stdio.o 



netio: $(OBJS) Makefile
	${LD} ${ARCH} -o netio  -r ${OBJS}
	cp netio ../lib/netio.o

netio.o:	Makefile ${IDIR2}/types.h ${IDIR2}/krnl.h ${IDIR2}/task.h \
		${IDIR2}/netbuf.h ${IDIR2}/dbd.h ${IDIR2}/ip.h ${IDIR2}/mtcp.h \
		${IDIR2}/tcpip.h ${IDIR2}/telnet.h ${IDIR2}/error.h netio.h \
		${IDIR1}/sys.h ${IDIR1}/target.h ${IDIR2}/lme.h ${IDIR2}/mtcpblk.h

stdio.o:	Makefile ${IDIR2}/types.h ${IDIR2}/krnl.h ${IDIR2}/dbd.h  \
		${IDIR2}/tcpip.h ${IDIR2}/telnet.h netio.h ${IDIR1}/sys.h \
		${IDIR1}/target.h ${IDIR2}/lme.h
