1 | # $Id: Makefile.kmk 11896 2008-09-01 08:10:34Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VBox API 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 | DEPTH ?= ../../../..
|
---|
26 | SUB_DEPTH = ..
|
---|
27 | endif
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 | ifeq ($(KBUILD_TARGET),win)
|
---|
31 | NEED_MSCOM_SAMPLE = 1
|
---|
32 | else
|
---|
33 | NEED_XPCOM_SAMPLE = 1
|
---|
34 | endif
|
---|
35 |
|
---|
36 | ifdef VBOX_ONLY_SDK
|
---|
37 | NEED_MSCOM_SAMPLE = 1
|
---|
38 | NEED_XPCOM_SAMPLE = 1
|
---|
39 | else
|
---|
40 | ifdef VBOX_WITH_TESTCASES
|
---|
41 | PROGRAMS += tstAPI
|
---|
42 | PROGRAMS.linux += tstVBoxAPILinux
|
---|
43 | # That testcase is actually not linux specific, it's generic XPCOM.
|
---|
44 | PROGRAMS.solaris += tstVBoxAPILinux
|
---|
45 | PROGRAMS.win += tstVBoxAPIWin
|
---|
46 | ifdef VBOX_WITH_RESOURCE_USAGE_API
|
---|
47 | PROGRAMS += tstCollector
|
---|
48 | endif
|
---|
49 | else ifeq ($(USERNAME),dmik)
|
---|
50 | PROGRAMS += tstAPI
|
---|
51 | PROGRAMS.linux += tstVBoxAPILinux
|
---|
52 | # That testcase is actually not linux specific, it's generic XPCOM.
|
---|
53 | PROGRAMS.solaris += tstVBoxAPILinux
|
---|
54 | PROGRAMS.win += tstVBoxAPIWin
|
---|
55 | endif # VBOX_WITH_TESTCASES
|
---|
56 | endif # VBOX_ONLY_SDK
|
---|
57 |
|
---|
58 | ifdef NEED_MSCOM_SAMPLE
|
---|
59 | INSTALLS += samplesMSCOM
|
---|
60 | endif
|
---|
61 |
|
---|
62 | ifdef NEED_XPCOM_SAMPLE
|
---|
63 | INSTALLS += samplesXPCOM
|
---|
64 | endif
|
---|
65 |
|
---|
66 | # maybe, if will ship glue COM headers with SDK
|
---|
67 | #INSTALLS += tstAPI
|
---|
68 |
|
---|
69 | #
|
---|
70 | # The samples
|
---|
71 | #
|
---|
72 | samplesMSCOM_MODE = a+r,u+w
|
---|
73 | samplesMSCOM_INST = $(INST_SDK)bindings/mscom/samples/
|
---|
74 | samplesMSCOM_SOURCES = tstVBoxAPIWin.cpp
|
---|
75 |
|
---|
76 | samplesXPCOM_MODE = a+r,u+w
|
---|
77 | samplesXPCOM_INST = $(INST_SDK)bindings/xpcom/samples/
|
---|
78 | samplesXPCOM_SOURCES = tstVBoxAPILinux.cpp makefile.tstVBoxAPILinux=>Makefile
|
---|
79 |
|
---|
80 | #
|
---|
81 | # tstAPI
|
---|
82 | #
|
---|
83 | tstAPI_TEMPLATE = VBOXMAINCLIENTEXE
|
---|
84 | #tstAPI_INST = $(INST_SDK)bindings/gluecom/samples/
|
---|
85 | tstAPI_SOURCES = tstAPI.cpp
|
---|
86 | ifeq ($(KBUILD_TARGET),win) ## @todo just add this to the template.
|
---|
87 | tstAPI_DEPS = $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
|
---|
88 | else
|
---|
89 | tstAPI_DEPS = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
|
---|
90 | endif
|
---|
91 | ifdef VBOX_WITH_RESOURCE_USAGE_API
|
---|
92 | tstAPI_DEFS += VBOX_WITH_RESOURCE_USAGE_API
|
---|
93 | endif
|
---|
94 |
|
---|
95 |
|
---|
96 | #
|
---|
97 | # tstVBoxAPILinux
|
---|
98 | #
|
---|
99 | # We only build the testcase here to make sure it builds.
|
---|
100 | # It comes with a custom makefile which should be tested as well!
|
---|
101 | #
|
---|
102 | tstVBoxAPILinux_TEMPLATE = VBOXR3
|
---|
103 | tstVBoxAPILinux_SOURCES = tstVBoxAPILinux.cpp
|
---|
104 | tstVBoxAPILinux_CXXFLAGS = -Wno-non-virtual-dtor -fshort-wchar
|
---|
105 | tstVBoxAPILinux_LDFLAGS.solaris += '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/../../..'
|
---|
106 | ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
107 | tstVBoxAPILinux_DEFS += VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
|
---|
108 | endif
|
---|
109 | tstVBoxAPILinux_INCS = \
|
---|
110 | $(VBOX_XPCOM_INCS) \
|
---|
111 | $(VBOX_PATH_SDK)/bindings/xpcom/include
|
---|
112 | tstVBoxAPILinux_LIBPATH = $(LIBPATH_XPCOM)
|
---|
113 | tstVBoxAPILinux_LIBS = $(LIB_XPCOM)
|
---|
114 | tstVBoxAPILinux_DEPS = \
|
---|
115 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
|
---|
116 |
|
---|
117 | #
|
---|
118 | # tstVBoxAPIWin
|
---|
119 | #
|
---|
120 | tstVBoxAPIWin_TEMPLATE = VBOXMAINCLIENTEXE
|
---|
121 | tstVBoxAPIWin_SOURCES = \
|
---|
122 | tstVBoxAPIWin.cpp \
|
---|
123 | $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
|
---|
124 | tstVBoxAPIWin_DEPS = \
|
---|
125 | $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h
|
---|
126 |
|
---|
127 | #
|
---|
128 | # tstCollector
|
---|
129 | #
|
---|
130 | tstCollector_TEMPLATE = VBOXMAINCLIENTEXE
|
---|
131 | tstCollector_SOURCES = \
|
---|
132 | tstCollector.cpp \
|
---|
133 | ../Performance.cpp
|
---|
134 | tstCollector_INCS = ../include
|
---|
135 | tstCollector_LDFLAGS.darwin += -lproc
|
---|
136 | tstCollector_LDFLAGS.solaris += -lkstat
|
---|
137 | tstCollector_LDFLAGS.win += wbemuuid.lib powrprof.lib
|
---|
138 |
|
---|
139 |
|
---|
140 | # generate rules.
|
---|
141 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
142 |
|
---|