I have the following directory structure:
The content of makefile is as follows:
I have no problem building flat:
But when I try to build deep it fails:
If I then create /xxx/obj/src manually it succeeds:
According to this source bmake supports automatic creation of out-of-source OBJDIRs, but I cannot figure out how exactly.
How do I configure bmake(1) to create the relevant directories automatically, in the general case?
Thank you in advance,
YG
Code:
/xxx/obj/
/xxx/src/deep.cpp
/xxx/flat.cpp
/xxx/makefile
The content of makefile is as follows:
Code:
flat.out: flat.o
deep.out: src/deep.o
I have no problem building flat:
Code:
/xxx $ make flat.out
c++ -O2 -pipe -c /xxx/flat.cpp -o flat.o
cc -O2 -pipe flat.o -o flat.out
/xxx $ ls obj
flat.o flat.out
But when I try to build deep it fails:
Code:
/xxx $ make deep.out
c++ -O2 -pipe -c /xxx/src/deep.cpp -o src/deep.o
error: unable to open output file 'src/deep.o': 'No such file or directory'
1 error generated.
*** Error code 1
Stop.
make: stopped in /xxx
If I then create /xxx/obj/src manually it succeeds:
Code:
/xxx $ mkdir obj/src
/xxx $ make deep.out
c++ -O2 -pipe -c /xxx/src/deep.cpp -o src/deep.o
cc -O2 -pipe src/deep.o -o deep.out
/xxx $ ls obj
deep.out flat.o flat.out src
/xxx $ ls obj/src
deep.o
According to this source bmake supports automatic creation of out-of-source OBJDIRs, but I cannot figure out how exactly.
How do I configure bmake(1) to create the relevant directories automatically, in the general case?
Thank you in advance,
YG