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