#############################################################################
#	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 tftp loader
#					
#
#	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 -DSTANLEY  # O3 - optimization level 3
					# c  - compile only
CFLAGS	= ${ARCH} -I${IDIR1} -I${IDIR2} ${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.o:
	${CC} ${CFLAGS} $*.c

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


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


IDIR1	= ../include
IDIR2	= ../../i960/include

LDIR    = ../lib

.PATH.h_v = ${PIDIR1} ;${PIDIR2} 
.PATH.h   = ${IDIR1} ;${IDIR2} ;.
.path.c_v = ${PSDIR}

#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------
tftpboot.o:	tftpmain.o tftpinit.o 
	${LD} ${ARCH} -o tftpboot.o -r tftpmain.o tftpinit.o
	cp tftpboot.o ${LDIR}/tftpboot.o

tftpmain.o:	Makefile ${IDIR2}/krnl.h ${IDIR2}/types.h ${IDIR1}/dips.h \
		${IDIR2}/eeprom.h ${IDIR2}/netbuf.h ${IDIR2}/error.h \
		${IDIR2}/tcpip.h ${IDIR2}/nim960h.h ${IDIR2}/udp.h \
		${IDIR2}/tftpboot.h ${IDIR2}/tftp.h ${IDIR1}/sys.h \
		${IDIR1}/eeprecs.h ${IDIR1}/led.h ${IDIR1}/nvrecs.h \
		${IDIR1}/log.h ${IDIR1}/memory.h ${IDIR1}/filter.h \
		${IDIR1}/prcadr.h ${IDIR1}/bitmask.h ${IDIR1}/target.h \
		${IDIR2}/lme.h

tftpinit.o:	Makefile
