VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/java/Makefile.kmk@ 29098

Last change on this file since 29098 was 29098, checked in by vboxsync, 15 years ago

java bridge: XPCOM executable template needed on Mac

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.0 KB
Line 
1# $Id: Makefile.kmk 29098 2010-05-05 16:47:23Z vboxsync $
2## @file
3# Sub-Makefile for Java bindings
4#
5
6#
7# Copyright (C) 2010 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
21VBOX_JXPCOM_SRC := $(PATH_SUB_CURRENT)
22
23ifeq ($(KBUILD_TARGET), darwin)
24 VBOX_JAVA_HOME = /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
25 VBOX_JAVAC = $(VBOX_JAVA_HOME)/Commands/javac
26 VBOX_JAVAH = $(VBOX_JAVA_HOME)/Commands/javah
27 VBOX_JAR = $(VBOX_JAVA_HOME)/Commands/jar
28 VBOX_JAVA_INC = $(VBOX_JAVA_HOME)/Headers
29else
30ifeq ($(KBUILD_TARGET), linux)
31 VBOX_JAVA_HOME ?= /usr/lib/jvm/java-1.5.0-sun
32endif
33ifeq ($(KBUILD_TARGET), solaris)
34 VBOX_JAVA_HOME ?= /usr/jdk/jdk1.5.0
35endif
36 VBOX_JAVAC = $(VBOX_JAVA_HOME)/bin/javac
37 VBOX_JAVAH = $(VBOX_JAVA_HOME)/bin/javah
38 VBOX_JAR = $(VBOX_JAVA_HOME)/bin/jar
39 # correct for targets we care about
40 VBOX_MD_OS = $(KBUILD_TARGET)
41 VBOX_JAVA_INC = $(VBOX_JAVA_HOME)/include \
42 $(VBOX_JAVA_HOME)/include/$(VBOX_MD_OS)
43endif
44
45VBOX_JXPCOM_TARGET = $(PATH_TARGET)/vboxjxpcom
46VBOX_JXPCOM_JDEST := $(VBOX_JXPCOM_TARGET)/jdest
47
48VBOX_JXPCOM_GENH = \
49 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_XPCOMImpl.h \
50 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_GREImpl.h \
51 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_MozillaImpl.h \
52 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_XPCOMJavaProxy.h \
53 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_internal_JavaXPCOMMethods.h \
54 $(VBOX_JXPCOM_JDEST)/org_mozilla_xpcom_ProfileLock.h
55
56VBoxJXpcom_TEMPLATE = XPCOM
57VBoxJXpcom_CXXFLAGS = -Wno-write-strings
58VBoxJXpcom_DEFS = \
59 EXPORT_XPTI_API \
60 EXPORT_XPT_API \
61 VBOX_WITH_XPCOM
62VBoxJXpcom_DEFS.darwin = XP_MACOSX
63VBoxJXpcom_NAME = libvboxjxpcom
64VBoxJXpcom_DLLSUFF.darwin = .jnilib
65VBoxJXpcom_INCS = \
66 src \
67 $(VBOX_JAVA_INC) \
68 $(VBOX_PATH_XPCOM_SRC)/xpcom/glue \
69 $(VBOX_PATH_XPCOM_SRC)/xpcom/build \
70 $(VBOX_JXPCOM_JDEST)
71VBoxJXpcom_SOURCES = \
72 src/nsAppFileLocProviderProxy.cpp \
73 src/nsJavaWrapper.cpp \
74 src/nsJavaXPCOMBindingUtils.cpp \
75 src/nsJavaXPTCStub.cpp \
76 src/nsJavaXPTCStubWeakRef.cpp \
77 src/nsJavaXPCOMGlue.cpp \
78 src/nsJavaInterfaces.cpp
79VBoxJXpcom_LIBS = \
80 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
81 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
82
83src/nsJavaInterfaces.cpp_DEPS = $(VBOX_JXPCOM_GENH)
84
85DLLS += VBoxJXpcom
86
87BLDPROGS += genjifaces
88
89genjifaces_TEMPLATE = XPCOMEXE
90genjifaces_INCS = \
91 src
92genjifaces_DEFS = \
93 EXPORT_XPTI_API \
94 EXPORT_XPT_API \
95 VBOX_WITH_XPCOM
96genjifaces_SOURCES = \
97 tools/genifaces/GenerateJavaInterfaces.cpp \
98 src/nsFileStreams.cpp
99genjifaces_LIBS = \
100 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
101 $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) \
102 $(PATH_BIN)/VBoxRT$(VBOX_SUFF_DLL)
103genjifaces_DEPS = $(PATH_TARGET)/VBox-xpcom-idl-timestamp
104genjifaces_INST = $(INST_BIN)
105
106#
107# Install JAR files
108#
109INSTALLS += VBoxJXpcom-inst-jar
110
111VBOX_JXPCOM_JAR = $(VBOX_JXPCOM_TARGET)/vboxjxpcom.jar
112VBOX_JXPCOM_JSRC = $(VBOX_JXPCOM_SRC)/src/org/mozilla/xpcom
113VBOX_JXPCOM_JGEN = $(PATH_TARGET)/vboxjgen
114
115VBoxJXpcom-inst-jar_INST = $(INST_SDK)bindings/xpcom/java
116VBoxJXpcom-inst-jar_SOURCES = $(VBOX_JXPCOM_JAR)
117
118JXPCOM_JAR_SRC= $(VBOX_JXPCOM_JSRC)/IXPCOM.java \
119 $(VBOX_JXPCOM_JSRC)/Mozilla.java \
120 $(VBOX_JXPCOM_JSRC)/VersionComparator.java \
121 $(VBOX_JXPCOM_JSRC)/GREVersionRange.java \
122 $(VBOX_JXPCOM_JSRC)/IAppFileLocProvider.java \
123 $(VBOX_JXPCOM_JSRC)/ProfileLock.java \
124 $(VBOX_JXPCOM_JSRC)/IGRE.java \
125 $(VBOX_JXPCOM_JSRC)/IJavaXPCOMUtils.java \
126 $(VBOX_JXPCOM_JSRC)/XPCOMException.java \
127 $(VBOX_JXPCOM_JSRC)/IMozilla.java \
128 $(VBOX_JXPCOM_JSRC)/XPCOMInitializationException.java \
129 $(VBOX_JXPCOM_JSRC)/INIParser.java \
130 $(VBOX_JXPCOM_JSRC)/internal/GREImpl.java \
131 $(VBOX_JXPCOM_JSRC)/internal/JavaXPCOMMethods.java \
132 $(VBOX_JXPCOM_JSRC)/internal/MozillaImpl.java \
133 $(VBOX_JXPCOM_JSRC)/internal/XPCOMImpl.java \
134 $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxyBase.java \
135 $(VBOX_JXPCOM_JSRC)/internal/XPCOMJavaProxy.java
136
137VBOX_JXPCOM_GEN = $(VBOX_JXPCOM_TARGET)/jxpcomgen
138
139VBOX_JXPCOM_NSERROR = $(VBOX_JXPCOM_GEN)/java/XPCOMError.java
140VBOX_JXPCOM_MGR = $(VBOX_JXPCOM_SRC)/src/org/virtualbox/VirtualBoxManager.java
141
142$(VBOX_JXPCOM_GENH): $(VBOX_JXPCOM_JAR)
143 $(VBOX_JAVAH) -classpath $(VBOX_JXPCOM_JDEST) -d $(VBOX_JXPCOM_JDEST) \
144 org.mozilla.xpcom.internal.XPCOMImpl \
145 org.mozilla.xpcom.internal.GREImpl \
146 org.mozilla.xpcom.internal.MozillaImpl \
147 org.mozilla.xpcom.internal.XPCOMJavaProxy \
148 org.mozilla.xpcom.ProfileLock \
149 org.mozilla.xpcom.internal.JavaXPCOMMethods
150
151$(VBOX_JXPCOM_GEN):
152 $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_GEN)
153
154$(VBOX_JXPCOM_GEN)/java:
155 $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_GEN)/java
156
157$(VBOX_JXPCOM_NSERROR): $(VBOX_PATH_XPCOM_SRC)/xpcom/base/nsError.h $(VBOX_JXPCOM_SRC)/tools/gen-nsError.pl $(VBOX_JXPCOM_GEN)/java
158 perl $(VBOX_JXPCOM_SRC)/tools/gen-nsError.pl < $< > $@
159
160$(VBOX_JXPCOM_GEN)/jxpcomgen.list: $(PATH_BIN)/genjifaces$(HOSTSUFF_EXE) $(PATH_TARGET)/VBox-xpcom-xpt-files/VBoxXPCOMBase.xpt $(VBOX_JXPCOM_GEN)
161 $(QUIET)echo Generating Java interface files
162 $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_GEN)/java
163 $(PATH_BIN)/genjifaces$(HOSTSUFF_EXE) -d $(VBOX_JXPCOM_GEN)/java
164 $(QUIET)echo $$(ls $(VBOX_JXPCOM_GEN)/java/*.java) > $@
165
166$(VBOX_JXPCOM_JAR): $(JXPCOM_JAR_SRC) $(VBOX_JXPCOM_GEN)/jxpcomgen.list $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR)
167 $(QUIET)$(RM) -Rf $(VBOX_JXPCOM_JDEST)
168 $(QUIET)$(MKDIR) -p $(VBOX_JXPCOM_JDEST)
169 $(VBOX_JAVAC) @$ $(VBOX_JXPCOM_GEN)/jxpcomgen.list \
170 -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST)
171 $(VBOX_JAVAC) $(JXPCOM_JAR_SRC) \
172 $(VBOX_JXPCOM_NSERROR) $(VBOX_JXPCOM_MGR) \
173 -d $(VBOX_JXPCOM_JDEST) -classpath $(VBOX_JXPCOM_JDEST)
174 $(VBOX_JAR) cf $@ -C $(VBOX_JXPCOM_TARGET)/jdest .
175
176
177ifdef VBOX_ONLY_SDK
178 #
179 # Install sample code.
180 #
181 INSTALLS += jxpcomsample
182 jxpcomsample_INST = $(INST_SDK)bindings/xpcom/java
183 jxpcomsample_MODE = a+rx,u+w
184 jxpcomsample_SOURCES = \
185 tests/TestVBox.java=>samples/TestVBox.java \
186 tests/Makefile=>samples/Makefiles
187endif
188
189include $(KBUILD_PATH)/subfooter.kmk
190
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