# Makefile - makefile for target/src/wrhv
#
# Copyright (c) 2008-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
# --------------------
# 01n,25oct12,jpb  Reconfigured.
# 01m,25apr12,jjk  WIND00344535 - Do not build wrhvWrload.o for 64 bit
# 01m,24aug11,kab  Disabled for MILS release
# 01n,25aug11,c_t  Cert HV support.
# 01m,10oct10,jlv  Add wrhvWrload.o for all CPU variants
# 01l,06oct10,kab  Enable e500mc build
# 01k,16sep10,j_z  Sync with HV 1.2 DVD.
# 01j,28jun10,rgo  undo wrhvWrload and mask LIB_DIR_TAG evaluation. 
# 01i,22feb10,rgo  Add the new file, wrhvWrload.o
# 01h,20nov09,to   enable CPU variant build for PPC
#                  add vbiLib.o
# 01g,22sep09,d_c  Defect WIND00183017 Fix WIND00183019 - sync with 18-Sep HV
#                  DVD
# 01f,18aug09,d_c  Sync with HV 1.1 14-Aug-09 DVD
# 01e,25mar09,to   add vbiPci.o
# 01d,21jan09,to   add vbiShow.o
# 01c,07jan09,rec  add vbiInterrupt.o
# 01b,16dec08,to   convert to VBI naming
# 01a,20oct08,to   written
#
# DESCRIPTION
# This file contains the makefile rules for building the WR hypervisor
# Guest OS support library
#

TGT_DIR = $(WIND_BASE)/target
LIB_BASE_NAME = wrhv

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

EXTRA_INCLUDE = -I$(TGT_DIR)/h/wrhv

# Commercial HV is incompatible w/ MILS (some symbol reuse)
ifdef _WRS_CONFIG_WRHV_GUEST 
ifndef  _WRS_CONFIG_MILS_VBI
  OBJS_COMMON = vbiIdle.o vbiInterrupt.o vbiLib.o vbiMsg.o vbiNs.o vbiPaddr.o \
                vbiPci.o vbiShmem.o vbiShow.o vbiSyscalls.o vbiVioApic.o \
                vbiDeviceConfig.o vbiPdc.o

ifdef _WRS_CONFIG_WRHV_GUEST_CERT
  OBJS_COMMON = vbiIdle.o vbiInterrupt.o vbiLib.o vbiPaddr.o vbiNs.o \
                vbiPci.o vbiShmem.o vbiSyscalls.o vbiVioApic.o \
                vbiDeviceConfig.o vbiPdc.o \
                vbiSchedTransition.o vbFrameSchedIntHook.o
endif

ifdef _WRS_CONFIG_WRHV_GUEST_CERT_DEBUG
  OBJS_COMMON = vbiIdle.o vbiInterrupt.o vbiLib.o vbiPaddr.o vbiNs.o\
                vbiPci.o vbiShmem.o vbiShow.o vbiSyscalls.o vbiVioApic.o \
                vbiDeviceConfig.o vbiPdc.o \
                vbiSchedTransition.o vbFrameSchedIntHook.o
endif

  ifeq ($(CPU),PPC32)
    include $(TGT_DIR)/h/make/defs.pal
    ifneq ($(LIB_DIR_TAG),)
      OBJS=$(OBJS_COMMON)
      OBJS_COMMON += wrhvWrload.o
    endif
  else
    OBJS=$(OBJS_COMMON)
    ifndef _WRS_CONFIG_LP64
    OBJS_COMMON += wrhvWrload.o
    endif
  endif
endif
endif

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