Makefile.kmk revision 1c2c968fd241148110002d75b2c0fdeddc211e14
# $Id$
## @file
# Sub-Makefile for the Devices testcases.
#
#
# Copyright (C) 2006-2007 Sun Microsystems, Inc.
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
# Clara, CA 95054 USA or visit http://www.sun.com if you need
# additional information or have any questions.
#
ifdef VBOX_KBUILD_HACKING
SUB_DEPTH = ../../../..
else
SUB_DEPTH = ..
DEPTH ?= ../../../..
endif
include $(KBUILD_PATH)/subheader.kmk
#
# We setup one 'other' target for executing the structure & alignment
# validation testcases. Perhaps a bit hackish, but extremely useful.
#
ifndef VBOX_ONLY_SDK
ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
OTHERS += \
$(PATH_TARGET)/tstDeviceStructSize.run
endif
endif
endif
# The normal testing pass.
TESTING += \
$(PATH_TARGET)/tstDeviceStructSize.run
#
# Globals
#
VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices
#
# The testcase generator.
#
PROGRAMS += tstDeviceStructSizeGC
tstDeviceStructSizeGC_TEMPLATE = VBOXGCEXE
tstDeviceStructSizeGC_DEFS =
ifdef VBOX_WITH_USB
tstDeviceStructSizeGC_DEFS += VBOX_WITH_USB IN_USB_GC
endif
ifdef VBOX_WITH_AHCI
tstDeviceStructSizeGC_DEFS += VBOX_WITH_AHCI
endif
ifdef VBOX_WITH_E1000
tstDeviceStructSizeGC_DEFS += VBOX_WITH_E1000
endif
ifdef VBOX_WITH_BUSLOGIC
tstDeviceStructSizeGC_DEFS += VBOX_WITH_BUSLOGIC
endif
tstDeviceStructSizeGC_SOURCES = tstDeviceStructSizeGC.cpp
tstDeviceStructSizeGC_INCS = \
$(VBOX_PATH_DEVICES_SRC) \
$(VBOX_PATH_DEVICES_SRC)/Bus \
$(PATH_TARGET)
#
# The testcase it self.
#
PROGRAMS += tstDeviceStructSize
tstDeviceStructSize_TEMPLATE = VBOXR3EXE
tstDeviceStructSize_DEFS =
ifdef VBOX_WITH_USB
tstDeviceStructSize_DEFS += VBOX_WITH_USB IN_USB_GC
endif
ifdef VBOX_WITH_AHCI
tstDeviceStructSize_DEFS += VBOX_WITH_AHCI
endif
ifdef VBOX_WITH_E1000
tstDeviceStructSize_DEFS += VBOX_WITH_E1000
endif
ifdef VBOX_WITH_BUSLOGIC
tstDeviceStructSize_DEFS += VBOX_WITH_BUSLOGIC
endif
tstDeviceStructSize_INCS = \
$(VBOX_PATH_DEVICES_SRC) \
$(VBOX_PATH_DEVICES_SRC)/Bus \
$(PATH_TARGET)
tstDeviceStructSize_SOURCES = tstDeviceStructSize.cpp
tstDeviceStructSize_LIBS.l4 = $(LIB_RUNTIME)
tstDeviceStructSize_CLEAN = \
$(PATH_TARGET)/tstDeviceStructSizeGC.h \
$(PATH_TARGET)/tstDeviceStructSizeGC.run
tstDeviceStructSize.cpp_DEPS = $(PATH_TARGET)/tstDeviceStructSizeGC.h
#
# Run rule for tstDeviceStructSize.
#
# 1. Dump selected structure in the VMMGC.gc debug info.
# 2. Generate a testcase from the dump
## future
# 1&2. Manually dump selected structures and members.
$(PATH_TARGET)/tstDeviceStructSizeGC.h: $$(INSTARGET_tstDeviceStructSizeGC)
$(call MSG_GENERATE,,$@)
$(QUIET)$(REDIRECT) -wo $@ $(if $(eq $(KBUILD_TARGET),darwin),-E 'DYLD_LIBRARY_PATH=$(dir $^)') -- $^
# 3. run it.
$(PATH_TARGET)/tstDeviceStructSize.run: $$(INSTARGET_tstDeviceStructSize)
$(QUIET)$(RM) -f $@
$(if $(eq $(KBUILD_TARGET),darwin),$(REDIRECT) -E 'DYLD_LIBRARY_PATH=$(dir $^)' --) $^
$(QUIET)$(APPEND) "$@" "done"
# alias for the struct test.
run-struct-tests: $(PATH_TARGET)/tstDeviceStructSize.run
include $(KBUILD_PATH)/subfooter.kmk