# Makefile - Makefile for target/config/kontron_kt690
#
# Copyright (c) 2010 Wind River Systems, Inc.
#
# Copyright 2010 Kontron Modular Computers GmbH
#
# modification history
# --------------------
# 01b,9sep10,kpn  adjusted to Kontron KT690 board
# 01a,30apr10,rbc  created based on itl_crownbeach/Makefile	(01a)
#

CPU        = PENTIUM2
TOOL       = diab

TGT_DIR = $(WIND_BASE)/target

include $(TGT_DIR)/h/make/defs.bsp

# Only redefine make definitions below this point, or your definitions will
# be overwritten by the makefile stubs above.

TARGET_DIR   = kontron_kt690
VENDOR       =
BOARD        = Kontron KT690
KONTRON_DIR  = $(WIND_BASE)/target/config/kontron_kt690/kontron

#
# The constants ROM_TEXT_ADRS, ROM_SIZE, are defined
# in config.h, MakeSkel, Makefile, and Makefile.*
# All definitions for these constants must be identical.
#

# ifdef BOOTCODE_IN_RAM
ROM_TEXT_ADRS      = 00008000   # ROM entry address - A: or C:
ROM_SIZE           = 00090000   # number of bytes of ROM space
# else
# ROM_TEXT_ADRS    = fff20000   # ROM entry address - EPROM
# ROM_SIZE         = 0007fe00   # number of bytes of ROM space
# endif

RAM_LOW_ADRS       = 00408000   # VxWorks image entry point
RAM_HIGH_ADRS      = 04008000   # Boot image entry point

EXTRA_DEFINE    = -DFAST_REBOOT

MACH_EXTRA	= 

EXTRA_INCLUDE     += $(subst $(DIRCHAR),/,-I$(KONTRON_DIR)/h)
EXTRA_INCLUDE     += $(subst $(DIRCHAR),/,-I$(KONTRON_DIR)/src)

LIBKONTRON_OBJS    = vxbIntelAhciStorageK.o ataDrvK.o halK.o vxbMC146818RtcK.o vxbW83627dhgK.o vxbI8042KbdK.o vxbW83627wdtK.o

ifeq ($(TOOL),diab)
KONTRONLIBNAME = libkontron_diab.a
else
KONTRONLIBNAME = libkontron_gnu.a
endif

LIB_EXTRA	=	$(KONTRONLIBNAME)

RELEASE        += bootrom.bin

RELEASE        += bootrom.pxe

bootrom.pxe: bootrom.bin pxeBoot.bin
	cat pxeBoot.bin bootrom.bin > bootrom.pxe

# Only redefine make definitions above this point, or the expansion of 
# makefile target dependencies may be incorrect.

include $(TGT_DIR)/h/make/rules.bsp

LOCAL_DRIVERS = halK.html vxbMC146818RtcK.html vxbW83627dhgK.html vxbW83627wdtK.html KnownProblems.html target.ref

localdocs: $(LOCAL_DRIVERS)

%.html: %.c
	apigen -mg -nostrict -config bsp2html -missingok \
		-book VxWorks_APIs -chapter BSP_APIs -category $(BSP_NAME) \
		-out $(DOC_DIR)/$(BSP_NAME)_$(VXWORKS_VER) $(subst .html,.c,$@)

%.html: %.ref
	apigen -mg -nostrict -config bsp2html -missingok \
		-book VxWorks_APIs -chapter BSP_APIs -category $(BSP_NAME) \
		-out $(DOC_DIR)/$(BSP_NAME)_$(VXWORKS_VER) $(subst .html,.ref,$@)
	htmlLink $(DOC_DIR)/$(BSP_NAME)_$(VXWORKS_VER)
	sed -i -e "s|http://kontron.bsp|.|g" $(DOC_DIR)/$(BSP_NAME)_$(VXWORKS_VER)/target.html

libkontron: $(LIBKONTRON_OBJS)
	$(AR) rvs $(KONTRONLIBNAME) $(LIBKONTRON_OBJS)

