1 | # $Id: Makefile.kmk 88624 2021-04-21 08:00:07Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the device testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2020 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_PATH_VMM_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/VMM/include
|
---|
26 | VBOX_DEVICES_TEST_OUT_DIR := $(PATH_TARGET)/Devices/testcase
|
---|
27 | BLDDIRS += $(VBOX_DEVICES_TEST_OUT_DIR)
|
---|
28 |
|
---|
29 | VBOX_DEVICES_TESTS_FEATURES = \
|
---|
30 | $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
|
---|
31 | $(if $(VBOX_WITH_BUSLOGIC),VBOX_WITH_BUSLOGIC,) \
|
---|
32 | $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
|
---|
33 | $(if $(VBOX_WITH_EHCI_IMPL),VBOX_WITH_EHCI_IMPL,) \
|
---|
34 | $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
|
---|
35 | $(if $(VBOX_WITH_HP_HDA),VBOX_WITH_HP_HDA,) \
|
---|
36 | $(if $(VBOX_WITH_INTEL_HDA),VBOX_WITH_INTEL_HDA,) \
|
---|
37 | $(if $(VBOX_WITH_NVIDIA_HDA),VBOX_WITH_NVIDIA_HDA,) \
|
---|
38 | $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
|
---|
39 | $(if $(VBOX_WITH_NVME_IMPL),VBOX_WITH_NVME_IMPL,) \
|
---|
40 | $(if $(VBOX_WITH_PCI_PASSTHROUGH_IMPL),VBOX_WITH_PCI_PASSTHROUGH_IMPL,) \
|
---|
41 | $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \
|
---|
42 | $(if $(VBOX_WITH_SCSI),VBOX_WITH_SCSI,) \
|
---|
43 | $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
|
---|
44 | $(if $(VBOX_WITH_VDMA),VBOX_WITH_VDMA,) \
|
---|
45 | $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
|
---|
46 | $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
|
---|
47 | $(if $(VBOX_WITH_VMSVGA),VBOX_WITH_VMSVGA,) \
|
---|
48 | $(if $(VBOX_WITH_WDDM),VBOX_WITH_WDDM,) \
|
---|
49 | $(if $(VBOX_WITH_XHCI_IMPL),VBOX_WITH_XHCI_IMPL,) \
|
---|
50 | $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD,) \
|
---|
51 | $(VBOX_AUDIO_DEFS) \
|
---|
52 | $(VMM_COMMON_DEFS)
|
---|
53 |
|
---|
54 | #
|
---|
55 | # We setup one 'other' target for executing the structure & alignment
|
---|
56 | # validation testcases. Perhaps a bit hackish, but extremely useful.
|
---|
57 | #
|
---|
58 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
|
---|
59 | ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
|
---|
60 | OTHERS += \
|
---|
61 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
62 | endif
|
---|
63 | endif
|
---|
64 |
|
---|
65 | # The normal testing pass.
|
---|
66 | TESTING += \
|
---|
67 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
68 |
|
---|
69 | ifdef VBOX_WITH_RAW_MODE
|
---|
70 | #
|
---|
71 | # The testcase generator.
|
---|
72 | #
|
---|
73 | PROGRAMS += tstDeviceStructSizeRC
|
---|
74 | tstDeviceStructSizeRC_TEMPLATE = VBoxRcExe
|
---|
75 | tstDeviceStructSizeRC_DEFS = $(VBOX_DEVICES_TESTS_FEATURES)
|
---|
76 | tstDeviceStructSizeRC_SOURCES = tstDeviceStructSizeRC.cpp
|
---|
77 | tstDeviceStructSizeRC_INCS = \
|
---|
78 | $(VBOX_PATH_DEVICES_SRC)/build \
|
---|
79 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
80 | $(VBOX_DEVICES_TEST_OUT_DIR) \
|
---|
81 | $(VBOX_GRAPHICS_INCS)
|
---|
82 | tstDeviceStructSizeRC_INCS += $(VBOX_PATH_VMM_DEVICES_SRC)
|
---|
83 | endif # VBOX_WITH_RAW_MODE
|
---|
84 |
|
---|
85 | #
|
---|
86 | # The testcase it self.
|
---|
87 | #
|
---|
88 | PROGRAMS += tstDeviceStructSize
|
---|
89 | if "$(KBUILD_TARGET)" != "win" && $(VBOX_GCC_VERSION_CXX) < 40600
|
---|
90 | #
|
---|
91 | # Disable "ISO C++ prohibits anonymous structs [-Werror=pedantic]" caused by Mesa VMSVGA driver headers
|
---|
92 | # For GCC >= 4.6.0 the warning is disabled in DevVGA_SVGA.h
|
---|
93 | #
|
---|
94 | # Template used for gcc older than 4.6. (Strips away compiler options.)
|
---|
95 | #
|
---|
96 | TEMPLATE_tstDeviceStructSizeOldGCC := tstDeviceStructSizeOldGCC
|
---|
97 | TEMPLATE_tstDeviceStructSizeOldGCC_EXTENDS := VBOXR3AUTOTST
|
---|
98 | TEMPLATE_tstDeviceStructSizeOldGCC_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_$(TEMPLATE_tstDeviceStructSizeOldGCC_EXTENDS)_CXXFLAGS))
|
---|
99 |
|
---|
100 | tstDeviceStructSize_TEMPLATE = tstDeviceStructSizeOldGCC
|
---|
101 | else
|
---|
102 | tstDeviceStructSize_TEMPLATE = VBOXR3AUTOTST
|
---|
103 | endif
|
---|
104 | tstDeviceStructSize_DEFS = $(VBOX_DEVICES_TESTS_FEATURES)
|
---|
105 | tstDeviceStructSize_INCS = \
|
---|
106 | $(VBOX_PATH_DEVICES_SRC)/build \
|
---|
107 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
108 | $(VBOX_DEVICES_TEST_OUT_DIR) \
|
---|
109 | $(VBOX_GRAPHICS_INCS) \
|
---|
110 | $(VBOX_PATH_VMSVGA_DEVICE_INC)
|
---|
111 | tstDeviceStructSize_SOURCES = tstDeviceStructSize.cpp
|
---|
112 | tstDeviceStructSize_CLEAN = \
|
---|
113 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h \
|
---|
114 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
115 | ifdef VBOX_WITH_RAW_MODE
|
---|
116 | tstDeviceStructSize.cpp_DEPS = $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h
|
---|
117 | endif
|
---|
118 | tstDeviceStructSize_INCS += $(VBOX_PATH_VMM_DEVICES_SRC)
|
---|
119 |
|
---|
120 | #
|
---|
121 | # Run rule for tstDeviceStructSize.
|
---|
122 | #
|
---|
123 |
|
---|
124 | # 1. Dump selected structure in the VMMRC.rc debug info.
|
---|
125 | # 2. Generate a testcase from the dump
|
---|
126 | ## future
|
---|
127 |
|
---|
128 | ifdef VBOX_WITH_RAW_MODE
|
---|
129 | # 1&2. Manually dump selected structures and members.
|
---|
130 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSizeRC.h: $$(tstDeviceStructSizeRC_1_STAGE_TARGET) | $$(dir $$@)
|
---|
131 | $(call MSG_GENERATE,,$@)
|
---|
132 | $(QUIET)$(REDIRECT) -wo $@ -- $^
|
---|
133 | endif
|
---|
134 |
|
---|
135 | # 3. run it.
|
---|
136 | $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run: $$(tstDeviceStructSize_1_STAGE_TARGET) | $$(dir $$@)
|
---|
137 | $(QUIET)$(RM) -f $@
|
---|
138 | $^
|
---|
139 | $(QUIET)$(APPEND) "$@" "done"
|
---|
140 |
|
---|
141 | # alias for the struct test.
|
---|
142 | run-struct-tests: $(VBOX_DEVICES_TEST_OUT_DIR)/tstDeviceStructSize.run
|
---|
143 |
|
---|
144 |
|
---|
145 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
146 |
|
---|