Makefile.kmk revision 1ec5a5157645798be8b5f57f197700bb86765b44
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# Sub-Makefile for Java bindings
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# Copyright (C) 2010 Oracle Corporation
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# available from http://www.virtualbox.org. This file is free software;
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# you can redistribute it and/or modify it under the terms of the GNU
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# General Public License (GPL) as published by the Free Software
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncSUB_DEPTH = ../../../..
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncinclude $(KBUILD_PATH)/subheader.kmk
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_SRC := $(PATH_SUB_CURRENT)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncifeq ($(KBUILD_TARGET), darwin)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAVA_HOME = /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAVAC = $(VBOX_JAVA_HOME)/Commands/javac
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAVAH = $(VBOX_JAVA_HOME)/Commands/javah
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAR = $(VBOX_JAVA_HOME)/Commands/jar
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAVA_INC = $(VBOX_JAVA_HOME)/Headers
1ec5a5157645798be8b5f57f197700bb86765b44vboxsync ifeq ($(KBUILD_TARGET), linux)
1ec5a5157645798be8b5f57f197700bb86765b44vboxsync VBOX_JAVA_HOME ?= /usr/lib/jvm/java-1.5.0-sun
1ec5a5157645798be8b5f57f197700bb86765b44vboxsync ifeq ($(KBUILD_TARGET), solaris)
1ec5a5157645798be8b5f57f197700bb86765b44vboxsync # VBOX_JAVA_HOME ?= /usr/jdk/jdk1.5.0
1ec5a5157645798be8b5f57f197700bb86765b44vboxsync VBOX_JAVA_HOME ?= /usr/java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAVAC = $(VBOX_JAVA_HOME)/bin/javac
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAVAH = $(VBOX_JAVA_HOME)/bin/javah
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAR = $(VBOX_JAVA_HOME)/bin/jar
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync # correct for targets we care about
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_MD_OS = $(KBUILD_TARGET)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_JAVA_INC = $(VBOX_JAVA_HOME)/include \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JAVA_HOME)/include/$(VBOX_MD_OS)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_TARGET = $(PATH_TARGET)/vboxjxpcom
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_JDEST := $(VBOX_JXPCOM_TARGET)/jdest
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_GENH = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_XPCOMImpl.h \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_GREImpl.h \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_MozillaImpl.h \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_XPCOMJavaProxy.h \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_JavaXPCOMMethods.h \
1ec5a5157645798be8b5f57f197700bb86765b44vboxsync $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_ProfileLock.h
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom_TEMPLATE = XPCOM
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom_CXXFLAGS = -Wno-write-strings
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom_DEFS = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync EXPORT_XPTI_API \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync EXPORT_XPT_API \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_WITH_XPCOM
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom_NAME = libvboxjxpcom
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom_INCS = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JAVA_INC) \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_PATH_XPCOM_SRC)/xpcom/glue \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_PATH_XPCOM_SRC)/xpcom/build \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JDEST)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom_SOURCES = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom_LIBS = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
1ec5a5157645798be8b5f57f197700bb86765b44vboxsync $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncsrc/nsJavaInterfaces.cpp_DEPS = $(VBOX_JXPCOM_GENH)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncDLLS += VBoxJXpcom
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncBLDPROGS += genjifaces
29b9a88f882c60887f4908f00db4461432610658vboxsyncgenjifaces_TEMPLATE = XPCOMEXE
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncgenjifaces_INCS = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncgenjifaces_DEFS = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync EXPORT_XPTI_API \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync EXPORT_XPT_API \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync VBOX_WITH_XPCOM
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncgenjifaces_SOURCES = \
3a948eb356afe683c156a5cfdd982bf95966b5b3vboxsyncgenjifaces_LIBS = \
3a948eb356afe683c156a5cfdd982bf95966b5b3vboxsync $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
e99bd87e9b40f21c8fa9e61a4e8f2fe80fe2be06vboxsync $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) \
e99bd87e9b40f21c8fa9e61a4e8f2fe80fe2be06vboxsync $(PATH_BIN)/VBoxRT$(VBOX_SUFF_DLL)
bf250cf7115e453cb01696179244d914b9d85f2dvboxsyncgenjifaces_DEPS = $(PATH_TARGET)/VBox-xpcom-idl-timestamp
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncgenjifaces_INST = $(INST_BIN)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync# Install JAR files
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncINSTALLS += VBoxJXpcom-inst-jar
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_JAR = $(VBOX_JXPCOM_TARGET)/vboxjxpcom.jar
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_JSRC = $(VBOX_JXPCOM_SRC)/src/org/mozilla/xpcom
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_JGEN = $(PATH_TARGET)/vboxjgen
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom-inst-jar_INST = $(INST_SDK)bindings/xpcom/java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBoxJXpcom-inst-jar_SOURCES = $(VBOX_JXPCOM_JAR)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncJXPCOM_JAR_SRC= $(VBOX_JXPCOM_JSRC)/IXPCOM.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/Mozilla.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/VersionComparator.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/GREVersionRange.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/IAppFileLocProvider.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/ProfileLock.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/IGRE.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/IJavaXPCOMUtils.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/XPCOMException.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/IMozilla.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/XPCOMInitializationException.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/INIParser.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/internal/GREImpl.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/internal/JavaXPCOMMethods.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/internal/MozillaImpl.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/internal/XPCOMImpl.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxyBase.java \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxy.java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_GEN = $(VBOX_JXPCOM_TARGET)/jxpcomgen
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_NSERROR = $(VBOX_JXPCOM_GEN)/java/XPCOMError.java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncVBOX_JXPCOM_MGR = $(VBOX_JXPCOM_SRC)/src/org/virtualbox/VirtualBoxManager.java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync$(VBOX_JXPCOM_GENH): $(VBOX_JXPCOM_JAR)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JAVAH) -classpath $(VBOX_JXPCOM_JDEST) -d $(VBOX_JXPCOM_JDEST) \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync$(VBOX_JXPCOM_GEN):
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_GEN)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync$(VBOX_JXPCOM_GEN)/java:
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_GEN)/java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync$(VBOX_JXPCOM_NSERROR): $(VBOX_PATH_XPCOM_SRC)/xpcom/base/nsError.h $(VBOX_JXPCOM_SRC)/tools/gen-nsError.pl $(VBOX_JXPCOM_GEN)/java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync perl $(VBOX_JXPCOM_SRC)/tools/gen-nsError.pl < $< > $@
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync$(VBOX_JXPCOM_GEN)/jxpcomgen.list: $(PATH_BIN)/genjifaces$(HOSTSUFF_EXE) $(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt $(VBOX_JXPCOM_GEN)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(QUIET)echo Generating Java interface files
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_GEN)/java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(PATH_BIN)/genjifaces$(HOSTSUFF_EXE) -d $(VBOX_JXPCOM_GEN)/java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(QUIET)echo $$(ls $(VBOX_JXPCOM_GEN)/java/*.java) > $@
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync$(VBOX_JXPCOM_JAR): $(JXPCOM_JAR_SRC) $(VBOX_JXPCOM_GEN)/jxpcomgen.list $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(QUIET)$(RM) -Rf $(VBOX_JXPCOM_JDEST)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_JDEST)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JAVAC) @$ $(VBOX_JXPCOM_GEN)/jxpcomgen.list \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JAVAC) $(JXPCOM_JAR_SRC) \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR) \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST)
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync $(VBOX_JAR) cf $@ -C $(VBOX_JXPCOM_TARGET)/jdest .
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncifdef VBOX_ONLY_SDK
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync # Install sample code.
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync INSTALLS += jxpcomsample
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync jxpcomsample_INST = $(INST_SDK)bindings/xpcom/java
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync jxpcomsample_MODE = a+rx,u+w
5828e9d7f59d4682a58585195d67153abdabacfcvboxsync jxpcomsample_SOURCES = \
5828e9d7f59d4682a58585195d67153abdabacfcvboxsyncinclude $(KBUILD_PATH)/subfooter.kmk