1998-09-06 17:36:06 +02:00
|
|
|
|
# Top level makefile fragment for the GNU compiler for the Java(TM)
|
|
|
|
|
# language.
|
1999-01-06 22:10:08 +01:00
|
|
|
|
# Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc.
|
1998-09-06 17:36:06 +02:00
|
|
|
|
|
|
|
|
|
#This file is part of GNU CC.
|
|
|
|
|
|
|
|
|
|
#GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
|
#it under the terms of the GNU General Public License as published by
|
|
|
|
|
#the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
#any later version.
|
|
|
|
|
|
|
|
|
|
#GNU CC is distributed in the hope that it will be useful,
|
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
#You should have received a copy of the GNU General Public License
|
|
|
|
|
#along with GNU CC; see the file COPYING. If not, write to
|
|
|
|
|
#the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
#Boston, MA 02111-1307, USA.
|
|
|
|
|
|
|
|
|
|
#Java and all Java-based marks are trademarks or registered trademarks
|
|
|
|
|
#of Sun Microsystems, Inc. in the United States and other countries.
|
|
|
|
|
#The Free Software Foundation is independent of Sun Microsystems, Inc.
|
|
|
|
|
|
|
|
|
|
# This file provides the language dependent support in the main Makefile.
|
|
|
|
|
# Each language makefile fragment must provide the following targets:
|
|
|
|
|
#
|
|
|
|
|
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
|
|
|
|
|
# foo.info, foo.dvi,
|
|
|
|
|
# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
|
|
|
|
|
# foo.uninstall, foo.distdir,
|
|
|
|
|
# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
|
|
|
|
|
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
|
|
|
|
|
#
|
|
|
|
|
# where `foo' is the name of the language.
|
|
|
|
|
#
|
|
|
|
|
# It should also provide rules for:
|
|
|
|
|
#
|
|
|
|
|
# - making any compiler driver (eg: g++)
|
|
|
|
|
# - the compiler proper (eg: jc1)
|
|
|
|
|
# - define the names for selecting the language in LANGUAGES.
|
1998-12-20 14:24:18 +01:00
|
|
|
|
#
|
1998-09-06 17:36:06 +02:00
|
|
|
|
# Extra flags to pass to recursive makes.
|
|
|
|
|
JAVA_FLAGS_TO_PASS = \
|
|
|
|
|
"JAVA_FOR_BUILD=$(JAVA_FOR_BUILD)" \
|
|
|
|
|
"JAVAFLAGS=$(JAVAFLAGS)" \
|
|
|
|
|
"JAVA_FOR_TARGET=$(JAVA_FOR_TARGET)"
|
|
|
|
|
|
|
|
|
|
# Actual names to use when installing a native compiler.
|
|
|
|
|
JAVA_INSTALL_NAME = `t='$(program_transform_name)'; echo gcj | sed $$t`
|
|
|
|
|
|
|
|
|
|
# Actual names to use when installing a cross-compiler.
|
|
|
|
|
JAVA_CROSS_NAME = `t='$(program_transform_cross_name)'; echo gcj | sed $$t`
|
|
|
|
|
|
1998-12-20 14:24:18 +01:00
|
|
|
|
#
|
1998-09-10 11:34:50 +02:00
|
|
|
|
GCJ = gcj
|
|
|
|
|
|
1998-09-06 17:36:06 +02:00
|
|
|
|
# Define the names for selecting java in LANGUAGES.
|
1998-10-22 15:06:56 +02:00
|
|
|
|
java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext)
|
1998-09-06 17:36:06 +02:00
|
|
|
|
|
|
|
|
|
# Define the name of target independant tools to be installed in $(bindir)
|
|
|
|
|
# Names are subject to changes
|
|
|
|
|
JAVA_TARGET_INDEPENDENT_BIN_TOOLS = gcjh jv-scan jcf-dump
|
|
|
|
|
|
|
|
|
|
# Tell GNU make to ignore these if they exist.
|
|
|
|
|
.PHONY: java
|
|
|
|
|
|
|
|
|
|
# Remember to keep this list in sync with JAVA_OBJS in Makefile.in!!!
|
|
|
|
|
#
|
|
|
|
|
JAVA_SRCS = $(srcdir)/java/parse.y $(srcdir)/java/class.c \
|
|
|
|
|
$(srcdir)/java/decl.c $(srcdir)/java/expr.c $(srcdir)/java/constants.c \
|
|
|
|
|
$(srcdir)/java/lang.c $(srcdir)/java/typeck.c $(srcdir)/java/except.c \
|
|
|
|
|
$(srcdir)/java/verify.c $(srcdir)/java/zextract.c $(srcdir)/java/jcf-io.c \
|
|
|
|
|
$(srcdir)/java/jcf-parse.c $(srcdir)/java/mangle.c \
|
1998-10-14 14:54:59 +02:00
|
|
|
|
$(srcdir)/java/jcf-write.c $(srcdir)/java/buffer.c \
|
1998-10-22 14:06:05 +02:00
|
|
|
|
$(srcdir)/java/jcf-depend.c $(srcdir)/java/jcf-path.c
|
1998-09-06 17:36:06 +02:00
|
|
|
|
|
|
|
|
|
jc1$(exeext): $(P) $(JAVA_SRCS) $(LIBDEPS) stamp-objlist
|
|
|
|
|
cd java; $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jc1$(exeext)
|
|
|
|
|
|
|
|
|
|
$(GCJ).c: $(srcdir)/gcc.c
|
|
|
|
|
-rm -f $@
|
|
|
|
|
$(LN_S) $(srcdir)/gcc.c $@
|
|
|
|
|
|
|
|
|
|
jvspec.o: $(srcdir)/java/jvspec.c
|
1998-11-11 23:48:27 +01:00
|
|
|
|
$(CC) -c -DWITH_THREAD_$(GCC_THREAD_FILE) -DWITH_GC_$(JAVAGC) \
|
1998-09-06 17:36:06 +02:00
|
|
|
|
$(ALL_CFLAGS) $(ALL_CPPFLAGS) \
|
|
|
|
|
$(INCLUDES) $(srcdir)/java/jvspec.c
|
|
|
|
|
|
|
|
|
|
# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
|
|
|
|
|
# It'd be nice if we could find an easier way to do this---rather than have
|
|
|
|
|
# to track changes to the toplevel gcc Makefile as well.
|
|
|
|
|
# We depend on $(GCJ).c last, to make it obvious where it came from.
|
|
|
|
|
$(GCJ).o: $(CONFIG_H) multilib.h config.status $(lang_specs_files) $(GCJ).c \
|
1999-01-05 20:17:20 +01:00
|
|
|
|
system.h prefix.h
|
1998-09-06 17:36:06 +02:00
|
|
|
|
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
|
|
|
|
|
$(DRIVER_DEFINES) \
|
|
|
|
|
-DLANG_SPECIFIC_DRIVER \
|
|
|
|
|
-c $(GCJ).c
|
|
|
|
|
|
|
|
|
|
# Create the compiler driver for $(GCJ).
|
1999-02-03 22:57:59 +01:00
|
|
|
|
$(GCJ)$(exeext): $(GCJ).o jvspec.o version.o \
|
|
|
|
|
prefix.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
|
1998-09-06 17:36:06 +02:00
|
|
|
|
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCJ).o jvspec.o prefix.o \
|
1999-02-03 22:57:59 +01:00
|
|
|
|
version.o $(EXTRA_GCC_OBJS) $(LIBS)
|
1998-09-06 17:36:06 +02:00
|
|
|
|
|
|
|
|
|
# Create a version of the $(GCJ) driver which calls the cross-compiler.
|
|
|
|
|
$(GCJ)-cross$(exeext): $(GCJ)$(exeext)
|
|
|
|
|
-rm -f $(GCJ)-cross$(exeext)
|
|
|
|
|
cp $(GCJ)$(exeext) $(GCJ)-cross$(exeext)
|
|
|
|
|
|
|
|
|
|
# Dependencies here must be kept in sync with dependencies in Makefile.in.
|
|
|
|
|
jvgenmain$(exeext): $(srcdir)/java/jvgenmain.c $(srcdir)/java/mangle.c \
|
1998-11-15 15:28:10 +01:00
|
|
|
|
$(OBSTACK) $(LIBDEPS)
|
1998-09-06 17:36:06 +02:00
|
|
|
|
cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jvgenmain$(exeext)
|
|
|
|
|
|
|
|
|
|
# This must be kept in sync with dependencies in Makefile.in.
|
|
|
|
|
GCJH_SOURCES = $(srcdir)/java/gjavah.c $(srcdir)/java/jcf-io.c \
|
|
|
|
|
$(srcdir)/java/zextract.c $(srcdir)/java/jcf-reader.c \
|
|
|
|
|
$(srcdir)/java/jcf.h $(srcdir)/java/javaop.h \
|
1998-10-22 14:06:05 +02:00
|
|
|
|
$(srcdir)/java/javaop.def $(srcdir)/java/jcf-depend.c \
|
|
|
|
|
$(srcdir)/java/jcf-path.c
|
1998-09-06 17:36:06 +02:00
|
|
|
|
|
1998-11-15 15:28:10 +01:00
|
|
|
|
gcjh$(exeext): $(GCJH_SOURCES) $(LIBDEPS)
|
1998-09-06 17:36:06 +02:00
|
|
|
|
cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../gcjh$(exeext)
|
|
|
|
|
|
1998-10-22 15:06:56 +02:00
|
|
|
|
# This must be kept in sync with dependencies in Makefile.in.
|
|
|
|
|
JV_SCAN_SOURCES = $(srcdir)/java/parse-scan.y $(srcdir)/java/lex.c \
|
1998-11-15 16:11:55 +01:00
|
|
|
|
$(srcdir)/java/parse.h $(srcdir)/java/lex.h $(srcdir)/java/jv-scan.c $(srcdir)/../libiberty/xmalloc.c $(srcdir)/../libiberty/xstrdup.c
|
1998-10-22 15:06:56 +02:00
|
|
|
|
|
1998-11-15 15:28:10 +01:00
|
|
|
|
jv-scan$(exeext): $(JV_SCAN_SOURCES) stamp-objlist $(LIBDEPS)
|
1998-10-22 15:06:56 +02:00
|
|
|
|
cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jv-scan$(exeext)
|
|
|
|
|
|
|
|
|
|
# This must be kept in sync with dependencies in Makefile.in.
|
|
|
|
|
JCF_DUMP_SOURCES = $(srcdir)/java/jcf-dump.c $(srcdir)/java/jcf-io.c \
|
|
|
|
|
$(srcdir)/java/zextract.c $(srcdir)/../libiberty/memmove.c
|
|
|
|
|
|
|
|
|
|
jcf-dump$(exeext): $(JCF_DUMP_SOURCES)
|
|
|
|
|
cd java && $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jcf-dump$(exeext)
|
1998-09-06 17:36:06 +02:00
|
|
|
|
|
1998-12-20 14:24:18 +01:00
|
|
|
|
#
|
1998-09-06 17:36:06 +02:00
|
|
|
|
# Build hooks:
|
|
|
|
|
|
1998-09-09 16:33:06 +02:00
|
|
|
|
java.all.build: $(GCJ)$(exeext)
|
|
|
|
|
java.all.cross: $(GCJ)-cross$(exeext)
|
1998-09-06 17:36:06 +02:00
|
|
|
|
java.start.encap: $(GCJ)$(exeext)
|
1998-09-09 16:33:06 +02:00
|
|
|
|
java.rest.encap:
|
1998-09-06 17:36:06 +02:00
|
|
|
|
|
|
|
|
|
java.info:
|
|
|
|
|
|
|
|
|
|
# Install hooks:
|
|
|
|
|
# jc1, gcj, jvgenmain, and gcjh are installed elsewhere as part
|
|
|
|
|
# of $(COMPILERS).
|
|
|
|
|
|
|
|
|
|
# Nothing to do here.
|
|
|
|
|
java.install-normal:
|
|
|
|
|
|
|
|
|
|
java.install-common:
|
|
|
|
|
-if [ -f $(GCJ)$(exeext) ]; then \
|
|
|
|
|
if [ -f $(GCJ)-cross$(exeext) ]; then \
|
|
|
|
|
rm -f $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
|
|
|
|
|
$(INSTALL_PROGRAM) $(GCJ)-cross$(exeext) $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
|
|
|
|
|
chmod a+x $(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
|
|
|
|
|
else \
|
|
|
|
|
rm -f $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
|
|
|
|
|
$(INSTALL_PROGRAM) $(GCJ)$(exeext) $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
|
|
|
|
|
chmod a+x $(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
|
|
|
|
|
fi ; \
|
|
|
|
|
fi ; \
|
|
|
|
|
for tool in $(JAVA_TARGET_INDEPENDENT_BIN_TOOLS); do \
|
|
|
|
|
if [ -f $$tool$(exeext) ]; then \
|
|
|
|
|
rm -f $(bindir)/$$tool$(exeext); \
|
|
|
|
|
$(INSTALL_PROGRAM) $$tool$(exeext) $(bindir)/$$tool$(exeext); \
|
|
|
|
|
chmod a+x $(bindir)/$$tool$(exeext); \
|
|
|
|
|
fi ; \
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
java.install-man:
|
|
|
|
|
|
|
|
|
|
java.uninstall:
|
|
|
|
|
-rm -rf $(bindir)/$(JAVA_INSTALL_NAME)$(exeext)
|
|
|
|
|
-rm -rf $(bindir)/$(JAVA_CROSS_NAME)$(exeext)
|
|
|
|
|
|
|
|
|
|
java.install-info:
|
|
|
|
|
|
1998-12-20 14:24:18 +01:00
|
|
|
|
#
|
1998-09-06 17:36:06 +02:00
|
|
|
|
# Clean hooks:
|
|
|
|
|
# A lot of the ancillary files are deleted by the main makefile.
|
|
|
|
|
# We just have to delete files specific to us.
|
|
|
|
|
|
|
|
|
|
java.mostlyclean:
|
|
|
|
|
-rm -f java/*$(objext) $(DEMANGLER_PROG)
|
|
|
|
|
java.clean:
|
|
|
|
|
java.distclean:
|
|
|
|
|
-rm -f java/config.status java/Makefile
|
|
|
|
|
-rm -f java/parse.output
|
|
|
|
|
java.extraclean:
|
|
|
|
|
java.maintainer-clean:
|
1998-11-12 17:15:18 +01:00
|
|
|
|
-rm -f java/parse.c java/parse-scan.c java/parse.output java/y.tab.c
|
1998-12-20 14:24:18 +01:00
|
|
|
|
#
|
1998-09-06 17:36:06 +02:00
|
|
|
|
# Stage hooks:
|
|
|
|
|
# The main makefile has already created stage?/java.
|
|
|
|
|
|
|
|
|
|
java.stage1:
|
|
|
|
|
-mv java/*$(objext) stage1/java
|
|
|
|
|
java.stage2:
|
|
|
|
|
-mv java/*$(objext) stage2/java
|
|
|
|
|
java.stage3:
|
|
|
|
|
-mv java/*$(objext) stage3/java
|
|
|
|
|
java.stage4:
|
|
|
|
|
-mv java/*$(objext) stage4/java
|
1998-12-20 14:24:18 +01:00
|
|
|
|
#
|
1998-09-06 17:36:06 +02:00
|
|
|
|
# Maintenance hooks:
|
|
|
|
|
|
|
|
|
|
# This target creates the files that can be rebuilt, but go in the
|
|
|
|
|
# distribution anyway. It then copies the files to the distdir directory.
|
|
|
|
|
java.distdir:
|
|
|
|
|
mkdir tmp/java
|
|
|
|
|
cd java ; $(MAKE) $(FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) parse.c hash.h
|
|
|
|
|
cd java; \
|
|
|
|
|
for file in *[0-9a-zA-Z+]; do \
|
|
|
|
|
ln $$file ../tmp/java >/dev/null 2>&1 || cp $$file ../tmp/java; \
|
|
|
|
|
done
|