3

Lets say I call:

make -j 5

Is there a way, within my Makefile to get the -j parameter ?

My goal is to call scons from a Makefile a to keep the ability to use several jobs to fasten compilation.

Something like:

# The Makefile
all:
    scons -j ${GET_J_PARAMETER}

Thank you.

Foot note: I know I should better call scons directly but some of the developers where I work have been typing make for almost ten years and it seems impossible for them to type anything else to build their libraries...

ereOn
  • 53,676
  • 39
  • 161
  • 238

1 Answers1

4

I think the MAKEFLAGS contains that information.

Read more about it here GNU Make

Section 7.3 explains how to test for a specific parameter.

Fredrik Pihl
  • 44,604
  • 7
  • 83
  • 130
  • This doesn't actually work - the j flag is special and doesn't appear completely in MAKEFLAGS. http://stackoverflow.com/questions/4778389 has more workarounds that may help. – richq May 28 '11 at 09:26