# MAKEOPTS doesn't work in make.conf



## kenorb (Nov 9, 2010)

I've added following lines into make.conf

```
MAKEOPTS="-j8"
```

But it doesn't work.

Tested on:

```
> sudo portupgrade -f mtr
```


```
> sudo portupgrade -f sl
```

Why?
It's a bug or feature?

P.S. Could find anything in: man make.conf


----------



## graudeejs (Nov 9, 2010)

make.conf(5) doesn't say anything about MAKEOPTS


----------



## SirDice (Nov 9, 2010)

kenorb said:
			
		

> Why?


Because it's a Linux option.


----------



## graudeejs (Nov 9, 2010)

SirDice said:
			
		

> Because it's a Linux option.



I thought I've heard about this option, but wasn't sure.
Now I remember, I've been using it myself on GNU/Linux Gentoo


----------



## wblock@ (Nov 9, 2010)

In FreeBSD's /etc/make.conf that would be

```
MAKE_JOBS_NUMBER=8
```

At least for ports, I don't think that affects other source.


----------



## kenorb (Nov 9, 2010)

wblock said:
			
		

> In FreeBSD's /etc/make.conf that would be
> 
> ```
> MAKE_JOBS_NUMBER=8
> ...




```
> man make.conf | less +/MAKE_JOBS_NUMBER
Pattern not found  (press RETURN)
```
Why is not documented or where it's?


----------



## SirDice (Nov 9, 2010)

kenorb said:
			
		

> Why is not documented or where it's?


Read /usr/ports/Mk/bsd.port.mk.


----------



## kenorb (Nov 9, 2010)

Following posts in this forum point to that variable:
http://forums.freebsd.org/showthread.php?p=1886#post1886
http://forums.freebsd.org/showthread.php?p=17289#post17289
http://forums.freebsd.org/showthread.php?p=96467#post96467 (it kind of works?)
http://forums.freebsd.org/showthread.php?p=100851#post100851
http://forums.freebsd.org/showthread.php?p=107599#post107599
http://forums.freebsd.org/showthread.php?p=10561#post10561 (even to MAKEOPT)

And found thousands of examples in Google.

How it's possible that it doesn't work and even that half of the people have it in make.conf?
They all are wrong?


----------



## kenorb (Nov 9, 2010)

```
# Multiple make jobs support
.if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
_MAKE_JOBS=             #
.else
.if defined(MAKE_JOBS_SAFE) || defined(FORCE_MAKE_JOBS)
MAKE_JOBS_NUMBER?=      `${SYSCTL} -n kern.smp.cpus`
_MAKE_JOBS?=            -j${MAKE_JOBS_NUMBER}
.if defined(FORCE_MAKE_JOBS) && !defined(MAKE_JOBS_SAFE)
BUILD_FAIL_MESSAGE+=    "You have chosen to use multiple make jobs (parallelization) for all ports.  This port was not tested for this setting.  Please remove FORCE_MAKE_
JOBS and retry the build before reporting the failure to the maintainer."
.endif
.endif
.endif
```
That mean you need to define MAKE_JOBS_SAFE or FORCE_MAKE_JOBS, to define MAKE_JOBS_NUMBER?


----------



## SirDice (Nov 9, 2010)

kenorb said:
			
		

> That mean you need to define MAKE_JOBS_SAFE or FORCE_MAKE_JOBS, to define MAKE_JOBS_NUMBER?


Why don't you just read the remarks?


```
##
# MAKE_JOBS_SAFE
#                               - This port can safely be built on multiple cpus in parallel.
#                                 The make will be invoked with -jX parameter where X equals
#                                 number of cores present in the system.
# MAKE_JOBS_UNSAFE
#                               - Disallow multiple jobs even when user set a global override.
#                                 To be used with known bad ports.
# DISABLE_MAKE_JOBS
#                               - Set to disable the multiple jobs feature.  User settable.
# FORCE_MAKE_JOBS
#                               - Force all ports to be built with multiple jobs, except ports
#                                 that are explicitly marked MAKE_JOBS_UNSAFE.  User settable.
# MAKE_JOBS_NUMBER
#                               - Override the number of make jobs to be used.  User settable.
```


----------



## kenorb (Nov 9, 2010)

I've added into make.conf

```
FORCE_MAKE_JOBS=yes
MAKE_JOBS_NUMBER=8
```

There is a nice make.conf:
http://www.bsdtips.org/index.php/My_make_conf


----------



## graudeejs (Nov 9, 2010)

kenorb said:
			
		

> Following posts in this forum point to that variable:
> http://forums.freebsd.org/showthread.php?p=1886#post1886
> http://forums.freebsd.org/showthread.php?p=17289#post17289
> http://forums.freebsd.org/showthread.php?p=96467#post96467 (it kind of works?)
> ...



Linuxis has deep roots


----------



## ckester (Nov 9, 2010)

killasmurf86 said:
			
		

> Linuxis has deep roots



Yep.  Linuxisms are like kudzu.

Or English Ivy, if you're a Pacific Northwesterner like me.   Forever climbing up the trunks of our trees and threatening to bring them down with all its extra weight.  You should yank it out wherever you find it!

We must all be vigilant in order to preserve our ecosystems.  Use only native plants ... and native BSD commands.


----------



## laufdi (Nov 15, 2015)

MAKE_JOBS_NUMBER and MAKE_JOBS_NUMBER_LIMIT are not obeyed. At least not in www/firefox. Why?

... apparently nowhere ...


----------

