VirtualBox

source: vbox/trunk/src/VBox/Main/cbinding/Makefile.kmk@ 49866

Last change on this file since 49866 was 49539, checked in by vboxsync, 11 years ago

Main/cbinding: lots of love and care for this long forgotten part of the code, make it easier to use and more functional (error handling, initialization), and clean up and extend the sample code. It now includes the event sample, no need to keep so much redundant code.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.3 KB
Line 
1# $Id: Makefile.kmk 49539 2013-11-18 16:52:10Z vboxsync $
2## @file
3# Sub-Makefile for the VBox C Binding.
4#
5
6#
7# Copyright (C) 2009-2013 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
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21
22if defined(VBOX_WITH_XPCOM) || defined(VBOX_ONLY_SDK)
23#
24# The samples
25#
26INSTALLS += XpComCSamples
27XpComCSamples_MODE = a+r,u+rw
28XpComCSamples_INST = \
29 $(INST_SDK)bindings/xpcom/cbinding/samples/
30XpComCSamples_SOURCES = \
31 tstXPCOMCGlue.c \
32 makefile.tstXPCOMCGlue=>Makefile
33
34INSTALLS += XpComCGlue
35XpComCGlue_MODE = a+r,u+rw
36XpComCGlue_INST = \
37 $(INST_SDK)bindings/xpcom/cbinding/
38XpComCGlue_SOURCES = \
39 VBoxXPCOMCGlue.c \
40 $(XpComCHeaders_0_OUTDIR)/VBoxXPCOMCGlue.h
41
42INSTALLS += XpComCHeaders
43XpComCHeaders_MODE = a+r,u+rw
44XpComCHeaders_INST = $(INST_SDK)bindings/xpcom/include/
45XpComCHeaders_SOURCES = \
46 VBoxCAPI_v2_2.h \
47 VBoxCAPI_v3_0.h \
48 VBoxCAPI_v3_1.h \
49 VBoxCAPI_v3_2.h \
50 VBoxCAPI_v4_0.h \
51 VBoxCAPI_v4_1.h \
52 VBoxCAPI_v4_2.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
71endif # VBOX_WITH_XPCOM || SDK
72if !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 = VBOXR3TSTEXE
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 endif
121
122endif # ! VBOX_ONLY_SDK
123
124# generate rules.
125include $(FILE_KBUILD_SUB_FOOTER)
126
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette