# Makefile - makefile for target/src/drv
#
# Copyright (c) 1996, 1998, 2001, 2003-2005, 2007-2010, 2012 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
# --------------------
# 01u,10oct12,x_z  added mtd directory.
# 01u,04dec12,kch  Exclude end subdir if _WRS_CONFIG_NO_IP is defined.
# 01t,18feb10,pch  small footprint
# 01s,29dec09,h_k  removed unsupported module builds from LP64.
# 01r,05may09,l_z  add usb2 for SMP
# 01q,23sep08,pee  adding wlan for SMP, WIND00135265
# 01p,04jul08,jpb  Edited SMP conditional.
# 01o,08oct07,mdo  Need to add i2c
# 01n,02aug07,pmr  add hdisk and dma for SMP
# 01m,11jul07,pch  also include wdb and usb in SMP build
# 01l,10jul07,pch  include erf in SMP build
# 01k,06jul07,pch  don't build this subdirectory for SMP
# 01j,26aug05,ebh  Eliminated reference to vxFusion
# 01i,15apr05,jlk  Added Event Reporting Framework dir to make
# 01h,03feb05,rfr  Added manager and xbd to directories compiled by the
#		   simulator
# 01g,14jun04,dgp  add DOC_OPTS = -mg -nostrict -missingok
# 01f,03nov03,dat  remove netif from vxsim build
# 01e,09nov01,jmp  specified subdirs to build for simulators only.
# 01d,12oct01,tam  added repackaging support
# 01c,04jun98,dat  removed unnecessary EXTRA_INCLUDE, removed bspVersion.o
# 01b,06jan98,cym  Changed -I to $(OPTION_INCLUDE_DIR) to decouple from GNU
# 01a,18jun96,yp   created from 01f of MakeSkel
#
# DESCRIPTION
# This file contains the makefile rules for building the vx library
#
#*/

TGT_DIR=$(WIND_BASE)/target

LIB_BASE_NAME=drv

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

OBJS=

DOC_OPTS = -mg -nostrict -missingok

#
# Cases which do not want to build everything:
# _WRS_CONFIG_MEM_ALLOT, which may as well not build anything requiring malloc;
# simulators, which do not need drivers for real hardware devices;
# SMP and LP64, which support only VxBus drivers for real hardware devices,
#   but do require some utility functions from the end and usb subtrees.
#

ifdef _WRS_CONFIG_MEM_ALLOT
SUBDIRS=dma i2c sio timer
else
  ifneq ($(subst SIM,,$(CPU)),$(CPU))
  SUBDIRS=end erf wdb manager xbd mtd
  else
    ifdef _WRS_CONFIG_LP64
    SUBDIRS=end erf wdb manager usb usb2 xbd $(wildcard wlan)
    else
      ifdef _WRS_CONFIG_SMP
      SUBDIRS=end erf wdb manager usb usb2 xbd mtd hdisk dma i2c $(wildcard wlan)
      endif
    endif
  endif

  #
  # Exclude 'end' subdir if vsb is configured with no networking support.
  #
  ifdef _WRS_CONFIG_NO_IP
  EXCLUDE_SUBDIRS = end $(wildcard wlan)
  endif

endif

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