From d2fde6871a9be7a05a1e6f1b79b1e50fb113bfa1 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 8 Jul 1996 02:40:57 +0000 Subject: (libs) [library]: Depend on add-to-librecord instead of $(targets). (install) [library]: Add dependency on add-to-librecord. (add-to-librecord) [library]: Depend on $(targets). (librecord) [MAKELEVEL == 0]: Define and export. (include librecord): New inclusion. ($(librecord)): New target. (add-to-librecord): New target. --- Makeconf | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'Makeconf') diff --git a/Makeconf b/Makeconf index 62356d2c..35a364f6 100644 --- a/Makeconf +++ b/Makeconf @@ -143,7 +143,8 @@ endif ifeq ($(makemode),library) all: libs -libs: $(targets) +install libs: add-to-librecord +add-to-librecord: $(targets) install: $(addprefix $(libdir)/,$(targets)) $(addprefix $(includedir)/$(installhdrsubdir)/,$(installhdrs)) $(libdir) $(includedir) # Arrange to have the headers installed locally anytime we build the library. @@ -258,9 +259,33 @@ relink: # Subdependencies +# We record which libraries have been built in this run in the file +# $(librecord). That file contains a series of lines like +# `../libfoo/libfoo.a ../libfoo/libfoo.so: ; /bin/true' +# that serve to inhibit the pattern rule which follows from doing anything. +# Above, when we make `libs' in library directories, we always append +# to $(librecord), so that future make invocations don't bother repeating +# the effort. + +# if this is the first level, then set librecord. Otherwise, read it in. +ifeq ($(MAKELEVEL),0) +librecord:=/tmp/hurd-make-$(shell echo $$$$) +export librecord +endif + +include $(librecord) + +# How to create it. +$(librecord): + touch $(librecord) + +# `libs' target depends on this. +add-to-librecord: + echo $(addprefix ../$(dir)/,$(targets)) : \; /bin/true >> $(librecord) + # Building libraries from other directories. We force both libraries to be # built if either is, because it will use the appropriate one even if the other -# is specified in someone's dependency list. +# is specified in someone's dependency list. ../%.a ../%.so: FORCE $(MAKE) -C $(dir $@) libs -- cgit v1.2.3