1 | # $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z 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_HPET
|
---|
73 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_HPET
|
---|
74 | endif
|
---|
75 | ifdef VBOX_WITH_HGSMI
|
---|
76 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_HGSMI
|
---|
77 | endif
|
---|
78 | ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
79 | tstDeviceStructSizeRC_DEFS += VBOX_WITH_VIDEOHWACCEL
|
---|
80 | endif
|
---|
81 | tstDeviceStructSizeRC_SOURCES = tstDeviceStructSizeRC.cpp
|
---|
82 | tstDeviceStructSizeRC_INCS = \
|
---|
83 | $(VBOX_PATH_DEVICES_SRC) \
|
---|
84 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
85 | $(VBOX_DEVICES_TEST_OUT_DIR)
|
---|
86 | endif # VBOX_WITH_RAW_MODE
|
---|
87 |
|
---|
88 | #
|
---|
89 | # The testcase it self.
|
---|
90 | #
|
---|
91 | PROGRAMS += tstDeviceStructSize
|
---|
92 | tstDeviceStructSize_TEMPLATE = VBOXR3AUTOTST
|
---|
93 | tstDeviceStructSize_DEFS =
|
---|
94 | ifdef VBOX_WITH_USB
|
---|
95 | tstDeviceStructSize_DEFS += VBOX_WITH_USB
|
---|
96 | endif
|
---|
97 | ifdef VBOX_WITH_AHCI
|
---|
98 | tstDeviceStructSize_DEFS += VBOX_WITH_AHCI
|
---|
99 | endif
|
---|
100 | ifdef VBOX_WITH_E1000
|
---|
101 | tstDeviceStructSize_DEFS += VBOX_WITH_E1000
|
---|
102 | endif
|
---|
103 | ifdef VBOX_WITH_VIRTIO
|
---|
104 | tstDeviceStructSize_DEFS += VBOX_WITH_VIRTIO
|
---|
105 | endif
|
---|
106 | ifdef VBOX_WITH_BUSLOGIC
|
---|
107 | tstDeviceStructSize_DEFS += VBOX_WITH_BUSLOGIC
|
---|
108 | endif
|
---|
109 | ifdef VBOX_WITH_LSILOGIC
|
---|
110 | tstDeviceStructSize_DEFS += VBOX_WITH_LSILOGIC
|
---|
111 | endif
|
---|
112 | ifdef VBOX_WITH_HPET
|
---|
113 | tstDeviceStructSize_DEFS += VBOX_WITH_HPET
|
---|
114 | endif
|
---|
115 | ifdef VBOX_WITH_SMC
|
---|
116 | tstDeviceStructSize_DEFS += VBOX_WITH_SMC
|
---|
117 | endif
|
---|
118 | ifdef VBOX_WITH_LPC
|
---|
119 | tstDeviceStructSize_DEFS += VBOX_WITH_LPC
|
---|
120 | endif
|
---|
121 | ifdef VBOX_WITH_HGSMI
|
---|
122 | tstDeviceStructSize_DEFS += VBOX_WITH_HGSMI
|
---|
123 | endif
|
---|
124 | ifdef VBOX_WITH_VIDEOHWACCEL
|
---|
125 | tstDeviceStructSize_DEFS += VBOX_WITH_VIDEOHWACCEL
|
---|
126 | endif
|
---|
127 | ifdef VBOX_WITH_RAW_MODE
|
---|
128 | tstDeviceStructSize_DEFS += VBOX_WITH_RAW_MODE
|
---|
129 | endif
|
---|
130 | tstDeviceStructSize_INCS = \
|
---|
131 | $(VBOX_PATH_DEVICES_SRC) \
|
---|
132 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
133 | $(VBOX_DEVICES_TEST_OUT_DIR)
|
---|
134 | tstDeviceStructSize_SOURCES = tstDeviceStructSize.cpp
|
---|
135 | tstDeviceStructSize_CLEAN = \
|
---|
136 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h \
|
---|
137 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
138 | ifdef VBOX_WITH_RAW_MODE
|
---|
139 | tstDeviceStructSize.cpp_DEPS = $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h
|
---|
140 | endif
|
---|
141 |
|
---|
142 | #
|
---|
143 | # Run rule for tstDeviceStructSize.
|
---|
144 | #
|
---|
145 |
|
---|
146 | # 1. Dump selected structure in the VMMGC.gc debug info.
|
---|
147 | # 2. Generate a testcase from the dump
|
---|
148 | ## future
|
---|
149 |
|
---|
150 | ifdef VBOX_WITH_RAW_MODE
|
---|
151 | # 1&2. Manually dump selected structures and members.
|
---|
152 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h: $$(INSTARGET_tstDeviceStructSizeRC) | $$(dir $$@)
|
---|
153 | $(call MSG_GENERATE,,$@)
|
---|
154 | $(QUIET)$(REDIRECT) -wo $@ -- $^
|
---|
155 | endif
|
---|
156 |
|
---|
157 | # 3. run it.
|
---|
158 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run: $$(INSTARGET_tstDeviceStructSize) | $$(dir $$@)
|
---|
159 | $(QUIET)$(RM) -f $@
|
---|
160 | $^
|
---|
161 | $(QUIET)$(APPEND) "$@" "done"
|
---|
162 |
|
---|
163 | # alias for the struct test.
|
---|
164 | run-struct-tests: $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
165 |
|
---|
166 |
|
---|
167 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
168 |
|
---|