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:

Qt Code:
  1. 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:

Qt Code:
  1. SUBTARGETS = \
  2. aproj
  3. bproj
  4. cproj
  5.  
  6. NOTPARALLEL:
  7.  
  8. aproj/($MAKEFILE):
  9. ........
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?