# [solved]No rule to make target `menuconfig

## whiteghost

i did an emerge --depclean for first time. it may have broken this.

checking another thread i have checked 

```
ls -l /usr/src/linux

```

and it was broken. now i have 

```
 # ls -l /usr/src/linux

total 0

lrwxrwxrwx 1 root root 22 Nov  7 11:23 linux-2.6.31-gentoo-r4 -> linux-2.6.31-gentoo-r4
```

looks good, but i still have this problem. i have remerged gentoo-sources.

```
cd /usr/src/linux

# make menuconfig

make: *** No rule to make target `menuconfig'.  Stop.
```

Last edited by whiteghost on Sat Nov 07, 2009 5:33 pm; edited 1 time in total

----------

## NeddySeagoon

whiteghost,

It looks like your kernel sources together with your .config have ben removed.

Emerge the sources again.

```
emerge =gentoo-sources-2.6.31-r4
```

If you have the file /proc/config.gz, you can decompress it and copy it to /usr/src/linux/.config to restore your .config

----------

## whiteghost

done.

```
#cp /home/mike/config.gz/config /usr/src/linux/.config

# make menuconfig

make: *** No rule to make target `menuconfig'.  Stop.
```

in the /linux directory is .config and linux-2.6.31-gentoo-r4.

properties of linux-2.6.31-gentoo-r4 state: 

```
link (broken) (inode/symlink)
```

   i deleted it, remerged gentoo-sources but file is there again with same properties. (broken)

i still get 

```
# ls -l /usr/src/linux

total 0

lrwxrwxrwx 1 root root 22 Nov  7 12:28 linux-2.6.31-gentoo-r4 -> linux-2.6.31-gentoo-r4

# make menuconfig

make: *** No rule to make target `menuconfig'.  Stop. 

```

what i see different than hand book is the line 'total 0'

----------

## RedSquirrel

/usr/src/linux should be a symbolic link to the kernel sources. In your output, it looks like you've made it a directory. That can be fixed, but first, please post the output of:

```
ls -l /usr/src
```

----------

## whiteghost

```
 $ ls -l /usr/src

total 12

drwxr-xr-x  2 root root 4096 Nov  7 10:41 2.6.31.5-kernel-org

drwxr-xr-x  2 root root 4096 Nov  7 12:28 linux

drwxr-xr-x 23 root root 4096 Nov  7 12:28 linux-2.6.31-gentoo-r4

```

----------

## RedSquirrel

Try (as root):

```
cd /usr/src

rm -i linux/linux-2.6.31-gentoo-r4
```

(This should ask you if you want to remove the symbolic link. Say yes.)

```
rmdir linux

ln -s linux-2.6.31-gentoo-r4 linux

```

After that, you should be able to do:

```
cd linux

make menuconfig
```

Edit: Broke up the larger code block into two sections for clarity.Last edited by RedSquirrel on Sat Nov 07, 2009 5:24 pm; edited 1 time in total

----------

## whiteghost

 *Quote:*   

> /usr/src/linux should be a symbolic link to the kernel sources. In your output, it looks like you've made it a directory. That can be fixed, but first, please post the output of:
> 
> 

 

from this thread

https://forums.gentoo.org/viewtopic-t-789320-highlight-rule+make+target+menuconfig.html

i did this  

```
rm /usr/src/linux

USE="symlink" emerge gentoo-sources
```

that did not work so i rm'd /linux again. was going to try a kernel from kernel.org so i made a new /linux directory.

```
mkdir /usr/src/linux
```

----------

## RedSquirrel

 *whiteghost wrote:*   

> was going to try a kernel from kernel.org so i made a new /linux directory.
> 
> ```
> mkdir /usr/src/linux
> ```
> ...

 

The sources from kernel.org are available in the Portage tree as vanilla-sources.

Edit:

Again, /usr/src/linux should be a symbolic link, not a directory. If you want Portage to automatically manage the /usr/src/linux symlink whenever you emerge new kernel sources, you can add the symlink USE flag setting to /etc/make.conf.Last edited by RedSquirrel on Sat Nov 07, 2009 5:35 pm; edited 1 time in total

----------

## whiteghost

 *RedSquirrel wrote:*   

> Try (as root):
> 
> ```
> cd /usr/src
> 
> ...

 

yes, that worked.

thanks RedSquirrel and NeddySeagoon

----------

## midnite

 *whiteghost wrote:*   

>  *RedSquirrel wrote:*   Try (as root):
> 
> ```
> cd /usr/src
> 
> ...

 

For unknown reasons, I was just facing the same problem.

Just want to add a note, in case someone would need it. In the 3rd line of command, it should be rm linux instead of rmdir linux.

Hope this helps : )

----------

## omnicloud

 *midnite wrote:*   

>  *whiteghost wrote:*    *RedSquirrel wrote:*   Try (as root):
> 
> ```
> cd /usr/src
> 
> ...

 

For you, since you had a symlink it was rm

For the OP who had a directory, it was rmdir

----------

