2

I have defined

export MAKEOPTS="-j4"

in my ~/.profile file.

But when I do a compilation with make, this option is ignored.
I've consulted the GNU Make manual but it says nothing about this variable. Is it standard or only it works in certain distros?

1
  • Where have you seen this being used?
    – Oli
    Jan 20 '11 at 12:30
2
export MAKE="make -j4"

This will help invoking child make processes, but I'm afraid this wouldn't help with direct invocations, like just make all. Though a shell alias may help with the direct ones, so:

MAKEFLAGS="-j4"
export MAKE="make $MAKEFLAGS"
alias make="make $MAKEFLAGS"
1
  • 1
    Thanks. "MAKEFLAGS" do de job. But if I set 'export MAKE="make $MAKEFLAGS"' when I do a make, it shows this warnings: "warning: -jN forced in submake: disabling jobserver mode." Jan 20 '11 at 15:13
2

I'll be honest, before today I'd never seen MAKEOPTS.

MAKEFLAGS I know of but after some research, MAKEOPTS appears to be Gentoo- (and its children) specific.

And if it's not in the manual, it can hardly be considered standard by any stretch of the imagination.

3
  • 1
    strings /usr/bin/make | grep MAKEFLAGS shows some usage in my Ubuntu distro.
    – ulidtko
    Jan 20 '11 at 14:47
  • @ulidtko Please re-read. I wasn't doubting the existence of MAKEFLAGS. The question is about MAKEOPTS -- which can't be found in make.
    – Oli
    Jan 20 '11 at 18:19
  • you're right, I have confused MAKEOPTS in your answer. Sorry.
    – ulidtko
    Jan 20 '11 at 18:25
0

Add

MAKEOPTS="-j4"

to /etc/make.conf (create it if it doesn't already exist).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.