If you participated in your Makefiles regarding the use of the $ (COMPILETYPE) variable to reference the appropriate assembly directory in all of your rules, the rules that generate the object files, the clean / dist / etc rules, you should be fine.
In one project that I was working on, we had a variable $ (BUILD), which was set (equivalent) to build- (COMPILETYPE), which simplified the rules, because all the rules could just refer to $ (BUILD), for example, clean will be rm -rf $ (BUILD).
As long as you use $ (MAKE) to invoke sub-make (and using GNU make), you can automatically export the COMPILETYPE variable to all sub-brands without doing anything special. See the relevant section of the GNU manual for more information.
Some other options:
- Replace reassembly when the compiler flags change, adding a dependency for all objects in the metafile that tracks the last used set of compiler flags. See For example, how Git manages object files .
- If you use autoconf / automake, you can easily use a separate assembly layout collector for your different assembly types. for example,
cd /scratch/build/$COMPILETYPE && $srcdir/configure --mode=$COMPILETYPE && make , which will output the build type from Make files and into configure (where you will need to add some support to specify the necessary build flags based on the value --mode in your configure.ac )
If you give more specific examples of your real rules, you might get a few more specific suggestions.
source share