Re: About make manual 11.3 a(m) syntax in prerequisite

2024-12-27 Thread lijh8
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 $ 

About make manual 11.3 a(m) syntax in prerequisite

2024-12-27 Thread lijh8
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

About recipes cleanup 6.14 and 10.2

2024-12-29 Thread lijh8
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

Re: About make manual 11.3 archive(member) syntax a(m) in prerequisite

2025-01-01 Thread lijh8
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

Re: About make manual 11.3 archive(member) syntax a(m) in prerequisite

2024-12-30 Thread lijh8
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.