#
#	Program Name:	nim960 bridge
#
#
#	Creation Date:	12.5.91
#
#	Date:		
#
#	Version:	1.0
#
#	Programmers:	K Kong
#
#	Modifications:
#
#	Comments:	The makefile for the auto configuration.
#
#	Copyright (c) 1991 by Hughes LAN Systems
#
#-----------------------------------------------------------------------------
#		Makefile for tftp
#
#-----------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Where to find things (include files)
#------------------------------------------------------------------------------
.LOGFILE .c_v(.c)
.LOGFILE .s_v(.s)
.LOGFILE .h_v(.h)

ROOT	= .
PIDIR1	= ${ROOT}/bridge/include	# where the .h_v files are
PIDIR2	= ${ROOT}/i960/include
PSDIR	= ${ROOT}/bridge/config		# where the .c_v and .s_v files are

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


# Defaults to GNU/960 tool set:
#
CC	= gcc960
ARCH	= -ACA			# -ACA:	Generate CA instructions
OPT	= -O3 -c      		# -O3: 	optimize 
				# -c:	compile only
CFLAGS	= ${ARCH} -I${IDIR1} -I${IDIR2}  \
	${OPT} -DSTANLEY -mstrict-align 
AS	= gas960
ASFLAGS	= ${ARCH}
LD	= gld960
LFLAGS	= ${ARCH} -o $(TARG) -r 

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


#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------
TARG	= config.o		# target output

TARG_OBJS=	readconf.o getload.o autoconf.o


$(TARG): ${TARG_OBJS}
	${LD} $(LFLAGS) ${TARG_OBJS}
	cp ${TARG} ../lib
#------------------------------------------------------------------------------
# SPECIAL CASES
#------------------------------------------------------------------------------


#------------------------------------------------------------------------------
# HEADER-FILE DEPENDENCIES
#------------------------------------------------------------------------------
readconf.o:	Makefile ${IDIR2}/krnl.h ${IDIR2}/types.h
getload.o:	Makefile ${IDIR2}/types.h ${IDIR2}/eeprom.h ${IDIR1}/eeprecs.h \
		${IDIR1}/memory.h ${IDIR2}/dbd.h
autoconf.o:	Makefile ${IDIR2}/krnl.h ${IDIR2}/types.h ${IDIR1}/dips.h \
		${IDIR2}/eeprom.h ${IDIR1}/nvrecs.h ${IDIR2}/netbuf.h \
		${IDIR2}/error.h ${IDIR1}/sys.h ${IDIR2}/tcpip.h \
		${IDIR2}/udp.h ${IDIR2}/tftpboot.h ${IDIR2}/tftp.h \
		${IDIR2}/bootp.h ${IDIR1}/eeprecs.h ${IDIR1}/led.h \
		${IDIR1}/prcctl.h ${IDIR1}/memory.h ${IDIR2}/dbd.h \
		${IDIR2}/nvram.h ${IDIR1}/filter.h ${IDIR1}/prcadr.h \
		${IDIR1}/bitmask.h ${IDIR1}/log.h ${IDIR2}/lme.h \
		${IDIR1}/target.h


