2007-03-22 10:30:00 -07:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
|
|
|
#
|
|
|
|
# The Original Code is Java XPCOM Bindings.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is IBM Corporation.
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2006
|
|
|
|
# IBM Corporation. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
# Javier Pedemonte (jhpedemonte@gmail.com)
|
|
|
|
#
|
|
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
|
|
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
# of those above. If you wish to allow use of your version of this file only
|
|
|
|
# under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
# use your version of this file under the terms of the MPL, indicate your
|
|
|
|
# decision by deleting the provisions above and replace them with the notice
|
|
|
|
# and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
# the provisions above, a recipient may use your version of this file under
|
|
|
|
# the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
#
|
|
|
|
# ***** END LICENSE BLOCK *****
|
|
|
|
|
|
|
|
DEPTH = ../../../..
|
|
|
|
topsrcdir = @top_srcdir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
|
|
|
|
JAVA_LIBRARY_NAME = MozillaGlue
|
|
|
|
|
|
|
|
# Don't install MozillaGlue.jar in $(DIST)/bin
|
|
|
|
NO_DIST_INSTALL=1
|
|
|
|
NO_INSTALL=1
|
|
|
|
|
|
|
|
PACKAGE_DIR = org/mozilla/xpcom
|
|
|
|
|
|
|
|
JAVA_SRCS = \
|
|
|
|
$(PACKAGE_DIR)/Mozilla.java \
|
|
|
|
$(PACKAGE_DIR)/GREVersionRange.java \
|
|
|
|
$(PACKAGE_DIR)/IMozilla.java \
|
|
|
|
$(PACKAGE_DIR)/IGRE.java \
|
|
|
|
$(PACKAGE_DIR)/IXPCOM.java \
|
|
|
|
$(PACKAGE_DIR)/IJavaXPCOMUtils.java \
|
|
|
|
$(PACKAGE_DIR)/IAppFileLocProvider.java \
|
|
|
|
$(PACKAGE_DIR)/INIParser.java \
|
|
|
|
$(PACKAGE_DIR)/VersionComparator.java \
|
|
|
|
$(PACKAGE_DIR)/IXPCOMError.java \
|
|
|
|
$(PACKAGE_DIR)/ProfileLock.java \
|
|
|
|
$(PACKAGE_DIR)/XPCOMException.java \
|
|
|
|
$(PACKAGE_DIR)/XPCOMInitializationException.java \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
IFACES_JAR = MozillaInterfaces.jar
|
|
|
|
IFACES_JAR_SRC = $(patsubst %.jar,%-src.jar,$(IFACES_JAR))
|
|
|
|
|
|
|
|
JAVA_CLASSPATH += $(IFACES_JAR)
|
|
|
|
|
|
|
|
# install jars into SDK
|
|
|
|
SDK_LIBRARY = $(JAVA_LIBRARY_NAME).jar $(IFACES_JAR) $(IFACES_JAR_SRC)
|
|
|
|
|
2008-02-13 03:33:38 -08:00
|
|
|
GARBAGE += $(IFACES_JAR) $(IFACES_JAR_SRC) $(PACKAGE_DIR)/IXPCOMError.java java.files
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
|
|
|
# MozillaGlue.jar depends on MozillaInterfaces.jar, so make sure to generate
|
|
|
|
# the Mozilla Java interfaces first.
|
|
|
|
$(addprefix $(_JAVA_DIR)/,$(JAVA_SRCS:.java=.class)): $(IFACES_JAR)
|
|
|
|
|
|
|
|
##
|
|
|
|
# Generate IXPCOMError.java
|
|
|
|
##
|
|
|
|
|
|
|
|
$(_JAVA_DIR)/$(PACKAGE_DIR)/Mozilla.class: $(PACKAGE_DIR)/IXPCOMError.java
|
|
|
|
|
|
|
|
$(PACKAGE_DIR)::
|
|
|
|
$(NSINSTALL) -D $@
|
|
|
|
|
2008-11-27 18:26:44 -08:00
|
|
|
$(PACKAGE_DIR)/IXPCOMError.java: $(topsrcdir)/xpcom/base/nsError.h gen-nsError.pl $(PACKAGE_DIR) $(GLOBAL_DEPS)
|
2007-03-22 10:30:00 -07:00
|
|
|
$(PERL) $(srcdir)/gen-nsError.pl < $< > $@
|
|
|
|
|
|
|
|
##
|
|
|
|
# Compile generated Java interfaces
|
|
|
|
##
|
|
|
|
|
|
|
|
IFACES_DIR = _ifaces
|
|
|
|
$(IFACES_DIR)::
|
|
|
|
$(NSINSTALL) -D $@
|
|
|
|
|
|
|
|
GARBAGE_DIRS += $(IFACES_DIR)
|
|
|
|
|
2010-03-21 09:01:47 -07:00
|
|
|
# exclude interfaces that we don't need
|
|
|
|
IGNORE_IFACES_NAMES =
|
2007-03-22 10:30:00 -07:00
|
|
|
ifneq (,$(IGNORE_IFACES_NAMES))
|
|
|
|
IGNORE_IFACES = $(patsubst %, ! -name "*%.java", $(IGNORE_IFACES_NAMES))
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Using the temporary "java.files" avoids an "argument list too long"
|
|
|
|
# error on Windows when using *.java
|
2008-11-27 18:26:44 -08:00
|
|
|
$(IFACES_DIR)/$(JAVA_IFACES_PKG_NAME)/nsISupports.class: $(IFACES_DIR) $(wildcard $(JAVA_DIST_DIR)/default/$(JAVA_IFACES_PKG_NAME)/*.java) $(GLOBAL_DEPS)
|
2007-03-22 10:30:00 -07:00
|
|
|
@echo Compiling Java interfaces
|
|
|
|
find $(JAVA_DIST_DIR)/default -name "*.java" $(IGNORE_IFACES) > java.files
|
|
|
|
$(CYGWIN_WRAPPER) $(JAVAC) $(JAVAC_FLAGS) -classpath $(IFACES_DIR) \
|
|
|
|
-d $(IFACES_DIR) -sourcepath $(JAVA_DIST_DIR)/default @java.files
|
|
|
|
|
2007-05-03 09:28:16 -07:00
|
|
|
$(IFACES_JAR): $(IFACES_DIR)/$(JAVA_IFACES_PKG_NAME)/nsISupports.class Makefile
|
2007-03-22 10:30:00 -07:00
|
|
|
$(JAR) cf $@ -C $(IFACES_DIR) org
|
|
|
|
|
|
|
|
$(IFACES_JAR_SRC): $(IFACES_JAR)
|
|
|
|
$(JAR) cf $@ -C $(JAVA_DIST_DIR)/default org
|
2010-03-21 09:01:47 -07:00
|
|
|
ifneq (,$(IGNORE_IFACES_NAMES))
|
2007-03-22 10:30:00 -07:00
|
|
|
$(ZIP) -d $@ $(patsubst %, $(JAVA_IFACES_PKG_NAME)/%.java, $(IGNORE_IFACES_NAMES))
|
2010-03-21 09:01:47 -07:00
|
|
|
endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
# Since we set NO_DIST_INSTALL above, the jars don't get copied into the SDK.
|
|
|
|
# Handle that here.
|
|
|
|
libs:: $(SDK_LIBRARY) $(SDK_LIB_DIR)
|
|
|
|
$(INSTALL) $(IFLAGS2) $^
|