This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Another paralell make patch for libf2c


Dave Love wrote:
> This seems to me to DTRT for the makefile.  Anyone disagree?  I've
> tested it (painfully) with bootstraps on Irix6 with and without
> --disable-multilib and on SunOS4 with a default configure.  The change
> just makes sure that the old top-level target gets run cleanly as is
> and for multilibs.

I just tested it on OpenServer in both default and --disable-multilib
modes.  I removed all the libf2c object trees before rnning the tests.
I ran the makes on a uniprocessor box with '-j50' just on the hopes of
tormenting make into doing something out of order.

	make check-g77 RUNTESTFLAGS='--target_board unix{-mcoff,-fpic,-melf}' 
and 
	make check-g77 

do the right things in their respective trees.  All 1776 tests passed.
(They wouldn't if the multilibbing did the wrong thing.)  So it still
works for me.

> Do the comments now make it clearer what's going on?  What isn't
> clear?

They help a lot.  Now I sure am glad I didn't submit my original patch
becuase I see it would be very wrong for your world.

> [I still can't claim to understand the rationale of the multilibbing
> framework, but no matter ...]

I can't say I grok the fullness of it all, either.

Thanx for the improved patch, Dave.

RJL


1998-10-08  Dave Love  <fx@gnu.org>

	* Makefile.in (.SUFFIXES): Don't use any.
	(all-unilib): New target, like old all.
	(all): Use it.
	(.PHONY): Add all-unilib.

Index: Makefile.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/libf2c/Makefile.in,v
retrieving revision 1.26
diff -p -c -r1.26 Makefile.in
*** Makefile.in	1998/10/06 20:18:21	1.26
--- Makefile.in	1998/10/08 16:16:41
*************** F2CEXT = abort derf derfc ef1asc ef1cmc 
*** 82,95 ****
  	secnds second sleep srand stat symlnk time ttynam umask unlink \
  	vxtidt vxttim alarm
  
! # These dependencies can be satisfied in parallel.  The [fiu]77
! # targets update stamp files which the $(LIBG2C) target checks in the
! # sub-make.  (Probably only one stamp file is really needed.)
! all: i77 f77 u77 s-libe77 $(LIBG2C)
! 	$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="all"
  
  i77 f77 u77: g2c.h
  
  $(LIBG2C): s-libi77 s-libf77 s-libu77 s-libe77
  	rm -f $(LIBG2C)
  	set -e; \
--- 82,133 ----
  	secnds second sleep srand stat symlnk time ttynam umask unlink \
  	vxtidt vxttim alarm
  
! .SUFFIXES:
  
+ # The logic here is partly dictated by the desire to keep the lib?77
+ # subdirs for compatibility with the Netlib version and because libU77
+ # has a different copyright; then the libe77 bit (EXTERNALly-callable
+ # versions) is funny.  Given that, as well as keeping things as simple
+ # as possible we want (at least) the following:
+ #  * Allow make to be run at the top level (all-target-libf2c), at this
+ #    level, or the subdirs of this level.  In the latter case we only
+ #    compile, rather than updating libg2c.a;
+ #  * A robust set of dependencies, so that we rebuild (as little as
+ #    possible) if a configuration file, g2c.h or any lib?77/*.c file
+ #    changes;
+ #  * Avoid unnecessary running of ar and ranlib;
+ #  * Expose parallelism where reasonable, but not as a priority.
+ 
+ # The intended top-level target here does a non-multilib build (via
+ # the dependency) and then (perhaps) builds multilibs.
+ 
+ all: all-unilib
+ 	$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO="all-unilib"
+ 
+ # `all-unilib' is the overall target in the absence of multilibs,
+ # meant to be invoked via multi-do for multilibs.
+ 
+ # Its dependencies can be satisfied in parallel.  The [fiu]77 targets
+ # update stamp files (see the subdir makefiles) which the $(LIBG2C)
+ # target checks in the sub make to decide whether to run ar/ranlib.
+ # (Probably only one stamp file is really needed.)  The stamp files
+ # s-lib[fiu]77 are intentionally not targets, since we're only meant
+ # to come in at the level of this target.  The [fiu]77 targets always
+ # invoke sub makes to check dependencies in the subdirs, else we'd
+ # have to maintain them at this level; we live with the overhead of
+ # some recursive makes which may do nothing.
+ 
+ all-unilib: i77 f77 u77 s-libe77
+ 	$(MAKE) $(FLAGS_TO_PASS) $(LIBG2C)
+ 
  i77 f77 u77: g2c.h
  
+ # This target should normally only get invoked via `all-unilib' --
+ # after all's well in the subdirs -- actually to assemble the library.
+ # The stamp file dependencies are just to check whether libg2c.a is
+ # up-to-date (to avoid running ar regardless) -- the files should
+ # always have been created by a successful `all-unilib'.
+ 
  $(LIBG2C): s-libi77 s-libf77 s-libu77 s-libe77
  	rm -f $(LIBG2C)
  	set -e; \
*************** g2c.h: g2c.hin config.status Makefile
*** 138,144 ****
  #	$(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h
  
  Makefile: Makefile.in config.status
! # Autoconf doc uses `./config.status'.  Is there a good reason to use 
  	  $(SHELL) config.status
  
  config.status: configure $(gcc_version_trigger)
--- 176,182 ----
  #	$(srcdir)/../move-if-change g2c.h g2c.x && mv g2c.x g2c.h
  
  Makefile: Makefile.in config.status
! # Autoconf doc uses `./config.status'.  Is there a good reason to use $(SHELL)?
  	  $(SHELL) config.status
  
  config.status: configure $(gcc_version_trigger)
*************** rebuilt: configure
*** 197,203 ****
  
  .PHONY: rebuilt mostlyclean clean distclean maintainer-clean all \
          i77 f77 u77 check uninstall install-strip dist \
!         installcheck installdirs
  
  subdir_do:
  	@rootpre=`pwd`/; export rootpre; \
--- 235,241 ----
  
  .PHONY: rebuilt mostlyclean clean distclean maintainer-clean all \
          i77 f77 u77 check uninstall install-strip dist \
!         installcheck installdirs all-unilib
  
  subdir_do:
  	@rootpre=`pwd`/; export rootpre; \
*************** subdir_do:
*** 214,216 ****
--- 252,255 ----
  	  else true; fi; \
  	done
  
+ # multidoings may be added here by configure.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]