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
This commit is contained in:
cls%seawood.org 1999-10-08 20:30:28 +00:00
Родитель cb0aab6dff
Коммит 6139458916
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -579,11 +579,14 @@ $(LIBRARY)(%.o): %.o
$(LIBRARY:%.a=.%.timestamp) : $(LIBRARY:%.a=.%.timestamp) :
@touch $@ @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 $(LIBRARY): $(LIBRARY)($(OBJS) $(LOBJS)) $(LIBRARY:%.a=.%.timestamp) Makefile.in Makefile
@touch $(LIBRARY:%.a=.%.timestamp) @touch $(LIBRARY:%.a=.%.timestamp)
$(AR) $(AR_FLAGS) $(filter $filter(%.o, $^), $(shell echo *.o)) $(AR) $(AR_FLAGS) $(filter $filter(%.o, $^), $(shell echo *.o))
$(AR_DELETE) $(LIBRARY) $(filter-out $(filter %.o, $^), \ if [ "${AR_FILES_TO_REMOVE}" != "" ]; then $(AR_DELETE) $(LIBRARY) $(AR_FILES_TO_REMOVE); fi
$(shell [ -f $(LIBRARY) ] && $(AR_LIST) $(LIBRARY)))
@touch $@ @touch $@
else else