Hi Paul,
The ar option `U` works on debian 12 unstable.
Thanks.
```
ARFLAGS = rvU
(%) : % ;
%.a : ; $(AR) $(ARFLAGS) $@ $?
libfoo.a: libfoo.a($(patsubst %.c,%.o,$(wildcard *.c)))
```
$ ar --version
GNU ar (GNU Binutils for Debian) 2.43.50.20241221
$
Hi community,
```
# gnu make 11.3 ,
# https://www.gnu.org/software/make/manual/make.html#Archive-Pitfalls ,
# Makefile
(%) : % ;
%.a : ; $(AR) $(ARFLAGS) $@ $?
# libfoo.a: libfoo.a($(patsubst %.c,%.o,$(wildcard *.c)))
libfoo.a: $(patsubst %.c,%.o,$(wildcard *.c))
```
if i do not use ` a(m) ` s
Hi community,
CFLAGS remains in recipes for linking in examples in 6.14,
this is inconsistent with 10.2.
And in 10.2, can we spell out the recipes in complete,
for example with $^ , $< , etc. , for compling and linking C programs:
$(CC) $(LDFLAGS) $^ $(LDLIBS) -o $@
$(CC) $(CFLAGS) $(CPPFL
Update.
When ARFLAGS is without U, the datetime of the object archive(member) is reset
to zero.
It renders the target being always outdated and rebuilds the target.
$ ar -tv libfoo.a
rw-r--r-- 0/0 78776 Jan 1 08:00 1970 foo.o
$
When the ARFLAGS is with U, the timestamp is kept in archiv
Thanks,
I reread the ar manpage again.
So, with the ar option U, the timestamp will be taken into account.
make needs the timestamp to tell if prerequisites are newer than target or not,
when the archive(member) syntax a(m) is used.