I need to find a way to pass a string from QMake into the generated Makefile. I want to do this so I can control Parallel builds. I use Make from the command line, not QtCreator (don't ask why).
I have a top level project that I want to be not parallel. then have the the subdirs as parallel. I can easily do this now by using all the normal conventions for setting up the subdirs in the .pro file:
SUBDIRS = aproj bproj cproj
SUBDIRS = aproj bproj cproj
To copy to clipboard, switch view to plain text mode
then after the make file is created I add the NOTPARALLEL: entry to it:
SUBTARGETS = \
aproj
bproj
cproj
NOTPARALLEL:
aproj/($MAKEFILE):
........
SUBTARGETS = \
aproj
bproj
cproj
NOTPARALLEL:
aproj/($MAKEFILE):
........
To copy to clipboard, switch view to plain text mode
Thus the main project is serial and the subdirs build in parallel. The down side is that I have to add the NOTPARALLEL command each time I recreate the Makefile.
According to the gcc/make docs the NOTPARALLEL can be anywhere in the Makefile: "If .NOTPARALLEL is mentioned as a target, then this invocation of make will be run serially, even if the ‘-j’ option is given." So I just need to stuff it in someplace.
Any ideas?
Bookmarks