SUBDIRS = $(DIRLTDL) gcj include
endif
+# write_entries_to_file - writes each entry in a list
+# to the specified file. Each entry is written individually
+# to accomodate systems with severe command-line-length
+# limitations.
+# Parameters:
+# $(1): variable containing entries to iterate over
+# $(2): output file
+write_entries_to_file = $(shell rm -f $(2) || :) $(shell touch $(2)) $(foreach object,$(1),$(shell echo $(object) >> $(2)))
+
## ################################################################
##
$(gtk_awt_peer_sources) \
$(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)
+libgcj-@gcc_version@.jar: $(all_java_source_files)
-@rm -f libgcj-@gcc_version@.jar
+ @echo Compiling Java sourcefiles...
+ @: $(call write_entries_to_file,$?,libgcj.sourcelist)
+ $(JAVAC) $(JCFLAGS) -classpath '' -bootclasspath $(here):$(srcdir) -d $(here) @libgcj.sourcelist
## 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' | \
## Pass the list of object files to libtool in a temporary file to
## avoid tripping platform command line length limits.
libgcj.la: $(libgcj_la_OBJECTS) $(libgcj_la_DEPENDENCIES)
- @: $(shell echo Creating list of files to link...) $(shell rm -f libgcj.objectlist || :) $(shell touch libgcj.objectlist) $(foreach object,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),$(shell echo $(object) >> libgcj.objectlist))
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
$(libgcj_la_LINK) -objectlist libgcj.objectlist \
@GCLIBS@ @LIBFFI@ @ZLIBS@ \
-rpath $(toolexeclibdir) $(libgcj_la_LDFLAGS) $(LIBS)
lib-gnu-awt-xlib.la: $(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_DEPENDENCIES)
- @: $(shell echo Creating list of files to link...) $(shell rm -f lib_gnu_awt_xlib.objectlist || :) $(shell touch lib_gnu_awt_xlib.objectlist) $(foreach object,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),$(shell echo $(object) >> lib_gnu_awt_xlib.objectlist))
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(lib_gnu_awt_xlib_la_OBJECTS) $(lib_gnu_awt_xlib_la_LIBADD),lib_gnu_awt_xlib.objectlist)
$(lib_gnu_awt_xlib_la_LINK) -objectlist lib_gnu_awt_xlib.objectlist \
-rpath $(toolexeclibdir) $(lib_gnu_awt_xlib_la_LDFLAGS) $(LIBS)
$(PRE_INSTALL)
## We use a GNU make trick here so that we don't go over the command
## length limit of some shells.
- @: $(shell echo Creating list of headers to install...) $(shell rm -f tmp-ilist || :) $(shell touch tmp-ilist) $(foreach hdr,$(nat_headers) $(extra_headers),$(shell echo $(hdr) >> tmp-ilist))
+ @echo Creating list of headers to install...
+ @: $(call write_entries_to_file,$(nat_headers) $(extra_headers),tmp-ilist)
@cat tmp-ilist | while read f; do \
d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
$(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \
:; else ok=1; fi; \
done; exit $$ok
+## This rule checks whether write_entries_to_file works properly.
+write-entries-to-file-check:
+ @echo Creating list of files to link...
+ @: $(call write_entries_to_file,$(libgcj_la_OBJECTS) $(libgcj_la_LIBADD),libgcj.objectlist)
+
## ################################################################
##
## the C++ code whenever any .java file is touched.
## Also force all the class files to build first. This makes them build in
## the right order to improve performance.
-all-recursive: $(all_java_class_files) $(nat_headers) $(x_nat_headers)
+all-recursive: libgcj-@gcc_version@.jar $(nat_headers) $(x_nat_headers)
## ################################################################