1 | # $Id: Makefile.kmk 32471 2010-09-14 10:26:07Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the device testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2010 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | SUB_DEPTH = ../../../..
|
---|
19 | include $(KBUILD_PATH)/subheader.kmk
|
---|
20 |
|
---|
21 | #
|
---|
22 | # Globals
|
---|
23 | #
|
---|
24 | VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices
|
---|
25 | VBOX_DEVICES_TEST_OUT_DIR := $(PATH_TARGET)/Devices/testcase
|
---|
26 | BLDDIRS += $(VBOX_DEVICES_TEST_OUT_DIR)
|
---|
27 |
|
---|
28 | #
|
---|
29 | # We setup one 'other' target for executing the structure & alignment
|
---|
30 | # validation testcases. Perhaps a bit hackish, but extremely useful.
|
---|
31 | #
|
---|
32 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
|
---|
33 | ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
|
---|
34 | OTHERS += \
|
---|
35 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
36 | endif
|
---|
37 | endif
|
---|
38 |
|
---|
39 | # The normal testing pass.
|
---|
40 | TESTING += \
|
---|
41 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
42 |
|
---|
43 |
|
---|
44 | ifdef VBOX_WITH_RAW_MODE
|
---|
45 | #
|
---|
46 | # The testcase generator.
|
---|
47 | #
|
---|
48 | PROGRAMS += tstDeviceStructSizeRC
|
---|
49 | tstDeviceStructSizeRC_TEMPLATE = VBoxRcExe
|
---|
50 | tstDeviceStructSizeRC_DEFS = VBOX_WITH_RAW_MODE
|
---|
51 | ifdef VBOX_WITH_USB
|
---|
52 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_USB
|
---|
53 | endif
|
---|
54 | ifdef VBOX_WITH_AHCI
|
---|
55 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_AHCI
|
---|
56 | endif
|
---|
57 | ifdef VBOX_WITH_E1000
|
---|
58 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_E1000
|
---|
59 | endif
|
---|
60 | ifdef VBOX_WITH_VIRTIO
|
---|
61 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_VIRTIO
|
---|
62 | endif
|
---|
63 | ifdef VBOX_WITH_BUSLOGIC
|
---|
64 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_BUSLOGIC
|
---|
65 | endif
|
---|
66 | ifdef VBOX_WITH_SCSI
|
---|
67 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_SCSI
|
---|
68 | endif
|
---|
69 | ifdef VBOX_WITH_LSILOGIC
|
---|
70 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_LSILOGIC
|
---|
71 | endif
|
---|
72 | ifdef VBOX_WITH_HGSMI
|
---|
73 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_HGSMI
|
---|
74 | endif
|
---|
75 | ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
76 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_VIDEOHWACCEL
|
---|
77 | endif
|
---|
78 | tstDeviceStructSizeRC_SOURCES = tstDeviceStructSizeRC.cpp
|
---|
79 | tstDeviceStructSizeRC_INCS = \
|
---|
80 | $(VBOX_PATH_DEVICES_SRC) \
|
---|
81 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
82 | $(VBOX_DEVICES_TEST_OUT_DIR)
|
---|
83 | endif # VBOX_WITH_RAW_MODE
|
---|
84 |
|
---|
85 | #
|
---|
86 | # The testcase it self.
|
---|
87 | #
|
---|
88 | PROGRAMS += tstDeviceStructSize
|
---|
89 | tstDeviceStructSize_TEMPLATE = VBOXR3AUTOTST
|
---|
90 | tstDeviceStructSize_DEFS =
|
---|
91 | ifdef VBOX_WITH_USB
|
---|
92 | tstDeviceStructSize_DEFS += VBOX_WITH_USB
|
---|
93 | endif
|
---|
94 | ifdef VBOX_WITH_AHCI
|
---|
95 | tstDeviceStructSize_DEFS += VBOX_WITH_AHCI
|
---|
96 | endif
|
---|
97 | ifdef VBOX_WITH_E1000
|
---|
98 | tstDeviceStructSize_DEFS += VBOX_WITH_E1000
|
---|
99 | endif
|
---|
100 | ifdef VBOX_WITH_VIRTIO
|
---|
101 | tstDeviceStructSize_DEFS += VBOX_WITH_VIRTIO
|
---|
102 | endif
|
---|
103 | ifdef VBOX_WITH_BUSLOGIC
|
---|
104 | tstDeviceStructSize_DEFS += VBOX_WITH_BUSLOGIC
|
---|
105 | endif
|
---|
106 | ifdef VBOX_WITH_LSILOGIC
|
---|
107 | tstDeviceStructSize_DEFS += VBOX_WITH_LSILOGIC
|
---|
108 | endif
|
---|
109 | ifdef VBOX_WITH_HGSMI
|
---|
110 | tstDeviceStructSize_DEFS += VBOX_WITH_HGSMI
|
---|
111 | endif
|
---|
112 | ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
113 | tstDeviceStructSize_DEFS += VBOX_WITH_VIDEOHWACCEL
|
---|
114 | endif
|
---|
115 | ifdef VBOX_WITH_RAW_MODE
|
---|
116 | tstDeviceStructSize_DEFS += VBOX_WITH_RAW_MODE
|
---|
117 | endif
|
---|
118 | tstDeviceStructSize_INCS = \
|
---|
119 | $(VBOX_PATH_DEVICES_SRC) \
|
---|
120 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
121 | $(VBOX_DEVICES_TEST_OUT_DIR)
|
---|
122 | tstDeviceStructSize_SOURCES = tstDeviceStructSize.cpp
|
---|
123 | tstDeviceStructSize_CLEAN = \
|
---|
124 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h \
|
---|
125 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
126 | ifdef VBOX_WITH_RAW_MODE
|
---|
127 | tstDeviceStructSize.cpp_DEPS = $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h
|
---|
128 | endif
|
---|
129 |
|
---|
130 | #
|
---|
131 | # Run rule for tstDeviceStructSize.
|
---|
132 | #
|
---|
133 |
|
---|
134 | # 1. Dump selected structure in the VMMGC.gc debug info.
|
---|
135 | # 2. Generate a testcase from the dump
|
---|
136 | ## future
|
---|
137 |
|
---|
138 | ifdef VBOX_WITH_RAW_MODE
|
---|
139 | # 1&2. Manually dump selected structures and members.
|
---|
140 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h: $$(INSTARGET_tstDeviceStructSizeRC) | $$(dir $$@)
|
---|
141 | $(call MSG_GENERATE,,$@)
|
---|
142 | $(QUIET)$(REDIRECT) -wo $@ -- $^
|
---|
143 | endif
|
---|
144 |
|
---|
145 | # 3. run it.
|
---|
146 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run: $$(INSTARGET_tstDeviceStructSize) | $$(dir $$@)
|
---|
147 | $(QUIET)$(RM) -f $@
|
---|
148 | $^
|
---|
149 | $(QUIET)$(APPEND) "$@" "done"
|
---|
150 |
|
---|
151 | # alias for the struct test.
|
---|
152 | run-struct-tests: $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
153 |
|
---|
154 |
|
---|
155 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
156 |
|
---|