This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
java parallel make patch
- To: gcc-patches at gcc dot gnu dot org
- Subject: java parallel make patch
- From: Mike Stump <mrs at windriver dot com>
- Date: Wed, 30 Aug 2000 17:31:50 -0700 (PDT)
> From: Mike Stump <mrs@windriver.com>
> Date: Wed, 30 Aug 2000 16:40:31 -0700 (PDT)
> To: gcc@gcc.gnu.org
> The java makefile isn't parallel safe. :-(
> Multiple lines of the form:
> foo: foo.c bar.c blee.c
> cd java; $(MAKE) bla bla
> are not safe, when those lines use the same .o files between them, and
> the .o files are not listed as dependencies. Either the .o files have
> to be listed, and buildable at that outer level, or you have to have a
> make all type of rule. C++ uses the make all type of rule, as there
> is only one thing to build.
I wasn't going to use $@ as it wasn't portable last I checked, then I
found it was used through out the makefile, so, I used it as it more
closely matches the old makefile.
I don't know if this is the best way to solve the problem, I decided
to retain as much of the original semantics and style as possible.
I did a bootstrap, and it does work better with -j5 (-j5 is the
fastest wallclock option on my uniprocessor Sun box).
I thought about just checking this in, as obviously correct and safe,
but, could someone give a second eye to this and approve it? Things
to watch for, style, ordering, obscure make semantics... :-)
* Make-lang.in (jc1$(exeext), gcjh$(exeext), jv-scan$(exeext), jcf-dump$(exeext)):
Make parallel safe.
Doing diffs in .:
*** java/Make-lang.in.~1~ Wed Aug 9 18:29:55 2000
--- java/Make-lang.in Wed Aug 30 16:54:43 2000
*************** JAVA_SRCS = $(srcdir)/java/parse.y $(src
*** 77,85 ****
$(srcdir)/java/check-init.c $(srcdir)/java/lex.c $(srcdir)/java/boehm.c \
$(srcdir)/java/jcf-depend.c $(srcdir)/java/jcf-path.c
- jc1$(exeext): $(P) $(JAVA_SRCS) $(LIBDEPS) $(BACKEND) ggc-callbacks.o
- cd java; $(MAKE) $(LANG_FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jc1$(exeext)
-
jvspec.o: $(srcdir)/java/jvspec.c system.h $(GCC_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
$(INCLUDES) $(srcdir)/java/jvspec.c
--- 77,82 ----
*************** GCJH_SOURCES = $(srcdir)/java/gjavah.c $
*** 107,115 ****
$(srcdir)/java/javaop.def $(srcdir)/java/jcf-depend.c \
$(srcdir)/java/jcf-path.c
- gcjh$(exeext): $(GCJH_SOURCES) $(LIBDEPS) $(TREE_H)
- cd java && $(MAKE) $(LANG_FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../gcjh$(exeext)
-
$(INTL_TARGETS): $(srcdir)/java/parse.c $(srcdir)/java/parse-scan.c
# Separating PARSE_DIR from PARSE_RELDIR lets us easily change the
--- 104,109 ----
*************** $(PARSE_SCAN_C): $(srcdir)/java/parse-s
*** 138,153 ****
JV_SCAN_SOURCES = $(srcdir)/java/parse-scan.y $(srcdir)/java/lex.c \
$(srcdir)/java/parse.h $(srcdir)/java/lex.h $(srcdir)/java/jv-scan.c
- jv-scan$(exeext): $(JV_SCAN_SOURCES) $(BACKEND) $(LIBDEPS)
- cd java && $(MAKE) $(LANG_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 $(TREE_H)
! jcf-dump$(exeext): $(JCF_DUMP_SOURCES)
! cd java && $(MAKE) $(LANG_FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jcf-dump$(exeext)
!
#
# Build hooks:
--- 132,150 ----
JV_SCAN_SOURCES = $(srcdir)/java/parse-scan.y $(srcdir)/java/lex.c \
$(srcdir)/java/parse.h $(srcdir)/java/lex.h $(srcdir)/java/jv-scan.c
# 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 $(TREE_H)
! jc1$(exeext) gcjh$(exeext) jv-scan$(exeext) jcf-dump$(exeext): $(P) $(JAVA_SRCS) $(LIBDEPS) $(BACKEND) ggc-callbacks.o \
! $(GCJH_SOURCES) $(LIBDEPS) $(TREE_H) \
! $(JV_SCAN_SOURCES) $(BACKEND) $(LIBDEPS) \
! $(JCF_DUMP_SOURCES)
! cd java; $(MAKE) $(LANG_FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../$@
! # cd java; $(MAKE) $(LANG_FLAGS_TO_PASS) $(JAVA_FLAGS_TO_PASS) ../jc1$(exeext) \
! # ../gcjh$(exeext) \
! # ../jv-scan$(exeext) \
! # ../jcf-dump$(exeext)
#
# Build hooks:
--------------