Hi community, I managed to do out-of-source build.
I use `CPPFLAGS += -MMD -MP` to generate `.d` files. The `.d` files and the source files are not in the same directory now. `make` addes path the the target `.o` part, but not the prerequisites parts `.c`, `.h`. So, the rules in `.d` files will not take effect. Now, If I `touch` my `.h` files, it will not re-build the source files. Is there a way to inform `make` to add path to the prerequisites too? Thanks $ cat build/build/foo/foo.d /home/ljh/Documents/make/src/build/build/foo/foo.o: foo.c foo.h foo.h: $ $ tree --charset C . |-- build | `-- build | |-- foo | | |-- foo | | |-- foo.d | | |-- foo.o | | `-- libfoo.so | `-- main | |-- main | |-- main.d | `-- main.o |-- foo | |-- foo.c | |-- foo.h | `-- Makefile |-- main | |-- main.c | `-- Makefile `-- Makefile $