1 | # $Id: Makefile.kmk 10043 2008-06-30 23:54:38Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the Devices testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
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 | # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
18 | # Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
19 | # additional information or have any questions.
|
---|
20 | #
|
---|
21 |
|
---|
22 | ifdef VBOX_KBUILD_HACKING
|
---|
23 | SUB_DEPTH = ../../../..
|
---|
24 | else
|
---|
25 | SUB_DEPTH = ..
|
---|
26 | DEPTH ?= ../../../..
|
---|
27 | endif
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 | #
|
---|
31 | # We setup one 'other' target for executing the structure & alignment
|
---|
32 | # validation testcases. Perhaps a bit hackish, but extremely useful.
|
---|
33 | #
|
---|
34 | ifeq ($(KBUILD_TARGET),$(KBUILD_HOST))
|
---|
35 | ifeq ($(filter-out x86.x86 amd64.amd64 x86.amd64, $(KBUILD_TARGET_ARCH).$(KBUILD_HOST_ARCH)),)
|
---|
36 | OTHERS += \
|
---|
37 | $(PATH_TARGET)/tstDeviceStructSize.run
|
---|
38 | endif
|
---|
39 | endif
|
---|
40 |
|
---|
41 | # The normal testing pass.
|
---|
42 | TESTING += \
|
---|
43 | $(PATH_TARGET)/tstDeviceStructSize.run
|
---|
44 |
|
---|
45 |
|
---|
46 | #
|
---|
47 | # Globals
|
---|
48 | #
|
---|
49 | VBOX_PATH_DEVICES_SRC ?= $(PATH_ROOT)/src/VBox/Devices
|
---|
50 |
|
---|
51 | #
|
---|
52 | # The testcase generator.
|
---|
53 | #
|
---|
54 | PROGRAMS += tstDeviceStructSizeGC
|
---|
55 | tstDeviceStructSizeGC_TEMPLATE = VBOXGCEXE
|
---|
56 | tstDeviceStructSizeGC_DEFS =
|
---|
57 | ifdef VBOX_WITH_USB
|
---|
58 | tstDeviceStructSizeGC_DEFS += VBOX_WITH_USB IN_USB_GC
|
---|
59 | endif
|
---|
60 | ifdef VBOX_WITH_AHCI
|
---|
61 | tstDeviceStructSizeGC_DEFS += VBOX_WITH_AHCI
|
---|
62 | endif
|
---|
63 | ifdef VBOX_WITH_E1000
|
---|
64 | tstDeviceStructSizeGC_DEFS += VBOX_WITH_E1000
|
---|
65 | endif
|
---|
66 | tstDeviceStructSizeGC_SOURCES = tstDeviceStructSizeGC.cpp
|
---|
67 | tstDeviceStructSizeGC_INCS = \
|
---|
68 | $(VBOX_PATH_DEVICES_SRC) \
|
---|
69 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
70 | $(PATH_TARGET)
|
---|
71 |
|
---|
72 | #
|
---|
73 | # The testcase it self.
|
---|
74 | #
|
---|
75 | PROGRAMS += tstDeviceStructSize
|
---|
76 | tstDeviceStructSize_TEMPLATE = VBOXR3EXE
|
---|
77 | tstDeviceStructSize_DEFS =
|
---|
78 | ifdef VBOX_WITH_USB
|
---|
79 | tstDeviceStructSize_DEFS += VBOX_WITH_USB IN_USB_GC
|
---|
80 | endif
|
---|
81 | ifdef VBOX_WITH_AHCI
|
---|
82 | tstDeviceStructSize_DEFS += VBOX_WITH_AHCI
|
---|
83 | endif
|
---|
84 | ifdef VBOX_WITH_E1000
|
---|
85 | tstDeviceStructSize_DEFS += VBOX_WITH_E1000
|
---|
86 | endif
|
---|
87 | tstDeviceStructSize_INCS = \
|
---|
88 | $(VBOX_PATH_DEVICES_SRC) \
|
---|
89 | $(VBOX_PATH_DEVICES_SRC)/Bus \
|
---|
90 | $(PATH_TARGET)
|
---|
91 | tstDeviceStructSize_SOURCES = tstDeviceStructSize.cpp
|
---|
92 | tstDeviceStructSize_LIBS.l4 = $(LIB_RUNTIME)
|
---|
93 | tstDeviceStructSize_CLEAN = \
|
---|
94 | $(PATH_TARGET)/tstDeviceStructSizeGC.h \
|
---|
95 | $(PATH_TARGET)/tstDeviceStructSizeGC.run
|
---|
96 | tstDeviceStructSize.cpp_DEPS = $(PATH_TARGET)/tstDeviceStructSizeGC.h
|
---|
97 |
|
---|
98 | #
|
---|
99 | # Run rule for tstDeviceStructSize.
|
---|
100 | #
|
---|
101 |
|
---|
102 | # 1. Dump selected structure in the VMMGC.gc debug info.
|
---|
103 | # 2. Generate a testcase from the dump
|
---|
104 | ## future
|
---|
105 |
|
---|
106 | # 1&2. Manually dump selected structures and members.
|
---|
107 | $(PATH_TARGET)/tstDeviceStructSizeGC.h: $$(INSTARGET_tstDeviceStructSizeGC)
|
---|
108 | $(call MSG_GENERATE,,$@)
|
---|
109 | $(QUIET)$(REDIRECT) -wo $@ -- $(INSTARGET_tstDeviceStructSizeGC)
|
---|
110 |
|
---|
111 | # 3. run it.
|
---|
112 | $(PATH_TARGET)/tstDeviceStructSize.run: $$(INSTARGET_tstDeviceStructSize)
|
---|
113 | $(QUIET)$(RM) -f $@
|
---|
114 | $^
|
---|
115 | $(QUIET)$(APPEND) "$@" "done"
|
---|
116 |
|
---|
117 | # alias for the struct test.
|
---|
118 | run-struct-tests: $(PATH_TARGET)/tstDeviceStructSize.run
|
---|
119 |
|
---|
120 |
|
---|
121 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
122 |
|
---|