1 | # $Id: Makefile.kmk 41477 2012-05-29 11:43:27Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VBox C Binding.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2009-2012 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 | if defined(VBOX_WITH_XPCOM) || defined(VBOX_ONLY_SDK)
|
---|
23 | #
|
---|
24 | # The samples
|
---|
25 | #
|
---|
26 | INSTALLS += XpComCSamples
|
---|
27 | XpComCSamples_MODE = a+r,u+rw
|
---|
28 | XpComCSamples_INST = \
|
---|
29 | $(INST_SDK)bindings/xpcom/cbinding/samples/
|
---|
30 | XpComCSamples_SOURCES = \
|
---|
31 | tstXPCOMCGlue.c \
|
---|
32 | tstXPCOMCCall.c \
|
---|
33 | makefile.tstXPCOMCGlue=>Makefile
|
---|
34 |
|
---|
35 | INSTALLS += XpComCGlue
|
---|
36 | XpComCGlue_MODE = a+r,u+rw
|
---|
37 | XpComCGlue_INST = \
|
---|
38 | $(INST_SDK)bindings/xpcom/cbinding/
|
---|
39 | XpComCGlue_SOURCES = \
|
---|
40 | VBoxXPCOMCGlue.c \
|
---|
41 | $(XpComCHeaders_0_OUTDIR)/VBoxXPCOMCGlue.h
|
---|
42 |
|
---|
43 | INSTALLS += XpComCHeaders
|
---|
44 | XpComCHeaders_MODE = a+r,u+rw
|
---|
45 | XpComCHeaders_INST = $(INST_SDK)bindings/xpcom/include/
|
---|
46 | XpComCHeaders_SOURCES = \
|
---|
47 | VBoxCAPI_v2_2.h \
|
---|
48 | VBoxCAPI_v3_0.h \
|
---|
49 | VBoxCAPI_v3_1.h \
|
---|
50 | VBoxCAPI_v3_2.h \
|
---|
51 | VBoxCAPI_v4_0.h \
|
---|
52 | VBoxCAPI_v4_1.h \
|
---|
53 | $(XpComCHeaders_0_OUTDIR)/VBoxCAPI.h=>VBoxCAPI_v$(VBOX_API_VERSION).h
|
---|
54 |
|
---|
55 | $$(XpComCHeaders_0_OUTDIR)/VBoxXPCOMCGlue.h: \
|
---|
56 | $(PATH_SUB_CURRENT)/VBoxXPCOMCGlue.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 | $$(XpComCHeaders_0_OUTDIR)/VBoxCAPI.h: \
|
---|
65 | $(PATH_SUB_CURRENT)/xpcidl.xsl \
|
---|
66 | $(VBOX_XIDL_FILE) \
|
---|
67 | | $$(dir $$@)
|
---|
68 | $(call MSG_TOOL,xsltproc,XpComCHeaders,$<,$@)
|
---|
69 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
70 |
|
---|
71 | endif # VBOX_WITH_XPCOM || SDK
|
---|
72 | if !defined(VBOX_ONLY_SDK) && defined(VBOX_WITH_XPCOM)
|
---|
73 |
|
---|
74 | #
|
---|
75 | # The C utility DLL
|
---|
76 | #
|
---|
77 | ifdef VBOX_WITH_XPCOM
|
---|
78 | DLLS += VBoxXPCOMC
|
---|
79 | VBoxXPCOMC_TEMPLATE = VBOXMAINDLL
|
---|
80 | VBoxXPCOMC_DEFS = IN_VBOXXPCOMC
|
---|
81 | VBoxXPCOMC_SOURCES = \
|
---|
82 | VBoxXPCOMC.cpp
|
---|
83 | VBoxXPCOMC_INCS = \
|
---|
84 | $(XpComCHeaders_0_OUTDIR)
|
---|
85 | VBoxXPCOMC_INTERMEDIATES = \
|
---|
86 | $(XpComCHeaders_0_OUTDIR)/VBoxCAPI.h
|
---|
87 | endif
|
---|
88 |
|
---|
89 | #
|
---|
90 | # The C glue library.
|
---|
91 | #
|
---|
92 | LIBRARIES += VBoxXPCOMCGlue
|
---|
93 | VBoxXPCOMCGlue_TEMPLATE = VBOXMAINEXE
|
---|
94 | VBoxXPCOMCGlue_DEFS = IN_VBOXXPCOMC
|
---|
95 | VBoxXPCOMCGlue_SOURCES = \
|
---|
96 | VBoxXPCOMCGlue.c
|
---|
97 | VBoxXPCOMCGlue_INCS = \
|
---|
98 | $(VBOX_PATH_SDK)/bindings/xpcom/cbinding
|
---|
99 | VBoxXPCOMCGlue_INTERMEDIATES = \
|
---|
100 | $(VBOX_PATH_SDK)/bindings/xpcom/cbinding/VBoxXPCOMCGlue.h \
|
---|
101 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VBoxCAPI_v$(VBOX_API_VERSION).h
|
---|
102 |
|
---|
103 | if defined(VBOX_WITH_TESTCASES) && "$(KBUILD_TARGET)" != "darwin"
|
---|
104 | #
|
---|
105 | # The testcase (also in samples).
|
---|
106 | # C testcase using the dynamic glue.
|
---|
107 | #
|
---|
108 | PROGRAMS += tstXPCOMCGlue
|
---|
109 | tstXPCOMCGlue_TEMPLATE = VBOXR3EXE
|
---|
110 | tstXPCOMCGlue_INCS = \
|
---|
111 | $(VBOX_PATH_SDK)/bindings/xpcom/include \
|
---|
112 | $(VBOX_PATH_SDK)/bindings/xpcom/cbinding
|
---|
113 | tstXPCOMCGlue_INTERMEDIATES = \
|
---|
114 | $(VBOX_PATH_SDK)/bindings/xpcom/cbinding/VBoxXPCOMCGlue.h \
|
---|
115 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VBoxCAPI_v$(VBOX_API_VERSION).h
|
---|
116 | tstXPCOMCGlue_SOURCES = \
|
---|
117 | tstXPCOMCGlue.c
|
---|
118 | tstXPCOMCGlue_LIBS = \
|
---|
119 | $(VBoxXPCOMCGlue_1_TARGET)
|
---|
120 |
|
---|
121 | ifeq (disabled,1)
|
---|
122 | #
|
---|
123 | # The callback testcase.
|
---|
124 | #
|
---|
125 | PROGRAMS += tstXPCOMCCall
|
---|
126 | tstXPCOMCCall_TEMPLATE = VBOXR3EXE
|
---|
127 | tstXPCOMCCall_INCS = \
|
---|
128 | $(VBOX_PATH_SDK)/bindings/xpcom/include
|
---|
129 | tstXPCOMCCall_INTERMEDIATES = \
|
---|
130 | $(VBOX_PATH_SDK)/bindings/xpcom/include/VBoxCAPI_v$(VBOX_API_VERSION).h
|
---|
131 | tstXPCOMCCall_SOURCES = \
|
---|
132 | tstXPCOMCCall.c
|
---|
133 | tstXPCOMCCall_LIBS = \
|
---|
134 | $(VBoxXPCOMCGlue_1_TARGET)
|
---|
135 | endif
|
---|
136 | endif
|
---|
137 |
|
---|
138 | endif # ! VBOX_ONLY_SDK
|
---|
139 |
|
---|
140 | # generate rules.
|
---|
141 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
142 |
|
---|