VirtualBox

source: vbox/trunk/src/VBox/Main/cbinding/Makefile.kmk

Last change on this file was 99701, checked in by vboxsync, 13 months ago

*kmk: VBOX_ONLY_SDK_ON_WINDOWS changes and cleanups. bugref:10442

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.9 KB
RevLine 
[16431]1# $Id: Makefile.kmk 99701 2023-05-09 13:02:23Z vboxsync $
[16406]2## @file
3# Sub-Makefile for the VBox C Binding.
4#
5
6#
[98103]7# Copyright (C) 2009-2023 Oracle and/or its affiliates.
[16406]8#
[96407]9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
[16406]11#
[96407]12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
[16406]27
28SUB_DEPTH = ../../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31
32#
33# The samples
34#
[50183]35INSTALLS += CAPISamples
36CAPISamples_MODE = a+r,u+rw
37CAPISamples_INST = \
38 $(INST_SDK)bindings/c/samples/
39CAPISamples_SOURCES = \
40 tstCAPIGlue.c \
41 makefile.tstCAPIGlue=>Makefile
[16406]42
[82741]43#
44# The ???.
45#
[50183]46INSTALLS += CAPIGlue
47CAPIGlue_MODE = a+r,u+rw
48CAPIGlue_INST = \
49 $(INST_SDK)bindings/c/glue/
50CAPIGlue_SOURCES = \
51 VBoxCAPIGlue.c \
52 $(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h
[82741]53CAPIGlue_CLEAN = \
54 $(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h
[17725]55
[50183]56$$(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h: \
57 $(PATH_SUB_CURRENT)/VBoxCAPIGlue.h.in \
[39886]58 $(MAKEFILE_CURRENT) \
59 | $$(dir $$@)
60 $(call MSG_GENERATE,,$@)
61 $(QUIET)$(SED) \
62 -e 's/@VBOX_API_VERSION@/$(VBOX_API_VERSION)/' \
63 < $< > $@
64
[82741]65#
66# The ???.
67#
68INSTALLS += CAPIHeaders
69CAPIHeaders_MODE = a+r,u+rw
70CAPIHeaders_INST = $(INST_SDK)bindings/c/include/
71CAPIHeaders_SOURCES = \
72 $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h=>VBoxCAPI_v$(VBOX_API_VERSION).h
73CAPIHeaders_CLEAN = \
74 $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h
75
[50183]76$$(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h: \
77 $(PATH_SUB_CURRENT)/capiidl.xsl \
[53938]78 $(PATH_SUB_CURRENT)/../idl/typemap-shared.inc.xsl \
[16676]79 $(VBOX_XIDL_FILE) \
[16406]80 | $$(dir $$@)
[50183]81 $(call MSG_TOOL,xsltproc,CAPIHeaders,$<,$@)
[25950]82 $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
[16406]83
[99701]84ifndef VBOX_ONLY_SDK
[16406]85
86 #
[50183]87 # The C API binding utility DLL
[16406]88 #
[50183]89 DLLS += VBoxCAPI
[98188]90 VBoxCAPI_TEMPLATE = VBoxMainClientDll
[17567]91 ifdef VBOX_WITH_XPCOM
[50183]92 # Keep old name on XPCOM so that legacy code is happy.
93 VBoxCAPI_INST = $(INST_BIN)VBoxXPCOMC$(VBOX_SUFF_DLL)
[17567]94 endif
[50183]95 VBoxCAPI_DEFS = IN_VBOXCAPI
96 VBoxCAPI_SOURCES = \
97 VBoxCAPI.cpp
[53805]98 VBoxCAPI_SOURCES.win = \
[98431]99 VBoxCAPI.rc
[50183]100 VBoxCAPI_INCS = \
101 $(CAPIHeaders_0_OUTDIR)
102 VBoxCAPI_INTERMEDIATES = \
103 $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h
[16406]104
[16832]105 #
[98694]106 # The C API binding utility DLL, 32-bit variant for 64-bit hosts.
107 #
108 ifdef VBOX_WITH_32_ON_64_MAIN_API
109 DLLS += VBoxCAPI-x86
110 VBoxCAPI-x86_EXTENDS := VBoxCAPI
111 VBoxCAPI-x86_TEMPLATE := VBoxMainClientDll-x86
112 ifdef VBOX_WITH_XPCOM
113 VBoxCAPI-x86_INST := $(INST_BIN)VBoxCAPI-x86$(VBOX_SUFF_DLL)
114 endif
115 endif
116
117 #
[16832]118 # The C glue library.
119 #
[50183]120 LIBRARIES += VBoxCAPIGlue
[98183]121 VBoxCAPIGlue_TEMPLATE = VBoxMainExe
[50183]122 VBoxCAPIGlue_DEFS = IN_VBOXCAPI
123 VBoxCAPIGlue_SOURCES = \
124 VBoxCAPIGlue.c
125 ifdef VBOX_WITH_XPCOM
126 VBoxCAPIGlue_SOURCES += \
[98431]127 $(VBOX_PATH_SDK)/bindings/xpcom/lib/VirtualBox_i.c
[50183]128 else
129 VBoxCAPIGlue_SOURCES += \
[98431]130 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
[50183]131 endif
132 VBoxCAPIGlue_INCS = \
133 $(VBOX_PATH_SDK)/bindings/c/include \
134 $(VBOX_PATH_SDK)/bindings/c/glue
135 VBoxCAPIGlue_INTERMEDIATES = \
136 $(VBOX_PATH_SDK)/bindings/c/glue/VBoxCAPIGlue.h \
137 $(VBOX_PATH_SDK)/bindings/c/include/VBoxCAPI_v$(VBOX_API_VERSION).h
[16832]138
[98694]139
140 ifdef VBOX_WITH_32_ON_64_MAIN_API
[98695]141 # Same as above, but 32-bit version.
[98694]142 LIBRARIES += VBoxCAPIGlue-x86
143 VBoxCAPIGlue-x86_EXTENDS := VBoxCAPIGlue
144 VBoxCAPIGlue-x86_BLD_TRG_ARCH := x86
145 endif
146
147
[17569]148 if defined(VBOX_WITH_TESTCASES) && "$(KBUILD_TARGET)" != "darwin"
[16406]149 #
150 # The testcase (also in samples).
[16835]151 # C testcase using the dynamic glue.
152 #
[50183]153 PROGRAMS += tstCAPIGlue
[98169]154 tstCAPIGlue_TEMPLATE = VBoxR3TstExe
[50183]155 tstCAPIGlue_INCS = \
156 $(VBOX_PATH_SDK)/bindings/c/include \
157 $(VBOX_PATH_SDK)/bindings/c/glue
158 ifdef VBOX_WITH_XPCOM
159 tstCAPIGlue_INCS += \
160 $(VBOX_PATH_SDK)/bindings/xpcom/include
161 else
162 tstCAPIGlue_INCS += \
163 $(VBOX_PATH_SDK)/bindings/mscom/include
164 endif
165 tstCAPIGlue_INTERMEDIATES = \
166 $(VBOX_PATH_SDK)/bindings/c/glue/VBoxCAPIGlue.h \
[50858]167 $(VBOX_PATH_SDK)/bindings/c/include/VBoxCAPI_v$(VBOX_API_VERSION).h \
[98431]168 $(if-expr !defined(VBOX_WITH_XPCOM),$(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h,)
[50183]169 tstCAPIGlue_SOURCES = \
170 tstCAPIGlue.c
171 tstCAPIGlue_LIBS = \
172 $(VBoxCAPIGlue_1_TARGET)
[98694]173
174 ifdef VBOX_WITH_32_ON_64_MAIN_API
175 # Same as above, but 32-bit version.
176 PROGRAMS += tstCAPIGlue-x86
177 tstCAPIGlue-x86_EXTENDS := tstCAPIGlue
178 tstCAPIGlue-x86_TEMPLATE := VBoxR3TstExe-x86
179 tstCAPIGlue-x86_BLD_TRG_ARCH := x86
180 tstCAPIGlue-x86_LIBS = $(VBoxCAPIGlue-x86_1_TARGET)
181 endif
[16406]182 endif
183
[99701]184endif # !VBOX_ONLY_SDK
[16406]185
186# generate rules.
[41477]187include $(FILE_KBUILD_SUB_FOOTER)
[16406]188
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use