From 61394589162cfff5575cabc1fafca1eab2bdbfe5 Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Fri, 8 Oct 1999 20:30:28 +0000 Subject: [PATCH] Added a test to see if there are any archive members to be removed before calling AR_DELETE as NetBSD's & OpenBSD's versions of ar do not like removing an empty list. r=leaf --- config/rules.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/rules.mk b/config/rules.mk index 030c1e0e2a2..1df45e17d35 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -579,11 +579,14 @@ $(LIBRARY)(%.o): %.o $(LIBRARY:%.a=.%.timestamp) : @touch $@ +AR_FILES_TO_REMOVE := $(filter-out \ + $(filter %.o, $(LIBRARY)($(OBJS) $(LOBJS)) ), \ + $(shell [ -f $(LIBRARY) ] && $(AR_LIST) $(LIBRARY))) + $(LIBRARY): $(LIBRARY)($(OBJS) $(LOBJS)) $(LIBRARY:%.a=.%.timestamp) Makefile.in Makefile @touch $(LIBRARY:%.a=.%.timestamp) $(AR) $(AR_FLAGS) $(filter $filter(%.o, $^), $(shell echo *.o)) - $(AR_DELETE) $(LIBRARY) $(filter-out $(filter %.o, $^), \ - $(shell [ -f $(LIBRARY) ] && $(AR_LIST) $(LIBRARY))) + if [ "${AR_FILES_TO_REMOVE}" != "" ]; then $(AR_DELETE) $(LIBRARY) $(AR_FILES_TO_REMOVE); fi @touch $@ else