On Fri, 2024-12-27 at 17:03 +0800, lijh8 wrote: > but if i use ` a(m) ` syntax in the prerequisites, > it rebuilds the archive even i did not change the `*.c` source files > or the `*.o` object files.
You didn't give us any indication of your operating system or distribution, or what version of ar(1) you're using. I will assume you're using a version of GNU/Linux or, at least, using the version of ar(1) provided by GNU binutils. In that case I suspect that your distribution has fallen under the sway of the "reproducible builds at all costs" cult and has set the default format of ar(1) to be "reproducible" instead of the traditional behavior of ar(1) since it was created over 50 years ago. This setting breaks make. You should file a bug report with your distribution and request that they remove the --enable-deterministic-archives option from their configuration of GNU binutils. Personally I believe adding that option as a configuration default was a mistake and the GNU binutils maintainers should remove it. In the meantime, you will have to add the "U" option to your invocation of ar(1) to disable "reproducible" archives, if you want to see the correct behavior from make when using a(m) syntax. For example: ARFLAGS := rvU -- Paul D. Smith <psm...@gnu.org> Find some GNU Make tips at: https://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist