# 'make install clean' doesn't work for /usr/src



## kenorb (Nov 15, 2010)

In same examples people do: 'make install clean' to make the source, install and clean it.
It does work for ports, but it doesn't work for /usr/src


```
> cd /usr/src
> sudo make clean install
===> etc/sendmail (clean)
rm -f freebsd.cf freebsd.submit.cf
===> share/info (install)
===> lib (install)
===> lib/csu/amd64 (install)
install -o root -g wheel -m 444  crt1.o crti.o crtn.o Scrt1.o gcrt1.o /usr/lib
install: crt1.o: No such file or directory
*** Error code 71

Stop in /usr/src/lib/csu/amd64.
*** Error code 1
> sudo make install clean
===> share/info (install)
===> lib (install)
===> lib/csu/amd64 (install)
install -o root -g wheel -m 444  crt1.o crti.o crtn.o Scrt1.o gcrt1.o /usr/lib
install: crt1.o: No such file or directory
*** Error code 71

Stop in /usr/src/lib/csu/amd64.
*** Error code 1
```
Only:

```
> sudo make && make install clean
```
Does work.

Why it does work for ports and doesn't for /usr/src ?


----------



## SirDice (Nov 15, 2010)

`# make install` isn't the correct way to install the kernel or the base.

Handbook: 24.7 Rebuilding â€œworldâ€

"install" is not a valid make target when building /usr/src.


----------



## DutchDaemon (Nov 15, 2010)

You would normally look in a Makefile for available targets.


----------



## eye (Nov 15, 2010)

*install* target in /usr/src doesn't recursively depend on *all* target unlike in /usr/ports

Below command have more chance to succeed
`$ make all install`


----------



## kenorb (Nov 15, 2010)

eye said:
			
		

> *install* target in /usr/src doesn't recursively depend on *all* target unlike in /usr/ports
> 
> Below command have more chance to succeed
> `$ make all install`



Thank you. That kind of answer I was expecting.
I didn't know about 'all'.

I don't like to run 4 commands

```
sudo make clean && sudo make && sudo make install && sudo make clean
```
if I could run only one:

```
sudo make clean all install clean
```


----------



## DutchDaemon (Nov 15, 2010)

Don't make [sic] up your own make targets for the source tree. They're well defined, and prescribed. Look in The Handbook and in /usr/src/Makefile. Targets like buildworld, buildkernel, installworld, installkernel are there for a reason, and they require a certain order. Unless you want to start a whole new string of topics with weird error messages no one else is getting again .. Anyway: closed; further discussion serves no purpose.


----------

