Makefile.kmk revision 2de1fe73877f65577c6307b76db95a65a93a02f0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# $Id$
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync## @file
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Sub-Makefile for the Devices testcases.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Copyright (C) 2006-2007 Sun Microsystems, Inc.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# available from http://www.virtualbox.org. This file is free software;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# you can redistribute it and/or modify it under the terms of the GNU
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# General Public License (GPL) as published by the Free Software
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Clara, CA 95054 USA or visit http://www.sun.com if you need
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# additional information or have any questions.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncSUB_DEPTH = ../../../..
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinclude $(KBUILD_PATH)/subheader.kmk
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# Globals
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncVBOX_DEVICES_TEST_OUT_DIR := $(PATH_TARGET)/Devices/testcase
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncBLDDIRS += $(VBOX_DEVICES_TEST_OUT_DIR)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# We setup one 'other' target for executing the structure & alignment
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# validation testcases. Perhaps a bit hackish, but extremely useful.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync OTHERS += \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync endif
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncendif
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# The normal testing pass.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncTESTING += \
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync# The testcase generator.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#
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
ifdef VBOX_WITH_SCSI
tstDeviceStructSizeGC_DEFS += VBOX_WITH_SCSI
endif
ifdef VBOX_WITH_LSILOGIC
tstDeviceStructSizeGC_DEFS += VBOX_WITH_LSILOGIC
endif
ifdef VBOX_WITH_HPET
tstDeviceStructSizeGC_DEFS += VBOX_WITH_HPET
endif
ifdef VBOX_WITH_HGSMI
tstDeviceStructSizeGC_DEFS += VBOX_WITH_HGSMI
endif
ifdef VBOX_WITH_VIDEOHWACCEL
tstDeviceStructSizeGC_DEFS += VBOX_WITH_VIDEOHWACCEL
endif
tstDeviceStructSizeGC_SOURCES = tstDeviceStructSizeGC.cpp
tstDeviceStructSizeGC_INCS = \
$(VBOX_PATH_DEVICES_SRC) \
$(VBOX_PATH_DEVICES_SRC)/Bus \
$(VBOX_DEVICES_TEST_OUT_DIR)
#
# The testcase it self.
#
PROGRAMS += tstDeviceStructSize
tstDeviceStructSize_TEMPLATE = VBOXR3AUTOTST
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
ifdef VBOX_WITH_LSILOGIC
tstDeviceStructSize_DEFS += VBOX_WITH_LSILOGIC
endif
ifdef VBOX_WITH_HPET
tstDeviceStructSize_DEFS += VBOX_WITH_HPET
endif
ifdef VBOX_WITH_SMC
tstDeviceStructSize_DEFS += VBOX_WITH_SMC
endif
ifdef VBOX_WITH_LPC
tstDeviceStructSize_DEFS += VBOX_WITH_LPC
endif
ifdef VBOX_WITH_HGSMI
tstDeviceStructSize_DEFS += VBOX_WITH_HGSMI
endif
ifdef VBOX_WITH_VIDEOHWACCEL
tstDeviceStructSize_DEFS += VBOX_WITH_VIDEOHWACCEL
endif
tstDeviceStructSize_INCS = \
$(VBOX_PATH_DEVICES_SRC) \
$(VBOX_PATH_DEVICES_SRC)/Bus \
$(VBOX_DEVICES_TEST_OUT_DIR)
tstDeviceStructSize_SOURCES = tstDeviceStructSize.cpp
tstDeviceStructSize_CLEAN = \
$(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeGC.h \
$(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
tstDeviceStructSize.cpp_DEPS = $(VBOX_DEVICES_TEST_OUT_DIR)/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.
$(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeGC.h: $$(INSTARGET_tstDeviceStructSizeGC) | $$(dir $$@)
$(call MSG_GENERATE,,$@)
$(QUIET)$(REDIRECT) -wo $@ -- $^
# 3. run it.
$(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run: $$(INSTARGET_tstDeviceStructSize) | $$(dir $$@)
$(QUIET)$(RM) -f $@
$^
$(QUIET)$(APPEND) "$@" "done"
# alias for the struct test.
run-struct-tests: $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
include $(KBUILD_PATH)/subfooter.kmk