The built-in rule is very similar, but refers to $(LDLIBS).
The built-in could be used because one of $(OBJS) has a stem
which matches the target: there is a tar.o.
Quote: "An interesting feature of this makefile is that
'testpad.h' is a source file automatically created by the
'testpad' program, itself compiled from 'testpad.c'."
This "interesting" thing is done wrong. Because ./testpad
is required when the program is being built for generating
a header file, it has to be compiled with the build machine's
native compiler, not with $(CC). A distro will set CC to the
target CC, which could be an armv7 compiler, running on
an Intel machine.
Fixing that issue will get ./testpad to run; but not
If ./testpad generates values that reflect features of the
target machine environment, a host-compiled ./testpad may
not generate them correctly.
Makefiles which pull stunts like that are why people have
given up and switched to doing distro builds inside
QEMU chroot environments.
Does anyone really make executable Makefiles with
#!/usr/bin/make -f? It seems like that is being recommended,
since it is in a documented example.