1 | # $Id: Makefile.kmk 96407 2022-08-22 17:43:14Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VBox C Binding.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009-2022 Oracle and/or its affiliates.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox base platform packages, as
|
---|
10 | # available from https://www.virtualbox.org.
|
---|
11 | #
|
---|
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 | #
|
---|
27 |
|
---|
28 | SUB_DEPTH = ../../../..
|
---|
29 | include $(KBUILD_PATH)/subheader.kmk
|
---|
30 |
|
---|
31 |
|
---|
32 | #
|
---|
33 | # The samples
|
---|
34 | #
|
---|
35 | INSTALLS += CAPISamples
|
---|
36 | CAPISamples_MODE = a+r,u+rw
|
---|
37 | CAPISamples_INST = \
|
---|
38 | $(INST_SDK)bindings/c/samples/
|
---|
39 | CAPISamples_SOURCES = \
|
---|
40 | tstCAPIGlue.c \
|
---|
41 | makefile.tstCAPIGlue=>Makefile
|
---|
42 |
|
---|
43 | #
|
---|
44 | # The ???.
|
---|
45 | #
|
---|
46 | INSTALLS += CAPIGlue
|
---|
47 | CAPIGlue_MODE = a+r,u+rw
|
---|
48 | CAPIGlue_INST = \
|
---|
49 | $(INST_SDK)bindings/c/glue/
|
---|
50 | CAPIGlue_SOURCES = \
|
---|
51 | VBoxCAPIGlue.c \
|
---|
52 | $(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h
|
---|
53 | CAPIGlue_CLEAN = \
|
---|
54 | $(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h
|
---|
55 |
|
---|
56 | $$(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h: \
|
---|
57 | $(PATH_SUB_CURRENT)/VBoxCAPIGlue.h.in \
|
---|
58 | $(MAKEFILE_CURRENT) \
|
---|
59 | | $$(dir $$@)
|
---|
60 | $(call MSG_GENERATE,,$@)
|
---|
61 | $(QUIET)$(SED) \
|
---|
62 | -e 's/@VBOX_API_VERSION@/$(VBOX_API_VERSION)/' \
|
---|
63 | < $< > $@
|
---|
64 |
|
---|
65 | #
|
---|
66 | # The ???.
|
---|
67 | #
|
---|
68 | INSTALLS += CAPIHeaders
|
---|
69 | CAPIHeaders_MODE = a+r,u+rw
|
---|
70 | CAPIHeaders_INST = $(INST_SDK)bindings/c/include/
|
---|
71 | CAPIHeaders_SOURCES = \
|
---|
72 | $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h=>VBoxCAPI_v$(VBOX_API_VERSION).h
|
---|
73 | CAPIHeaders_CLEAN = \
|
---|
74 | $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h
|
---|
75 |
|
---|
76 | $$(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h: \
|
---|
77 | $(PATH_SUB_CURRENT)/capiidl.xsl \
|
---|
78 | $(PATH_SUB_CURRENT)/../idl/typemap-shared.inc.xsl \
|
---|
79 | $(VBOX_XIDL_FILE) \
|
---|
80 | | $$(dir $$@)
|
---|
81 | $(call MSG_TOOL,xsltproc,CAPIHeaders,$<,$@)
|
---|
82 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
83 |
|
---|
84 | if !defined(VBOX_ONLY_SDK)
|
---|
85 |
|
---|
86 | #
|
---|
87 | # The C API binding utility DLL
|
---|
88 | #
|
---|
89 | DLLS += VBoxCAPI
|
---|
90 | VBoxCAPI_TEMPLATE = VBOXMAINCLIENTDLL
|
---|
91 | ifdef VBOX_WITH_XPCOM
|
---|
92 | # Keep old name on XPCOM so that legacy code is happy.
|
---|
93 | VBoxCAPI_INST = $(INST_BIN)VBoxXPCOMC$(VBOX_SUFF_DLL)
|
---|
94 | endif
|
---|
95 | VBoxCAPI_DEFS = IN_VBOXCAPI
|
---|
96 | VBoxCAPI_SOURCES = \
|
---|
97 | VBoxCAPI.cpp
|
---|
98 | VBoxCAPI_SOURCES.win = \
|
---|
99 | VBoxCAPI.rc
|
---|
100 | VBoxCAPI_INCS = \
|
---|
101 | $(CAPIHeaders_0_OUTDIR)
|
---|
102 | VBoxCAPI_INTERMEDIATES = \
|
---|
103 | $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h
|
---|
104 |
|
---|
105 | #
|
---|
106 | # The C glue library.
|
---|
107 | #
|
---|
108 | LIBRARIES += VBoxCAPIGlue
|
---|
109 | VBoxCAPIGlue_TEMPLATE = VBOXMAINEXE
|
---|
110 | VBoxCAPIGlue_DEFS = IN_VBOXCAPI
|
---|
111 | VBoxCAPIGlue_SOURCES = \
|
---|
112 | VBoxCAPIGlue.c
|
---|
113 | ifdef VBOX_WITH_XPCOM
|
---|
114 | VBoxCAPIGlue_SOURCES += \
|
---|
115 | $(VBOX_PATH_SDK)/bindings/xpcom/lib/VirtualBox_i.c
|
---|
116 | else
|
---|
117 | VBoxCAPIGlue_SOURCES += \
|
---|
118 | $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
|
---|
119 | endif
|
---|
120 | VBoxCAPIGlue_INCS = \
|
---|
121 | $(VBOX_PATH_SDK)/bindings/c/include \
|
---|
122 | $(VBOX_PATH_SDK)/bindings/c/glue
|
---|
123 | VBoxCAPIGlue_INTERMEDIATES = \
|
---|
124 | $(VBOX_PATH_SDK)/bindings/c/glue/VBoxCAPIGlue.h \
|
---|
125 | $(VBOX_PATH_SDK)/bindings/c/include/VBoxCAPI_v$(VBOX_API_VERSION).h
|
---|
126 |
|
---|
127 | if defined(VBOX_WITH_TESTCASES) && "$(KBUILD_TARGET)" != "darwin"
|
---|
128 | #
|
---|
129 | # The testcase (also in samples).
|
---|
130 | # C testcase using the dynamic glue.
|
---|
131 | #
|
---|
132 | PROGRAMS += tstCAPIGlue
|
---|
133 | tstCAPIGlue_TEMPLATE = VBOXR3TSTEXE
|
---|
134 | tstCAPIGlue_INCS = \
|
---|
135 | $(VBOX_PATH_SDK)/bindings/c/include \
|
---|
136 | $(VBOX_PATH_SDK)/bindings/c/glue
|
---|
137 | ifdef VBOX_WITH_XPCOM
|
---|
138 | tstCAPIGlue_INCS += \
|
---|
139 | $(VBOX_PATH_SDK)/bindings/xpcom/include
|
---|
140 | else
|
---|
141 | tstCAPIGlue_INCS += \
|
---|
142 | $(VBOX_PATH_SDK)/bindings/mscom/include
|
---|
143 | endif
|
---|
144 | tstCAPIGlue_INTERMEDIATES = \
|
---|
145 | $(VBOX_PATH_SDK)/bindings/c/glue/VBoxCAPIGlue.h \
|
---|
146 | $(VBOX_PATH_SDK)/bindings/c/include/VBoxCAPI_v$(VBOX_API_VERSION).h \
|
---|
147 | $(if-expr !defined(VBOX_WITH_XPCOM),$(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h,)
|
---|
148 | tstCAPIGlue_SOURCES = \
|
---|
149 | tstCAPIGlue.c
|
---|
150 | tstCAPIGlue_LIBS = \
|
---|
151 | $(VBoxCAPIGlue_1_TARGET)
|
---|
152 | endif
|
---|
153 |
|
---|
154 | endif # ! VBOX_ONLY_SDK
|
---|
155 |
|
---|
156 | # generate rules.
|
---|
157 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
158 |
|
---|