#############################################################################
#	Program Name:	BOOTER for cheetah
#
#	Filename:	Makefile
#
#	Creation Date:	7.16.93
#
#	Date:		7.16.93
#
#	Version:	1.0
#
#	Programmers:	Frank Salzmann and Vinay Gundi
#
#	Modifications:
#
#	Comments:	The makefile for the booter
#			This makefile will call all other makefiles 
#			to produce the booter image.  The directory
#			structures are:=
#
#			Makefile	This file
#				
#			main.c		The main function
#			booter/
#				system/	It contains the startup module,
#					fault table, interrupt table and
#					prob ...etc.
#
#	Copyright (c) 1993 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
VERSION	=
VER	=
CFLAGS	= ${ARCH} -I${IDIR1} -I${IDIR2} -I${IDIR3} -I${IDIR4} -I${IDIR5} -I${IDIR6} -I${IDIR7}  -I${IDIR8} ${OPT} -D__FDDI_CON -D__FEBRIDGE -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}
LFLAGS	= ${ARCH} -o $(TARG) -r 


# 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

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

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

#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------
TARG	= bootmain		# target output

TARG_OBJS = startup.o main.o init.o tdummy.o debugasm.o flash.o program_flash.o compapi.o fddidrv.o


$(TARG): ${TARG_OBJS}
	${LD} $(LFLAGS) ${TARG_OBJS}


#------------------------------------------------------------------------------
# Where to find things (include files, ROM images)
#------------------------------------------------------------------------------
#ROOT	= /h/pvcs
ROOT	= junk				# so it can't clobber my changes
PIDIR1	= ${ROOT}/bridge/include	# where the .h_v files are
PIDIR2	= ${ROOT}/i960/include
PSDIR	= ${ROOT}/bridge/booter		# where the .c_v and .s_v files are

IDIR1	= ../../include
IDIR2	= ../../../i960/include
IDIR3	= ../../../fddi/fddicon/include
IDIR4	= ../../../fddi/fddicon/smt/dp83200if/headers
IDIR5	= ../../../fddi/fddicon/smt/headers
IDIR6	= ../../../fddi/include
IDIR7	= ../../declike/inc
IDIR8	= ../../../fddi/fddicon/drv/include

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


ODIR	= ../../lib
TCPLIB	= ../../../i960/lib
FDDI	= ../../../fddi/fddicon/lib
#------------------------------------------------------------------------------
# TARG OBJECT FILES
#------------------------------------------------------------------------------


#bootmain: startup.o main.o init.o tdummy.o debugasm.o flash.o program_flash.o compapi.o fddidrv.o Makefile 

startup.o:	Makefile

tdummy.o:	Makefile ${IDIR2}/types.h ${IDIR2}/dbd.h \
		${IDIR2}/uart.h ${IDIR1}/eeprecs.h ${IDIR2}/eeprom.h \
		${IDIR1}/dips.h ${IDIR2}/tcpip.h ${IDIR2}/lme.h

main.o:		Makefile ${IDIR2}/krnl.h ${IDIR1}/target.h  \
		${IDIR1}/memory.h ${IDIR2}/types.h \
		${IDIR2}/eeprom.h ${IDIR2}/nim960h.h ${IDIR2}/uart.h \
		${IDIR1}/dips.h ${IDIR1}/led.h ${IDIR1}/sys.h \
		${IDIR1}/eeprecs.h ${IDIR2}/sncvar.h ${IDIR2}/malloc.h \
		${IDIR2}/dbd.h ${IDIR1}/sys.h ${IDIR2}/sonic.h

init.o:		Makefile ${IDIR2}/krnl.h ${IDIR1}/target.h  \
		${IDIR1}/memory.h ${IDIR2}/types.h \
		${IDIR2}/eeprom.h ${IDIR2}/nim960h.h ${IDIR2}/uart.h \
		${IDIR1}/dips.h ${IDIR1}/led.h ${IDIR1}/sys.h \
		${IDIR1}/eeprecs.h ${IDIR2}/sncvar.h ${IDIR2}/malloc.h \
		${IDIR2}/netbuf.h ${IDIR2}/dbd.h ${IDIR2}/ether.h \
		${IDIR2}/sonic.h
program_flash.o:	Makefile ${IDIR2}/types.h flash.h \
		${IDIR1}/eeprecs.h ${IDIR1}/nvrecs.h ${IDIR2}/nim960h.h

#config.o:		Makefile ${IDIR2}/types.h \
	#	${IDIR2}/eeprom.h ${IDIR2}/nim960h.h ${IDIR2}/uart.h \
	#	${IDIR2}/nvram.h ${IDIR2}/time.h ${IDIR1}/sys.h \
	#	${IDIR1}/eeprecs.h ${IDIR2}/sncvar.h ${IDIR2}/tcpip.h \
	#	${IDIR1}/nvrecs.h

compapi.o: Makefile ${IDIR2}/types.h ${IDIR2}/flash.h


debugasm.o:	Makefile
flash.o:	Makefile
fddidrv.o:	Makefile
