# Makefile - makefile for target/src/hwif/hEnd
#
# Copyright (c) 2005-2008, 2016 Wind River Systems, Inc.
#
# modification history
# --------------------
# 02q,17jun16,l_z  include defs.drivers to correct document directory. (VXW6-5624)
# 02p,18nov11,jph  replace the versioned mapping file name with
#                  mappingfile.txt
# 02o,28jul11,jam  update mapping file for docs
# 02n,12may11,jam  change mapping file version
# 02m,06jan11,jph  check if mapping file exists
# 02l,08nov10,jph  add mapping file
# 02k,26oct10,jph  remove version
# 02j,07jul08,jpb  Changed SMP conditional.
# 02i,05jun08,kkz  Use variables for doc version number
# 02h,05sep07,ami  Doc files entry added
# 02g,11jul07,pch  clean up dead code, and don't build this directory for SMP
# 02f,09mar07,pes  Update for new MIPS library structure.
# 02e,20apr06,dtr  Add qeFcc driver.
# 02d,23feb06,pmr  build gei
# 02c,11jan06,wap  Add motFec driver
# 02b,09nov05,wap  Cleanup to compile TSEC and ETSEC drivers correctly
# 02a,19may05,rcs  Merged with Radzy's modifications
#
# DESCRIPTION
# This file contains the makefile rules for building hEnd drivers 
# (Hierarchical Enhanced Network Drivers) into the VxWorks library.
#
# Old style END drivers  are contained in src/drv/end.
#

TGT_DIR=$(WIND_BASE)/target

LIB_BASE_NAME=drv

# Including defs.library to see if _WRS_CONFIG_SMP is defined.
# It must be after LIB_BASE_NAME
include $(TGT_DIR)/h/make/defs.library

ifdef _WRS_CONFIG_SMP
# SMP does not support hEnd drivers
OBJS=

else

EXTRA_INCLUDE=-I$(TGT_DIR)/h/

OBJS_COMMON  =	geiHEnd.o
OBJS_PPC32   =	motTsecHEnd.o etsecHEnd.o geiHEnd.o motFecHEnd.o qeFccHEnd.o \
		hEndParamSys.o
OBJS_MCF5400 =	motFecHEnd.o hEndParamSys.o

OBJS        = $(OBJS_COMMON) $(OBJS_$(CPU))

EXTRA_DEFINE +=	-DINCLUDE_VXBUS

endif

include $(TGT_DIR)/h/make/rules.library
include $(TGT_DIR)/h/make/defs.drivers

# Check if mapping file exists
ifneq ($(wildcard $(DOCS_ROOT)/mappingfile.txt),)
-include $(wildcard $(DOCS_ROOT)/mappingfile.txt)
endif

# Let's not repeat old mistakes. Since we're implementing new drivers
# from scratch, we can no longer have an excuse to avoid using compiler
# optimization when building driver modules.

CC_OPTIM=$(CC_OPTIM_NORMAL)

DOC_FILES = gei.c etsec.c motFec.c motTsec.c qeFcc.c

DOC_DIR = $(DOCS_ROOT)/$(DOC_VX_DRV_API)
DOC_CHAPTER=Driver_APIs
