# Makefile
# CREATED BY mpp
#       FROM MakeSkel
#         ON Tue Sep 20 14:28:22 PDT 1994
#


# MakeSkel - makefile skeleton for vw/config/frc386
#
# modification history
# --------------------
# 02k,18nov92,hdn  changed ROM_TEXT_ADRS and ROM_SIZE.
# 02j,30aug91,jaa  updated for doc generation.
# 02i,07jun91,hdn  changed comment for h32.
# 02h,06may91,hdn  Added defines and macros for TRON architecture.
# 02g,25mar91,shl  deleted REL_HIGH_FLAGS and REL_LOW_ADRS.
# 02f,21mar91,shl  changed RAM_TEXT_[LOW,HIGH]_ADRS to RAM_[LOW/HIGH]_ADRS.
#             gae  added DOC_DIR.
# 02e,09jun90,gae  added ROM_SIZE and adjusted & renamed compress parameters.
# 02d,30apr90,rdc  added UNCMPRS_TEXT_ADRS and UNCMPRS_REL_FLAGS.
# 02c,17feb90,gae  added makeDirs.
# 02b,20aug89,gae  added ARCH.
# 02a,24jun89,gae  added modification history.
#                  added tyP2Drv.o dependency.
#
# DESCRIPTION
# This file contains rules for building VxWorks for the
# Force 386.
#
# NOTE
# The constants ROM_TEXT_ADRS and RAM_HIGH_ADRS
# must be identical to those in config.h.
# 
# INCLUDES
#     makeHost
#     makeDirs
#     makeTarget
#*/

CPU		= I80386
TOOL		= gnu

TARGET_DIR = frc386
VENDOR     = Force
BOARD      = Force386

ROM_TEXT_ADRS      = fffc0000	# ROM entry address
ROM_SIZE           = 00040000	# number of bytes of ROM space

RAM_LOW_ADRS       = 00002000	# RAM text/data address
RAM_HIGH_ADRS      = 00090000	# RAM text/data address

HEX_FLAGS          = -a 0

MACH_EXTRA     = tyDUSCCDrv.o 

# makeTarget - meta makeTarget stub for building BSPs
#
# modification history
# --------------------
# 01a,22sep92,yp    added modification history
#
# DESCRIPTION
# This file contains the makeTarget and intermediate makeTarget for VxWorks.
#*/

# makeTarget1 - makefile target skeleton for BSP Targets "pass 1"
#
# modification history
# --------------------
# 01h,15oct92,gae  added -I flag for preprocessing docs.
# 01g,21sep92,yp   removed -P flag from pre-processor pass for docs
# 01f,16sep92,gae  moved doc rules here from pass 2.
# 01e,11sep92,gae  made doc rules do something.
# 01d,04sep92,yp   fixed doc rule
# 01c,02sep92,yp   added documentation rule
# 01b,21jul92,rrr  added rules for save, restore, release, and clean
# 01a,17jul92,wmd  added mod history, targets vxWorks.res_rom.hex,
#		   bootrom_res, and bootrom_res.hex.
#
# DESCRIPTION
# This file contains the targets and intermediate targets for VxWorks.
#

MAN1	 = ../../man/man1/
MAN2	 = ../../man/man1/
MAKESKEL = MakeSkel
RM       = rm -f
CP       = cp -p

default:	vxWorks

vxWorks:	     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks

vxWorks_rom:	     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks_rom

vxWorks_rom.hex:     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks_rom.hex

vxWorks.st:	     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks.st

vxWorks.st_rom:	     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks.st_rom

vxWorks.st_rom.hex:  Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks.st_rom.hex

vxWorks.res_rom:     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks.res_rom

vxWorks.res_rom.hex: Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) vxWorks.res_rom.hex

bootrom:	     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) bootrom

bootrom.hex:	     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) bootrom.hex

bootrom_res:         Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) bootrom_res

bootrom_res.hex:     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) bootrom_res.hex

bootrom_uncmp:	     Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) bootrom_uncmp

bootrom_uncmp.hex:   Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) bootrom_uncmp.hex

release:	Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) release

clean:	Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) clean

restore:	Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) restore

save:	Makefile.$(CPU)$(TOOL) .neverbuilt
	make -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) save


Makefile.$(CPU)$(TOOL):	MakeSkel $(VX_VW_BASE)/h/make/make.defaults \
    $(VX_VW_BASE)/h/make/make.$(CPU)$(TOOL) $(VX_VW_BASE)/h/make/makeTarget2 
	$(RM) $@
	$(VX_HSP_BASE)/bin/$(VX_HOST_TYPE)/mpp $(CPU)$(TOOL) > $@
	make -f $@ CPU=$(CPU) TOOL=$(TOOL) depend.$(CPU)$(TOOL)

.neverbuilt:

########## documentation #######################################################

man: $(MAN1)/$(TARGET_DIR).1 docs

$(MAN1)/$(TARGET_DIR).1: target.nr
	$(CP) $? $@

DOC_FILES = sysLib tyCoDrv

ENV_BIN = $(TOOLENV) $(VX_HSP_BASE)/bin/$(VX_HOST_TYPE)/
CPP=$(ENV_BIN)cpp
MG=$(ENV_BIN)mg

docs:
	@- (doc_files="$(DOC_FILES)" ; \
	echo -n "Processing " ; \
	for file in $$doc_files ; do \
		echo -n "$$file " ; \
		$(CPP) -E -C -DDOC -I../../src/drv/ $$file.c 1> $$file.i 2> /dev/null ; \
		$(MG) -p $(TARGET_DIR) $$file.i ; \
		$(RM) $$file.i ; \
	done ; \
	echo "complete." )

################################################################################

# end of makeTarget1


# end of makeTarget


RELEASE = vxWorks vxWorks.st bootrom_uncmp vxsys.o

# end MakeSkel
