1 | # $Id: Makefile.kmk 55083 2015-04-01 22:02:41Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the storage device & driver testcases.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2012 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 | # vditool - useful too for manipulating VDIs, but now pretty obsolete and
|
---|
23 | # probably will go away soon. Testcase only now.
|
---|
24 | #
|
---|
25 | if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VDITOOL)
|
---|
26 | PROGRAMS += vditool
|
---|
27 | vditool_TEMPLATE = VBOXR3TSTEXE
|
---|
28 | vditool_LIBS = $(LIB_DDU)
|
---|
29 | vditool_SOURCES = vditool.cpp
|
---|
30 | endif
|
---|
31 |
|
---|
32 | #
|
---|
33 | # Basic testcases for the VD code.
|
---|
34 | #
|
---|
35 | ifdef VBOX_WITH_TESTCASES
|
---|
36 | PROGRAMS += tstVD tstVD-2 tstVDCopy tstVDSnap tstVDShareable
|
---|
37 |
|
---|
38 | tstVD_TEMPLATE = VBOXR3TSTEXE
|
---|
39 | tstVD_SOURCES = tstVD.cpp
|
---|
40 | tstVD_LIBS = $(LIB_DDU)
|
---|
41 |
|
---|
42 | tstVD-2_TEMPLATE = VBOXR3TSTEXE
|
---|
43 | tstVD-2_SOURCES = tstVD-2.cpp
|
---|
44 | tstVD-2_LIBS = $(LIB_DDU)
|
---|
45 |
|
---|
46 | tstVDCopy_TEMPLATE = VBOXR3TSTEXE
|
---|
47 | tstVDCopy_SOURCES = tstVDCopy.cpp
|
---|
48 | tstVDCopy_LIBS = $(LIB_DDU)
|
---|
49 |
|
---|
50 | PROGRAMS += tstVDIo
|
---|
51 |
|
---|
52 | #
|
---|
53 | # VD I/O test scripts to built in -> .cpp
|
---|
54 | #
|
---|
55 | TSTVDIO_BUILTIN_TESTS_FILE = $(tstVDIo_0_OUTDIR)/BuiltinTests.cpp
|
---|
56 | TSTVDIO_BUILTIN_TESTS := \
|
---|
57 | tstVDIo=tstVDIo.vd \
|
---|
58 | tstVDResize=tstVDResize.vd \
|
---|
59 | tstVDCompact=tstVDCompact.vd \
|
---|
60 | tstVDCopy=tstVDCopy.vd \
|
---|
61 | tstVDDiscard=tstVDDiscard.vd \
|
---|
62 | tstVDShareable=tstVDShareable.vd
|
---|
63 | TSTVDIO_BUILTIN_TEST_NAMES := $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(firstword $(subst =,$(SPACE) ,$(test))))
|
---|
64 | TSTVDIO_PATH_TESTS := $(PATH_SUB_CURRENT)
|
---|
65 |
|
---|
66 | # 1=name, 2=filter
|
---|
67 | TSTVDIO_GEN_TEST_MACRO = 'TSTVDIOTESTENTRY const g_a$(1)[] =' '{' \
|
---|
68 | $(foreach testnm,$(filter $(2),$(TSTVDIO_BUILTIN_TEST_NAMES)), ' TSTVDIOTESTENTRY_GEN($(testnm), g_ab$(testnm)),') \
|
---|
69 | '};' 'unsigned const g_c$(1) = RT_ELEMENTS(g_a$(1));' '' ''
|
---|
70 |
|
---|
71 | $$(TSTVDIO_BUILTIN_TESTS_FILE): $(MAKEFILE_CURRENT) \
|
---|
72 | $(foreach test,$(TSTVDIO_BUILTIN_TESTS),$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SPACE) ,$(test)))) \
|
---|
73 | $(VBOX_BIN2C) \
|
---|
74 | | $$(dir $$@)
|
---|
75 | $(QUIET)$(RM) -f -- $@ [email protected]
|
---|
76 | $(QUIET)$(APPEND) -n "$@" \
|
---|
77 | '' \
|
---|
78 | '#include "BuiltinTests.h"' \
|
---|
79 | ''
|
---|
80 | $(foreach test,$(TSTVDIO_BUILTIN_TESTS), $(NLTAB)$(VBOX_BIN2C) -ascii --append \
|
---|
81 | "$(firstword $(subst =,$(SP) ,$(test)))" \
|
---|
82 | "$(TSTVDIO_PATH_TESTS)/$(lastword $(subst =,$(SP) ,$(test)))" \
|
---|
83 | "$@")
|
---|
84 |
|
---|
85 | # Generate test lists.
|
---|
86 | $(QUIET)$(APPEND) -n "$@" '' \
|
---|
87 | $(call TSTVDIO_GEN_TEST_MACRO,VDIoTests,%) \
|
---|
88 |
|
---|
89 | ifn1of ($(KBUILD_TARGET), win)
|
---|
90 | VBOX_TSTVDIO_WITH_LOG_REPLAY = 1
|
---|
91 | endif
|
---|
92 |
|
---|
93 | tstVDIo_TEMPLATE = VBOXR3TSTEXE
|
---|
94 | tstVDIo_INCS := $(PATH_SUB_CURRENT)
|
---|
95 |
|
---|
96 | ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
|
---|
97 | tstVDIo_DEFS += VBOX_TSTVDIO_WITH_LOG_REPLAY
|
---|
98 | endif
|
---|
99 |
|
---|
100 | tstVDIo_SOURCES = tstVDIo.cpp \
|
---|
101 | VDIoBackend.cpp \
|
---|
102 | VDIoBackendMem.cpp \
|
---|
103 | VDMemDisk.cpp \
|
---|
104 | VDIoRnd.cpp \
|
---|
105 | VDScript.cpp \
|
---|
106 | VDScriptAst.cpp \
|
---|
107 | VDScriptChecker.cpp \
|
---|
108 | VDScriptInterp.cpp \
|
---|
109 | $(TSTVDIO_BUILTIN_TESTS_FILE)
|
---|
110 | tstVDIo_LIBS = \
|
---|
111 | $(LIB_DDU)
|
---|
112 |
|
---|
113 | ifdef VBOX_TSTVDIO_WITH_LOG_REPLAY
|
---|
114 | tstVDIo_LIBS += \
|
---|
115 | $(PATH_STAGE_LIB)/StorageDbgLib$(VBOX_SUFF_LIB)
|
---|
116 | endif
|
---|
117 |
|
---|
118 | tstVDSetUuid_TEMPLATE = VBOXR3TSTEXE
|
---|
119 | tstVDSetUuid_LIBS = $(LIB_DDU)
|
---|
120 |
|
---|
121 | tstVDShareable_TEMPLATE = VBOXR3TSTEXE
|
---|
122 | tstVDShareable_LIBS = $(LIB_DDU)
|
---|
123 | tstVDShareable_SOURCES = tstVDShareable.cpp
|
---|
124 |
|
---|
125 | tstVDSnap_TEMPLATE = VBOXR3TSTEXE
|
---|
126 | tstVDSnap_LIBS = $(LIB_DDU)
|
---|
127 | tstVDSnap_SOURCES = tstVDSnap.cpp
|
---|
128 | endif
|
---|
129 |
|
---|
130 | if defined(VBOX_WITH_TESTCASES) || defined(VBOX_WITH_VBOX_IMG)
|
---|
131 | PROGRAMS += vbox-img
|
---|
132 |
|
---|
133 | #
|
---|
134 | # vbox-img - static because it migth be used as at standalone tool.
|
---|
135 | #
|
---|
136 | vbox-img_TEMPLATE = VBoxR3Static
|
---|
137 | vbox-img_DEFS += IN_VBOXDDU IN_VBOXDDU_STATIC VBOX_HDD_NO_DYNAMIC_BACKENDS
|
---|
138 | vbox-img_SOURCES = \
|
---|
139 | vbox-img.cpp \
|
---|
140 | ../VD.cpp \
|
---|
141 | ../VDVfs.cpp \
|
---|
142 | ../VDI.cpp \
|
---|
143 | ../VMDK.cpp \
|
---|
144 | ../VHD.cpp \
|
---|
145 | ../DMG.cpp \
|
---|
146 | ../Parallels.cpp \
|
---|
147 | ../ISCSI.cpp \
|
---|
148 | ../RAW.cpp \
|
---|
149 | ../QED.cpp \
|
---|
150 | ../QCOW.cpp \
|
---|
151 | ../VHDX.cpp \
|
---|
152 | ../VCICache.cpp \
|
---|
153 | ../VDIfVfs.cpp
|
---|
154 | vbox-img_SOURCES.win = \
|
---|
155 | vbox-img.rc
|
---|
156 | vbox-img_LIBS = \
|
---|
157 | $(VBOX_LIB_RUNTIME_STATIC)
|
---|
158 | if1of ($(KBUILD_TARGET),os2 win)
|
---|
159 | vbox-img_LIBS += \
|
---|
160 | $(PATH_STAGE_LIB)/VBox-liblzf-static$(VBOX_SUFF_LIB) \
|
---|
161 | $(PATH_STAGE_LIB)/VBox-zlib-static$(VBOX_SUFF_LIB)
|
---|
162 | else
|
---|
163 | vbox-img_LIBS += \
|
---|
164 | $(PATH_STAGE_LIB)/VBox-liblzf$(VBOX_SUFF_LIB) \
|
---|
165 | $(SDK_VBOX_ZLIB_LIBS)
|
---|
166 | endif
|
---|
167 | ifeq ($(KBUILD_TARGET),linux)
|
---|
168 | vbox-img_LIBS += crypt
|
---|
169 | ifdef SDK_VBOX_LIBXML2_LIBS
|
---|
170 | vbox-img_LIBS += xml2
|
---|
171 | endif
|
---|
172 | else if1of ($(KBUILD_TARGET),darwin freebsd)
|
---|
173 | vbox-img_LIBS += iconv
|
---|
174 | else ifeq ($(KBUILD_TARGET),win)
|
---|
175 | vbox-img_SDKS.win = VBOX_NTDLL
|
---|
176 | else ifeq ($(KBUILD_TARGET),solaris)
|
---|
177 | vbox-img_LIBS += kstat
|
---|
178 | endif
|
---|
179 |
|
---|
180 | endif
|
---|
181 |
|
---|
182 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
183 |
|
---|