aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-05-08 19:24:42 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-05-08 19:24:42 +0000
commit281524f4cb2726320ecd87179f0ab84cd45951c8 (patch)
tree337247b74438baf7d95c9f73e0bfcf95f4f57cdd /libjava
parenta89e49c7242d5013dc8943b09723265af4dbecdf (diff)
downloadgcc-281524f4cb2726320ecd87179f0ab84cd45951c8.zip
gcc-281524f4cb2726320ecd87179f0ab84cd45951c8.tar.gz
gcc-281524f4cb2726320ecd87179f0ab84cd45951c8.tar.bz2
jcf-write.c (write_classfile): Write the file to a temporary file and then rename it.
* java/jcf-write.c (write_classfile): Write the file to a temporary file and then rename it. * libjava/Makefile.am (all_java_source_files): New variable. (all_java_class_files): Likewise. .java.class: New rule. (CLEANFILES): Remove tmp-list. * libjava/Makefile.in: Regenerated. From-SVN: r53298
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/Makefile.am47
-rw-r--r--libjava/Makefile.in115
3 files changed, 53 insertions, 117 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index ebf72c1..f507bd1 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,11 @@
+2002-05-08 Mark Mitchell <mark@codesourcery.com>
+
+ * libjava/Makefile.am (all_java_source_files): New variable.
+ (all_java_class_files): Likewise.
+ .java.class: New rule.
+ (CLEANFILES): Remove tmp-list.
+ * libjava/Makefile.in: Regenerated.
+
2002-05-09 David.Billinghurst <David.Billinghurst@riotinto.com>
* testsuite/lib/libjava.exp (test_libjava_from_javac):
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 118a69f..c98b0d1 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -165,45 +165,26 @@ install-exec-hook:
$(LN_S) libgcjx.la gnu-awt-xlib.la; \
fi
-## Make the .class files depend on the .zip file. This seems
-## backwards, but is right. This doesn't catch all the .class files,
-## but that is ok, because the ones it fails to pick up are defined in
-## a .java file with some other class which is caught. Note that we
-## only want to create headers for those files which do not have
-## hand-maintained headers.
-$(built_java_source_files:.java=.class): libgcj-@gcc_version@.jar
-$(java_source_files:.java=.class): libgcj-@gcc_version@.jar
-
-## The .class files for X will not be included in libgcj.jar, but the
-## rule for libgcj.jar will cause all out-of-date .class files to be
-## built. We need this to generate headers for the nat-files.
-$(x_java_source_files:.java=.class): libgcj-@gcc_version@.jar
-
-## We have the zip file depend on the java sources and not the class
-## files, because we don't know the names of all the class files.
-## FIXME: this method fails in a peculiar case: if libgcj.jar is
-## up-to-date, and foo.class is removed, and bar.java is touched, then
-## `make libgcj.jar' will not rebuilt foo.class. That's because
-## libgcj.jar is not out-of-date with respect to foo.java.
-libgcj-@gcc_version@.jar: $(built_java_source_files) $(java_source_files) $(x_java_source_files)
-## Create a list of all Java sources, without exceeding any shell limits.
- @: $(shell echo Creating list of files to compile...) $(shell rm -f tmp-list || :) $(shell touch tmp-list) $(foreach source,$?,$(shell echo $(source) >> tmp-list))
- @set fnord $(MAKEFLAGS); amf=$$2; fail=no; \
- javac="$(JAVAC)"; \
- cat tmp-list | (while read f; do \
- echo $$javac $(JCFLAGS) -classpath \'\' -bootclasspath $(here):$(srcdir) -d $(here) $$f; \
- $$javac $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) $$f \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes ;; *) exit 1;; esac; \
- done; \
- test "$$fail" = no)
- -@rm -f tmp-list libgcj-@gcc_version@.jar
+all_java_source_files = \
+ $(java_source_files) \
+ $(built_java_source_files) \
+ $(x_java_source_files)
+
+all_java_class_files = $(all_java_source_files:.java=.class)
+
+.java.class:
+ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) \
+ -d $(here) $<
+
+libgcj-@gcc_version@.jar: $(all_java_class_files)
+ -@rm -f libgcj-@gcc_version@.jar
## Note that we explicitly want to include directory information.
find java gnu javax org -type d -o -type f -name '*.class' | \
sed -e '/\/\./d' -e '/\/xlib/d' | \
$(ZIP) cfM0E@ $@
MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) $(x_javao_files) $(x_nat_files) $(x_nat_headers)
-CLEANFILES = tmp-list libgcj-@gcc_version@.jar
+CLEANFILES = libgcj-@gcc_version@.jar
clean-local:
## We just remove every .class file that was created.
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index 06cbfa6..b269ee7 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -228,8 +228,16 @@ libgcjx_la_LDFLAGS = @X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
libgcjx_la_LINK = $(LIBLINK)
+all_java_source_files = \
+ $(java_source_files) \
+ $(built_java_source_files) \
+ $(x_java_source_files)
+
+
+all_java_class_files = $(all_java_source_files:.java=.class)
+
MOSTLYCLEANFILES = $(javao_files) $(nat_files) $(nat_headers) $(c_files) $(x_javao_files) $(x_nat_files) $(x_nat_headers)
-CLEANFILES = tmp-list libgcj-@gcc_version@.jar
+CLEANFILES = libgcj-@gcc_version@.jar
SUFFIXES = .class .java .h
@@ -1725,9 +1733,8 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DATA = $(jar_DATA) $(toolexeclib_DATA)
DIST_COMMON = README COPYING ChangeLog Makefile.am Makefile.in NEWS \
-THANKS acconfig.h acinclude.m4 aclocal.m4 configure configure.in \
-gcj/libgcj-config.h.in gcj/stamp-h2.in include/config.h.in \
-include/stamp-h1.in libgcj-test.spec.in libgcj.spec.in
+THANKS acinclude.m4 aclocal.m4 configure configure.in \
+libgcj-test.spec.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -2713,53 +2720,6 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
-
-include/config.h: include/stamp-h1
- @if test ! -f $@; then \
- rm -f include/stamp-h1; \
- $(MAKE) include/stamp-h1; \
- else :; fi
-include/stamp-h1: $(srcdir)/include/config.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=include/config.h \
- $(SHELL) ./config.status
- @echo timestamp > include/stamp-h1 2> /dev/null
-$(srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/include/stamp-h1.in
- @if test ! -f $@; then \
- rm -f $(srcdir)/include/stamp-h1.in; \
- $(MAKE) $(srcdir)/include/stamp-h1.in; \
- else :; fi
-$(srcdir)/include/stamp-h1.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
- cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/include/stamp-h1.in 2> /dev/null
-
-gcj/libgcj-config.h: gcj/stamp-h2
- @if test ! -f $@; then \
- rm -f gcj/stamp-h2; \
- $(MAKE) gcj/stamp-h2; \
- else :; fi
-gcj/stamp-h2: $(srcdir)/gcj/libgcj-config.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=gcj/libgcj-config.h \
- $(SHELL) ./config.status
- @echo timestamp > gcj/stamp-h2 2> /dev/null
-$(srcdir)/gcj/libgcj-config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/gcj/stamp-h2.in
- @if test ! -f $@; then \
- rm -f $(srcdir)/gcj/stamp-h2.in; \
- $(MAKE) $(srcdir)/gcj/stamp-h2.in; \
- else :; fi
-$(srcdir)/gcj/stamp-h2.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
- cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/gcj/stamp-h2.in 2> /dev/null
-
-mostlyclean-hdr:
-
-clean-hdr:
-
-distclean-hdr:
- -rm -f include/config.h gcj/libgcj-config.h
-
-maintainer-clean-hdr:
libgcj.spec: $(top_builddir)/config.status libgcj.spec.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
libgcj-test.spec: $(top_builddir)/config.status libgcj-test.spec.in
@@ -3194,32 +3154,29 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLTLIBRARIES \
- mostlyclean-compile mostlyclean-libtool \
- mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
- mostlyclean-tags mostlyclean-depend mostlyclean-generic
+mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
+ mostlyclean-libtool mostlyclean-binPROGRAMS \
+ mostlyclean-noinstPROGRAMS mostlyclean-tags \
+ mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
-clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \
- clean-libtool clean-binPROGRAMS clean-noinstPROGRAMS \
- clean-tags clean-depend clean-generic mostlyclean-am \
- clean-local
+clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \
+ clean-binPROGRAMS clean-noinstPROGRAMS clean-tags \
+ clean-depend clean-generic mostlyclean-am clean-local
clean: clean-recursive
-distclean-am: distclean-hdr distclean-toolexeclibLTLIBRARIES \
- distclean-compile distclean-libtool \
- distclean-binPROGRAMS distclean-noinstPROGRAMS \
- distclean-tags distclean-depend distclean-generic \
- clean-am
+distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \
+ distclean-libtool distclean-binPROGRAMS \
+ distclean-noinstPROGRAMS distclean-tags \
+ distclean-depend distclean-generic clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
-maintainer-clean-am: maintainer-clean-hdr \
- maintainer-clean-toolexeclibLTLIBRARIES \
+maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-binPROGRAMS \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
@@ -3231,9 +3188,9 @@ maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
-clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
+.PHONY: mostlyclean-toolexeclibLTLIBRARIES \
+distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \
+maintainer-clean-toolexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
@@ -3266,22 +3223,12 @@ install-exec-hook:
$(LN_S) libgcjx.la gnu-awt-xlib.la; \
fi
-$(built_java_source_files:.java=.class): libgcj-@gcc_version@.jar
-$(java_source_files:.java=.class): libgcj-@gcc_version@.jar
+.java.class:
+ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) \
+ -d $(here) $<
-$(x_java_source_files:.java=.class): libgcj-@gcc_version@.jar
-
-libgcj-@gcc_version@.jar: $(built_java_source_files) $(java_source_files) $(x_java_source_files)
- @: $(shell echo Creating list of files to compile...) $(shell rm -f tmp-list || :) $(shell touch tmp-list) $(foreach source,$?,$(shell echo $(source) >> tmp-list))
- @set fnord $(MAKEFLAGS); amf=$$2; fail=no; \
- javac="$(JAVAC)"; \
- cat tmp-list | (while read f; do \
- echo $$javac $(JCFLAGS) -classpath \'\' -bootclasspath $(here):$(srcdir) -d $(here) $$f; \
- $$javac $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) $$f \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes ;; *) exit 1;; esac; \
- done; \
- test "$$fail" = no)
- -@rm -f tmp-list libgcj-@gcc_version@.jar
+libgcj-@gcc_version@.jar: $(all_java_class_files)
+ -@rm -f libgcj-@gcc_version@.jar
find java gnu javax org -type d -o -type f -name '*.class' | \
sed -e '/\/\./d' -e '/\/xlib/d' | \
$(ZIP) cfM0E@ $@