#############################################################################
#	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  #-DADM_DEBUG	# O3 - optimization level 3
					# c  - compile only
CFLAGS	= ${ARCH} -I${IDIR1} ${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}

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

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

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

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

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

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

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


#------------------------------------------------------------------------------
# Where to find things (include files, ROM images)
#------------------------------------------------------------------------------
ROOT	= /h/pvcs
PIDIR	= ${ROOT}/i960/include	# where to find the .h_v files
PSDIR	= ${ROOT}/i960/adminbus	# where to find the .c_v and .s_v files

IDIR1	= ../include
LDIR    = ../lib
.PATH.h_v = ${PIDIR} 
.PATH.h   = ${IDIR} 
.PATH.c_v = ${PSDIR}
.PATH.c   = . 
#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------
OBJS =	relayer.o admfunc.o admcon.o immedcom.o admutil.o funcinit.o funcinf.o 

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

relayer.o:	${IDIR1}/admdrv.h ${IDIR1}/types.h Makefile \
		${IDIR1}/krnl.h ${IDIR1}/netbuf.h ${IDIR1}/dbd.h \
		${IDIR1}/tcpip.h ${IDIR1}/lme.h
admfunc.o:	${IDIR1}/admdrv.h ${IDIR1}/types.h Makefile \
		${IDIR1}/krnl.h ${IDIR1}/dbd.h ${IDIR1}/netbuf.h \
		${IDIR1}/tcpip.h ${IDIR1}/lme.h
admcon.o:	${IDIR1}/admdrv.h ${IDIR1}/types.h Makefile \
		${IDIR1}/krnl.h ${IDIR1}/dbd.h ${IDIR1}/netbuf.h 
immedcom.o:	${IDIR1}/admdrv.h ${IDIR1}/types.h Makefile \
		${IDIR1}/krnl.h ${IDIR1}/netbuf.h ${IDIR1}/dbd.h \
		${IDIR1}/tcpip.h ${IDIR1}/lme.h ${IDIR1}/ether.h \
		${IDIR1}/sockets.h
admutil.o:	${IDIR1}/admdrv.h ${IDIR1}/types.h Makefile \
		${IDIR1}/krnl.h ${IDIR1}/dbd.h ${IDIR1}/netbuf.h \
		${IDIR1}/lme.h
funcinit.o:	${IDIR1}/admdrv.h ${IDIR1}/types.h Makefile \
		${IDIR1}/krnl.h ${IDIR1}/netbuf.h ${IDIR1}/ether.h \
		${IDIR1}/ip.h ${IDIR1}/tcpip.h ${IDIR1}/lme.h \
		${IDIR1}/error.h ${IDIR1}/task.h 
funcinf.o:	${IDIR1}/types.h Makefile 
relayer.o:	${IDIR1}/admdrv.h ${IDIR1}/types.h Makefile \
		${IDIR1}/krnl.h ${IDIR1}/netbuf.h ${IDIR1}/dbd.h \
		${IDIR1}/tcpip.h ${IDIR1}/lme.h

