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