# Makefile - Makefile for target/config/kontron pITX-SP_
#
# Copyright (c) 2010 Wind River Systems, Inc.
#
# Copyright 2010 Kontron Modular Computers GmbH
#
# modification history
# --------------------
# 02a,03mar11,sob  modified for Kontron pITX-SP  board
# 01a,30apr10,rbc  created based on itl_crownbeach/Makefile	(01a)
#

CPU        = PENTIUM4
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_pitx-sp
VENDOR       =
BOARD        = Kontron pITX-SP
KONTRON_DIR  = $(WIND_BASE)/target/config/kontron_pitx-sp/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

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


LIB_EXTRA         = libkontron_pitx-sp.a
#LIB_EXTRA         = 

#MACH_EXTRA	 = vxbMC146818RtcK.o pitx-sp_cpld.o pitx-sp_wd.o pitx-sp_gpio.o pitx-sp_fan.o vxbSchSMBus.o vxbW83L771.o vxbIntelAhciStorageK.o ataDrvK.o vxbPitxSpEeprom.o I2C_BB.o
MACH_EXTRA		 = 

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

$(LIB_EXTRA):	$(MACH_EXTRA)
	rm -rf $(LIB_EXTRA)
	$(AR) r $(LIB_EXTRA) $(MACH_EXTRA)
	$(RANLIB) $(LIB_EXTRA)


LOCAL_DRIVERS = \
		vxbMC146818RtcK.html \
		vxbW83L771.html \
		pitx-sp_cpld.html \
		pitx-sp_gpio.html \
		pitx-sp_fan.html \
		pitx-sp_wd.html

localdocs: $(LOCAL_DRIVERS)
	sed -i -e "s|http://kontron.bsp|.|g" $(DOC_DIR)/$(BSP_NAME)_$(VXWORKS_VER)/target.html

%.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,$@)
