# $Id: Makefile.kmk 93115 2022-01-01 11:31:46Z vboxsync $ ## @file # Sub-Makefile for the VBox C Binding. # # # Copyright (C) 2009-2022 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk # # The samples # INSTALLS += CAPISamples CAPISamples_MODE = a+r,u+rw CAPISamples_INST = \ $(INST_SDK)bindings/c/samples/ CAPISamples_SOURCES = \ tstCAPIGlue.c \ makefile.tstCAPIGlue=>Makefile # # The ???. # INSTALLS += CAPIGlue CAPIGlue_MODE = a+r,u+rw CAPIGlue_INST = \ $(INST_SDK)bindings/c/glue/ CAPIGlue_SOURCES = \ VBoxCAPIGlue.c \ $(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h CAPIGlue_CLEAN = \ $(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h $$(CAPIHeaders_0_OUTDIR)/VBoxCAPIGlue.h: \ $(PATH_SUB_CURRENT)/VBoxCAPIGlue.h.in \ $(MAKEFILE_CURRENT) \ | $$(dir $$@) $(call MSG_GENERATE,,$@) $(QUIET)$(SED) \ -e 's/@VBOX_API_VERSION@/$(VBOX_API_VERSION)/' \ < $< > $@ # # The ???. # INSTALLS += CAPIHeaders CAPIHeaders_MODE = a+r,u+rw CAPIHeaders_INST = $(INST_SDK)bindings/c/include/ CAPIHeaders_SOURCES = \ $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h=>VBoxCAPI_v$(VBOX_API_VERSION).h CAPIHeaders_CLEAN = \ $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h $$(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h: \ $(PATH_SUB_CURRENT)/capiidl.xsl \ $(PATH_SUB_CURRENT)/../idl/typemap-shared.inc.xsl \ $(VBOX_XIDL_FILE) \ | $$(dir $$@) $(call MSG_TOOL,xsltproc,CAPIHeaders,$<,$@) $(QUIET)$(VBOX_XSLTPROC) -o $@ $^ if !defined(VBOX_ONLY_SDK) # # The C API binding utility DLL # DLLS += VBoxCAPI VBoxCAPI_TEMPLATE = VBOXMAINCLIENTDLL ifdef VBOX_WITH_XPCOM # Keep old name on XPCOM so that legacy code is happy. VBoxCAPI_INST = $(INST_BIN)VBoxXPCOMC$(VBOX_SUFF_DLL) endif VBoxCAPI_DEFS = IN_VBOXCAPI VBoxCAPI_SOURCES = \ VBoxCAPI.cpp VBoxCAPI_SOURCES.win = \ VBoxCAPI.rc VBoxCAPI_INCS = \ $(CAPIHeaders_0_OUTDIR) VBoxCAPI_INTERMEDIATES = \ $(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h # # The C glue library. # LIBRARIES += VBoxCAPIGlue VBoxCAPIGlue_TEMPLATE = VBOXMAINEXE VBoxCAPIGlue_DEFS = IN_VBOXCAPI VBoxCAPIGlue_SOURCES = \ VBoxCAPIGlue.c ifdef VBOX_WITH_XPCOM VBoxCAPIGlue_SOURCES += \ $(VBOX_PATH_SDK)/bindings/xpcom/lib/VirtualBox_i.c else VBoxCAPIGlue_SOURCES += \ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c endif VBoxCAPIGlue_INCS = \ $(VBOX_PATH_SDK)/bindings/c/include \ $(VBOX_PATH_SDK)/bindings/c/glue VBoxCAPIGlue_INTERMEDIATES = \ $(VBOX_PATH_SDK)/bindings/c/glue/VBoxCAPIGlue.h \ $(VBOX_PATH_SDK)/bindings/c/include/VBoxCAPI_v$(VBOX_API_VERSION).h if defined(VBOX_WITH_TESTCASES) && "$(KBUILD_TARGET)" != "darwin" # # The testcase (also in samples). # C testcase using the dynamic glue. # PROGRAMS += tstCAPIGlue tstCAPIGlue_TEMPLATE = VBOXR3TSTEXE tstCAPIGlue_INCS = \ $(VBOX_PATH_SDK)/bindings/c/include \ $(VBOX_PATH_SDK)/bindings/c/glue ifdef VBOX_WITH_XPCOM tstCAPIGlue_INCS += \ $(VBOX_PATH_SDK)/bindings/xpcom/include else tstCAPIGlue_INCS += \ $(VBOX_PATH_SDK)/bindings/mscom/include endif tstCAPIGlue_INTERMEDIATES = \ $(VBOX_PATH_SDK)/bindings/c/glue/VBoxCAPIGlue.h \ $(VBOX_PATH_SDK)/bindings/c/include/VBoxCAPI_v$(VBOX_API_VERSION).h \ $(if-expr !defined(VBOX_WITH_XPCOM),$(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h,) tstCAPIGlue_SOURCES = \ tstCAPIGlue.c tstCAPIGlue_LIBS = \ $(VBoxCAPIGlue_1_TARGET) endif endif # ! VBOX_ONLY_SDK # generate rules. include $(FILE_KBUILD_SUB_FOOTER)