summary refs log tree commit diff
path: root/Makerules
diff options
context:
space:
mode:
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules36
1 files changed, 19 insertions, 17 deletions
diff --git a/Makerules b/Makerules
index f6848b76d5..439f18d3ff 100644
--- a/Makerules
+++ b/Makerules
@@ -65,6 +65,11 @@ endif
 # Add -I switches to get the right sysdep directories.
 # `+includes' in Makeconfig references $(+sysdep-includes).
 +sysdep-includes := $(addprefix -I,$(+sysdep_dirs))
+
+# The name of the symbol table archive member.  The default is suitable for
+# BSD style archives.  It can be overridden in sysdep Makefiles when SYSV
+# style archive are used.
+ar-symtab-name = __.SYMDEF
 
 # Include any system-specific makefiles.
 
@@ -349,7 +354,7 @@ ARFLAGS := r$(verbose)
 lib: lib-noranlib $(foreach l,$(libtypes),$(patsubst %,$(common-objpfx)$l,c))
 
 # Pattern rule for libraries: depend on the __.SYMDEF member updated by ranlib.
-lib%.a: lib%.a(__.SYMDEF) ;
+lib%.a: lib%.a($(ar-symtab-name)) ;
 
 libobjs: $(foreach o,$(object-suffixes),\
 		   $(common-objpfx)$(patsubst %,$(libtype$o),c)(\
@@ -392,21 +397,18 @@ endif
 
 endif
 
-# Rules to update the __.SYMDEF member with ranlib.
-# To consolidate, each flavor library's __.SYMDEF member
-# depends on the imaginary intermediate file `symdef.SUFFIX',
-# where SUFFIX is that flavor's object suffix; then a pattern rule
-# "remakes" symdef.% depending on all the libc.a(foo.%) files in $(objects).
-$(common-objpfx)$(patsubst %,$(libtype.o),c)(__.SYMDEF): symdef.o
-$(common-objpfx)$(patsubst %,$(libtype.so),c)(__.SYMDEF): symdef.so
-$(common-objpfx)$(patsubst %,$(libtype.po),c)(__.SYMDEF): symdef.po
-$(common-objpfx)$(patsubst %,$(libtype.go),c)(__.SYMDEF): symdef.go
-symdef.%: $(foreach o,$(object-suffixes),\
-		    $(common-objpfx)$(patsubst %,$(libtype$o),c)(\
-	  $(patsubst $(objpfx)%.o,%.%,$(objects)))) \
-	  $(filter subdir_lib,$(firstword $(subdir) subdir_lib))
-# The last line above makes it also depend on subdir_lib for the parent.
-	$(RANLIB) $(common-objpfx)$(patsubst %,$(libtype.$*),c)
+# Rules to update the $(ar-symtab-name) member with ranlib,
+# one for each object flavor.
+define o-iterator-doit
+$(common-objpfx)$(patsubst %,$(libtype$o),c)($(ar-symtab-name)): \
+	  $(common-objpfx)$(patsubst %,$(libtype$o),c)(\
+	  $(patsubst $(objpfx)%.o,%$o,$(objects))) \
+	  $(filter subdir_lib,$(firstword $(subdir) subdir_lib)); \
+	$$(RANLIB) $$(common-objpfx)$$(patsubst %,$$(libtype$o),c)
+endef
+object-suffixes-left = $(object-suffixes)
+include $(o-iterator)
+
 
 # This makes all the object files.
 .PHONY: objects objs
@@ -613,7 +615,7 @@ check: tests
 
 .PHONY: TAGS
 TAGS: distinfo $(..)MakeTAGS
-	$(MAKE) $(addprefix -f ,$^)
+	$(MAKE) $(addprefix -f ,$^) $@
 
 .PHONY: echo-headers
 echo-headers: