I’ve got a simple Makefile in which one target depends on a library:
test49: test49.c -lpthread
The binary is built using the implicit rule for turning a .c file into an executable.
Problem is, I am trying to cross-compile, but make is interpreting -lpthread as pointing to /usr/lib/libpthread.so, which is quite incorrect. I have defined the path to the cross-compiler using CC=/path/to/bin/gcc, so I would assume it could figure out that -lpthread should be somewhere in /path/to/lib, but it does not.
You could replace
with