changeset 2489:269ecd74cebe

[project @ 1996-11-08 22:39:07 by jwe] Makefile.in
author jwe
date Fri, 08 Nov 1996 22:39:07 +0000
parents d4eb39779b88
children eb3e02c0f5e2
files libcruft/ChangeLog libcruft/Makerules.in
diffstat 2 files changed, 31 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libcruft/ChangeLog
+++ b/libcruft/ChangeLog
@@ -1,5 +1,9 @@
 Fri Nov  8 09:55:40 1996  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* Makefile.in (libcruft.a): Delete target.
+	* Makerules.in, Makefile.in: Use real archive rules to build
+	libcruft.a in parts.
+
 	* Makefile.in (install): Use $(INSTALL_PROGRAM) for installing
 	shared library.
 
--- a/libcruft/Makerules.in
+++ b/libcruft/Makerules.in
@@ -2,6 +2,9 @@
 #
 # Common rules for octave's libcruft directories.
 #
+# XXX FIXME XXX -- assumes that the libcruft directory tree is only
+# one level deep.
+#
 # John W. Eaton
 # jwe@bevo.che.wisc.edu
 # University of Wisconsin-Madison
@@ -25,10 +28,32 @@
 CWD = $(shell pwd)
 THISDIR = $(notdir $(CWD))
 
-all: stamp-picdir $(CRUFT_OBJ) $(CRUFT_PICOBJ) \
-	$(SPECIAL_DEPEND) $(SPECIAL_PICDEPEND)
+LIBCRUFT = ../libcruft.a
+
+LIBCRUFT_OBJS = $(CRUFT_OBJ) $(SPECIAL_DEPEND)
+
+LIBCRUFT_DEPS = $(LIBCRUFT)($(LIBCRUFT_OBJS))
+
+all: stamp-picdir $(LIBCRUFT) $(CRUFT_PICOBJ) $(SPECIAL_PICDEPEND)
 .PHONY: all
 
+# Cancel the default action for when an archive member is out of
+# date.  Instead of inserting the out of date members individually, we
+# will insert them in batches, even if some of them are up to date.
+# This is much faster for a large archive like libcruft.a.
+
+(%) : %
+	@true
+
+$(LIBCRUFT): $(LIBCRUFT_DEPS)
+	$(AR) $(ARFLAGS) $(LIBCRUFT) $(LIBCRUFT_OBJS)
+	$(RANLIB) $(LIBCRUFT)
+
+# This is necessary, otherwise we won't have any .o files left when it
+# comes time to insert them in the archive.
+
+.PRECIOUS: $(LIBCRUFT_OBJS)
+
 stamp-picdir:
 	if [ "$(SHARED_LIBS)" = true ]; then \
 	  if [ -n "$(FPICFLAG)" ]; then \