# Makefile - makefile for src/hwif/vxbus
#
# Copyright (c) 2012, 2013 Wind River Systems, Inc.
#
# The right to copy, distribute, modify or otherwise make use
# of this software may be licensed only pursuant to the terms
# of an applicable Wind River license agreement.
#
# modification history
# --------------------
# 01o,18sep13,e_d  add vxbSdLib.o
# 01n,03jun12,y_y  add vxbSpiLib.o
# 01m,03feb11,l_z  add vxbI2cLib.o
# 01l,27oct08,h_k  fixed warning for TARGET is not man.
# 01k,21oct08,h_k  added APIs doc in the vxbPci.bc.
# 01j,15aug08,h_k  added vxbArchAccess.o.
# 01i,08jul08,tor  library  build
# 01h,03jul08,dtr  Remove vxbPci* until fixed.
# 01g,30jun08,tor  library build
# 01f,20jun08,pmr  add vxbRapidIOCfgTable, vxbRapidIO
# 01e,01may08,tor  update vxBus version
# 01d,10mar08,h_k  changed CC_OPTIM_DRIVER to CC_OPTIM_NORMAL.
# 01c,10aug07,h_k  changed the LIB_BASE_NAME to drv.
# 01b,25apr06,mdo  Update the list of DOC_FILES
# 01a,07nov05,mdo   created from MakeSkel
#
# DESCRIPTION
# This file contains the makefile rules for building the vxBus library
#
#*/

TGT_DIR=$(WIND_BASE)/target

DOC_FILES_C =	vxbArchAccess.c vxbPciAccess.c vxbPlb.c vxbPlbAccess.c   \
		vxbRapidIO.c vxbRapidIOCfgTable.c vxbShow.c vxBus.c \
		vxbI2cLib.c vxbSpiLib.c vxbSdLib.c

DOC_FILES_I =	vxbPci.i

DOC_FILES   =	$(DOC_FILES_C) $(DOC_FILES_I)

LIB_BASE_NAME=drv

EXTRA_INCLUDE=-I$(TGT_DIR)/h/

OBJS=	vxbArchAccess.o \
	vxbPci.o vxbPciAccess.o \
	vxbPlb.o vxbPlbAccess.o \
	vxbRapidIO.o vxbRapidIOCfgTable.o \
	vxbI2cLib.o vxbSpiLib.o vxbSdLib.o \
	vxbShow.o vxBus.o 

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

CC_OPTIM=$(CC_OPTIM_NORMAL)
include  $(TGT_DIR)/h/make/defs.drivers

ifeq ($(MAKECMDGOALS), man)
 ifneq ($(wildcard *.i), $(DOC_FILES_I))
DOC_FLAGS +=	$(OPTION_DEFINE_MACRO)DOC \
		$(OPTION_DEFINE_MACRO)INCLUDE_SHOW_ROUTINES $(EXTRA_DOC_FLAGS)
%.i: %.c
	@echo ""; echo "Processing $< ... "
	@-$(CPP) $(CASFLAGS) $(OPTION_PP_COMMENT) $(DOC_FLAGS) $< 1> $@
	@make man
	@-$(RM) $@

man: $(DOC_FILES_I)
	@echo ""
 endif
endif
