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