gcc -o abc/def.o def.c
generates def.o
file in a directory abc
; only when there exists a directory abc
.
Is there a way to make gcc to create a directory when the enclosing directory of the generated object file does not exist? If not, what could be the easiest way to make the directory in advance automatically, especially for Makefile?