How to make Makefile generate all objects in a specific dir
-
wrote on 26 Jan 2019, 17:50 last edited by
Hi.
My project became quite big now, and I am trying to to re-organize all the source files in folders, and to keep the directory clean and organized.
So, I went from this kind of hier:project/file0.cpp project/file0.h project/file1.cpp project/file1.h project/file2.cpp project/file2.h project/Makefile
To this:
project/folder0/file0.cpp project/folder0/file0.h project/folder1/file1.cpp project/folder1/file1.h project/folder1/file2.cpp project/folder1/file2.h project/Makefile
So I had to re-generate the Makefile using:
$ qmake-qt4 -project $ qmake-qt4 project.pro
Now everything compiles fine, however, all the objects files are automatically generated by Makefile into my main project folder:
project/folder0/file0.cpp project/folder0/file0.h project/folder1/file1.cpp project/folder1/file1.h project/folder1/file2.cpp project/folder1/file2.h project/Makefile file0.o file1.o file2.o project
but I want the objects file to be automatically generated into a designated
bin/
directory.
How do I force qmake-qt4 to generate a Makefile that will put all objects file in a designated directory? -
wrote on 26 Jan 2019, 17:57 last edited by
- Go to you preferred output folder
- execute "qmake souce folder"
the makefile will be created in the folder were you are. After that make -j 4
or if you have a Ferrari try make -f 1000 :)
-
Hi,
Rather than forcing the output, you should rather consider out of source builds. This leaves your source tree completely clean and you can simply nuke the build folder in case of trouble.
-
That's build that don't happen in your source folder.
-
wrote on 26 Jan 2019, 20:40 last edited by
@Absurd said in How to make Makefile generate all objects in a specific dir:
but then the Makefile will be located at bin/... I want one Makefile at project/ that will put the output in bin/
Consider that you could have a output folder for amd64 binaries with them makefile, another folder for armhf with another makefile, Android, iOS ... everyone with a specific makefile.
1/7