bsmedberg%covad.net 375567c90f Temporarily ship the JavaInterfaces.jar file in the xulrunner package itself (bin/sdk/lib) until we have a real developer kit build system.
git-svn-id: svn://10.0.0.236/trunk@186162 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-16 15:25:00 +00:00

124 lines
4.0 KiB
Makefile

# ***** 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) 2004
# 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@ ; @srcdir@/..
include $(DEPTH)/config/autoconf.mk
JARFILE = MozillaInterfaces.jar
JARFILE_SRC = $(patsubst %.jar,%-src.jar,$(JARFILE))
JAVA_SRCS = \
$(srcdir)/Mozilla.java \
$(srcdir)/GREVersionRange.java \
$(srcdir)/IGRE.java \
$(srcdir)/IXPCOM.java \
$(srcdir)/../XPCOMException.java \
$(srcdir)/IAppFileLocProvider.java \
$(srcdir)/INIParser.java \
$(srcdir)/VersionComparator.java \
$(NULL)
GEN_JAVA_SRCS = \
IXPCOMError.java \
$(NULL)
# install jars into SDK
SDK_LIBRARY = $(JARFILE) $(JARFILE_SRC)
GARBAGE += $(JARFILE) $(JARFILE_SRC) $(GEN_JAVA_SRCS)
GARBAGE_DIRS += _javagen org
include $(topsrcdir)/config/rules.mk
ifdef MOZ_DEBUG
JAVAC_FLAGS = -g
endif
ifeq ($(OS_ARCH),WINNT)
RUN =
OUTPUT_DIR = $(shell cygpath -w $(CURDIR)/_javagen/org/mozilla/xpcom)
else
RUN = $(DIST)/bin/run-mozilla.sh
OUTPUT_DIR = $(CURDIR)/_javagen/org/mozilla/xpcom
endif
_javagen/org/mozilla/xpcom/.iface_done: $(JAVA_SRCS) $(DIST)/bin/GenerateJavaInterfaces$(BIN_SUFFIX)
@if test ! -d _javagen/org/mozilla/xpcom; then \
touch .done; \
$(INSTALL) -m 644 .done _javagen/org/mozilla/xpcom; \
fi
@echo Copying Java source files
@$(INSTALL) -m 644 $(JAVA_SRCS) \
_javagen/org/mozilla/xpcom
@$(INSTALL) -m 644 $(GEN_JAVA_SRCS) _javagen/org/mozilla/xpcom
@echo Generating Java interface files
$(RUN) $(DIST)/bin/GenerateJavaInterfaces$(BIN_SUFFIX) -d $(OUTPUT_DIR)
@touch $@
# Use find and xargs for passing list of Java files to JAVAC. This avoids the
# "argument list too long" error on Windows when using *.java
org/mozilla/xpcom/.class_done: _javagen/org/mozilla/xpcom/.iface_done
@echo Compiling Java interface classes
find _javagen -name "*.java" | xargs $(JAVAC) $(JAVAC_FLAGS) -classpath . \
-d . -sourcepath _javagen
@touch $@
$(JARFILE): org/mozilla/xpcom/.class_done Makefile
$(JAR) cf $@ org
$(JARFILE_SRC): $(JARFILE)
$(JAR) cf $@ -C _javagen org
IXPCOMError.java: $(topsrcdir)/xpcom/base/nsError.h gen-nsError.pl Makefile Makefile.in
$(PERL) $(srcdir)/../gen-nsError.pl < $< > $@
export:: IXPCOMError.java
# Temporarily copy these not only to dist/sdk/lib but to dist/bin/sdk/lib
TEMP_SDK_DIR = $(DIST)/bin/sdk/lib
$(TEMP_SDK_DIR)::
$(NSINSTALL) -D $@
libs:: $(JARFILE) $(JARFILE_SRC) $(TEMP_SDK_DIR)
$(INSTALL) $(IFLAGS2) $^