2002-09-08 01:45:57

by D. Hugh Redelmeier

[permalink] [raw]
Subject: clean before or after dep?

I'm having a problem building a Red Hat kernel
(kernel-source-2.4.18-10).

It looks a lot like:
<http://www.van-dijk.net/linuxkernel/200223/0349.html>

The error message is:
make[4]: *** No rule to make target `/usr/src/linux-2.4.18-10/drivers/pci/devlist.h', needed by `names.o'. Stop.

The fix proposed in <http://www.van-dijk.net/linuxkernel/200223/0432.html>
is to reverse the order of clean and dep:

a kind soul pointed out that I should do:

make clean dep
make bzimage

instead. Works. Learned a new trick :-)

Now this seems to contradict
<http://www.tldp.org/HOWTO/Kernel-HOWTO-2.html#ss2.3>
which specifies, in step 5:
bash# make dep
bash# make clean

Which is the right order for clean and dep?

I've always assumed that they could be combined, as in:
bash# make dep clean
Am I wrong?

Where is this documented?

Hugh Redelmeier
[email protected] voice: +1 416 482-8253


2002-09-08 13:06:16

by Alan

[permalink] [raw]
Subject: Re: clean before or after dep?

> Now this seems to contradict
> <http://www.tldp.org/HOWTO/Kernel-HOWTO-2.html#ss2.3>
> which specifies, in step 5:
> bash# make dep
> bash# make clean
>
> Which is the right order for clean and dep?

The "kernel-howto" has been badly broken for years. The world would
actually be better without that document IMHO

2002-09-08 13:26:45

by Joe Kellner

[permalink] [raw]
Subject: Re: clean before or after dep?

Quoting Alan Cox <[email protected]>:

>
> The "kernel-howto" has been badly broken for years. The world would
> actually be better without that document IMHO
>


Currently, what is the proper way then? I know over the years the proper
procedure has changed. make *config; make dep; make clean; make *Image;make
modules?

-------------------------------------------------
sent via KingsMeade secure webmail http://www.kingsmeadefarm.com

2002-09-08 13:48:26

by Dave Gilbert (Home)

[permalink] [raw]
Subject: Re: clean before or after dep?

* Joe Kellner ([email protected]) wrote:

> Currently, what is the proper way then? I know over the years the proper
> procedure has changed. make *config; make dep; make clean; make *Image;make
> modules?

I always do

make clean && make dep && make ......

Notes:
1) I've always done clean and then dep ever since a problem on Alpha
where it created a file during dep and deleted it in clean.

2) I always use && instead of ; - that way if one of the stages fails
you don't miss it.

3) The ..... - some architectures like zImage, some like Image, some
like boot; hell I can never remember which a particular platform
needs. I wish we had some commonality (hmm - an 'itso' target).

4) Generally make {menu|x}config tells you the story for x86 at the
end.

Dave
---------------- Have a happy GNU millennium! ----------------------
/ Dr. David Alan Gilbert | Running GNU/Linux on Alpha,68K| Happy \
\ gro.gilbert @ treblig.org | MIPS,x86,ARM, SPARC and HP-PA | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/

2002-09-08 14:37:17

by Sam Ravnborg

[permalink] [raw]
Subject: Re: clean before or after dep?

README located in the top-level directory specify:
make config
make clean
make dep

Which is the logical order if you ask me.

On Sun, Sep 08, 2002 at 02:13:02PM +0100, Alan Cox wrote:
> The "kernel-howto" has been badly broken for years. The world would
> actually be better without that document IMHO

What about a small HOWTO located in Documentation/ that include a note
that the LDP HOWTO is outdated?

Sam

2002-09-08 18:02:04

by Thomas Molina

[permalink] [raw]
Subject: Re: clean before or after dep?

On Sun, 8 Sep 2002, Sam Ravnborg wrote:

> README located in the top-level directory specify:
> make config
> make clean
> make dep
>
> Which is the logical order if you ask me.
>
> On Sun, Sep 08, 2002 at 02:13:02PM +0100, Alan Cox wrote:
> > The "kernel-howto" has been badly broken for years. The world would
> > actually be better without that document IMHO
>
> What about a small HOWTO located in Documentation/ that include a note
> that the LDP HOWTO is outdated?

I can't find the make clean in the top-level directory mentioned above.
Is the make clean even needed? I'm not doing a make clean when I rebuild
kernels; am I making a big booboo?

I'm willing to rewrite the HOWTO, or create a new one if needed.

2002-09-08 18:03:04

by D. Hugh Redelmeier

[permalink] [raw]
Subject: Re: clean before or after dep?

| From: Alan Cox <[email protected]>

| > Which is the right order for clean and dep?
|
| The "kernel-howto" has been badly broken for years. The world would
| actually be better without that document IMHO

OK, but then where is the right documentation?

The top level README mentions "clean" only one place, and it is not
relevant.

The top level Makefile does not explain the semantics and constraints of
the targets in question.

A grep through Documentation leads to apparent contradictions (this is
from Red Hat LINUX 7.3's linux-2.4.18-10 source):

Files suggesting dep ; clean:

Documentation/DocBook/sis900.tmpl:476:make clean
Documentation/cdrom/cm206:59: make dep; make clean; make zImage; make modules
Documentation/filesystems/devfs/README:713:make xconfig) and then make dep; make clean and then
Documentation/filesystems/devfs/README:1546:Forgetting to run make dep; make clean after changing the
Documentation/kbuild/bug-list.txt:13: on, do a 'make dep' followed by 'make clean' before you try anything
Documentation/modules.txt:27: make clean
Documentation/networking/arcnet.txt:112: make clean
Documentation/networking/arcnet.txt:191: make clean
Documentation/networking/sis900.txt:220:make clean
Documentation/smp.txt:18: time -v sh -c 'make dep ; make clean install modules modules_install'
Documentation/telephony/ixj.txt:366: 4. make dep;make clean;make bzImage;make modules;make modules_install


Files suggesting clean ; dep:

Documentation/isdn/README.HiSax:486: make clean; make dep; make zImage; make modules; make modules_install
Documentation/moxa-smartio:256: b. make clean /* take a few minutes */
Documentation/networking/DLINK.txt:95: # make clean


What are the ordering constraints on mrproper, clean, dep, and
*config? I'd like to characterise all sequences that properly prepare
for a kernel build.

What these targets do, according to README:

mrproper: removes stale .o files and dependencies lying around
clean: ? seems to remove files built by the build process
*config: configure the kernel [build a .config]
dep: set up dependencies

The normal sequence seems to be:
mrproper && *config && dep && build
I'm not sure where clean comes in this sequence. mrproper includes
clean, so this sequence will do it once. Is it needed somewhere after
the *config too?

Is it safe to combine some or all targets in one make command, eg:
make mrproper *config dep build
I've done this for some targets, but I wonder if it is safe to
have dep combined with any following targets since it computes
dependencies.

These issues come up when iteratively trying a kernel build that
fails. What kinds of changes require an mrproper? a clean? a dep?

- is it safe to do an mrproper after a *config? In other words, does
mrproper affect/damage/undo anything done by *config?

- an mrproper undoes dep, so it must be followed by a dep


- is it safe to do a clean after a *config? In other words, does clean
affect/damage/undo anything done by *config? Surely it is safe:
many of us have done this for years.

- is it necessary to do a clean after a *config? (README suggests no;
many things in Documentation suggest yes.)
One reason might be that dep requires this -- is this the case?
<http://www.van-dijk.net/linuxkernel/200223/0432.html> suggests yes.
Experience suggests no, at least until very recently.
Or is there some other way in which dep now requires that
it be preceded by a clean, perhaps after a failed build?

- is it safe to do a clean after a dep? In other words, does clean
affect/damage/undo anything done by dep?

- is it necessary to do a clean after a dep? (README suggests no;
many things in Documentation suggest yes.) Does dep affect
subsequent cleans?

- theory: a clean should be done after a failing build so that
a subsequent build won't use the results of the failing build.

Hugh Redelmeier
[email protected] voice: +1 416 482-8253

2002-09-08 18:33:48

by Sam Ravnborg

[permalink] [raw]
Subject: Re: clean before or after dep?

On Sun, Sep 08, 2002 at 02:09:00PM -0400, D. Hugh Redelmeier wrote:
> What are the ordering constraints on mrproper, clean, dep, and
> *config? I'd like to characterise all sequences that properly prepare
> for a kernel build.
Lets go through the targets in question, and their purpose:
mrproper:
mrproper removes all files generated during the build process. This
includes the final kernel, the current configuration, firmware for
drivers, host-progs used during compilation, buildversion,
the include/asm link and a few more files.
mrproper is the right choice when you are going to build a new kernel
or something weird happend during the build process.
make mrproper are needed from time to time with the 2.4 kernel, when the
kernel build system gets 'confused'.
When executing mrproper, the first step is actually a clean as described below.

clean:
Clean removes all intermidiate files generated during the build process.
make clean will force all SRC to be build because all the .o files are
deleted.
[Checking arch/i386/Makefile + arch/i386/boot/Makefile]
make clean delete the final bzImage as well, which kinf of suprised me,
I did expect that mrproper were needed to do that.

dep:
In the 2.4 kernel make dep is used to record all the dependencies.
In the 2.5 kernel it's used for much less than in 2.4 kernel.
==>You need someone more familiar than me to comment on that.

*config:
As you probarly know it is used to build the .config.
To my best knowledge make dep, make clean does not have any influence.
But make mrproper will delete the .config file.

> What these targets do, according to README:
>
> mrproper: removes stale .o files and dependencies lying around
> clean: ? seems to remove files built by the build process
> *config: configure the kernel [build a .config]
> dep: set up dependencies
>
> The normal sequence seems to be:
> mrproper && *config && dep && build
> I'm not sure where clean comes in this sequence. mrproper includes
> clean, so this sequence will do it once. Is it needed somewhere after
> the *config too?
No, if executed before that should do it.

> - is it safe to do an mrproper after a *config? In other words, does
> mrproper affect/damage/undo anything done by *config?
Yes, .config is deleted.

> - is it necessary to do a clean after a *config? (README suggests no;
> many things in Documentation suggest yes.)
> One reason might be that dep requires this -- is this the case?
> <http://www.van-dijk.net/linuxkernel/200223/0432.html> suggests yes.
> Experience suggests no, at least until very recently.
> Or is there some other way in which dep now requires that
> it be preceded by a clean, perhaps after a failed build?
With the 2.5 kernel, if make clean or make mrproper is ever _required_
I would say you had triggered an error in the kernel build system.

> - theory: a clean should be done after a failing build so that
> a subsequent build won't use the results of the failing build.
Should not be needed with the build system in the 2.5 kernel.

Sam

2002-09-08 18:43:20

by jbradford

[permalink] [raw]
Subject: Re: clean before or after dep?

> Lets go through the targets in question, and their purpose:
> mrproper:
> mrproper removes all files generated during the build process. This
> includes the final kernel, the current configuration, firmware for
> drivers, host-progs used during compilation, buildversion,
> the include/asm link and a few more files.

This used to be called distclean, right?

John.

2002-09-08 19:07:32

by Sam Ravnborg

[permalink] [raw]
Subject: Re: clean before or after dep?

On Sun, Sep 08, 2002 at 07:54:56PM +0100, [email protected] wrote:
> > Lets go through the targets in question, and their purpose:
> > mrproper:
> > mrproper removes all files generated during the build process. This
> > includes the final kernel, the current configuration, firmware for
> > drivers, host-progs used during compilation, buildversion,
> > the include/asm link and a few more files.
>
> This used to be called distclean, right?
Nope, distclean is still present.
distclean in addition to mrproper removes all editor backup files, patch
leftovers, md5 sum files, and empty files.

So three leves of cleaning.

Sam

2002-09-09 07:23:31

by Helge Hafting

[permalink] [raw]
Subject: Re: clean before or after dep?

Sam Ravnborg wrote:

> With the 2.5 kernel, if make clean or make mrproper is ever _required_
> I would say you had triggered an error in the kernel build system.
>
> > - theory: a clean should be done after a failing build so that
> > a subsequent build won't use the results of the failing build.
> Should not be needed with the build system in the 2.5 kernel.

Make clean is nice to have for a couple of occations:

1. Before making a tar.bz2 of the tree as a backup. Why
waste space on .o files?
A backup is useful for a number of reasons, such as
before testing a mix of patches that might
interferre badly. Or even patches for another version.
Getting the tree again takes time.

2. The pc hardware clock screwed up again and timestamps
are spread all over past and future :-( Make clean time.

Helge Hafting

2002-09-09 17:59:07

by Thunder from the hill

[permalink] [raw]
Subject: Re: clean before or after dep?

Hi,

On Sun, 8 Sep 2002, Dr. David Alan Gilbert wrote:
> I always do
>
> make clean && make dep && make ......

I use to do:

# make menuconfig
# make clean dep vmlinuz modules
# su -c "make modules_install"
# install-kernel.sh

Thunder
--
--./../...-/. -.--/---/..-/.-./..././.-../..-. .---/..-/.../- .-
--/../-./..-/-/./--..-- ../.----./.-../.-.. --./../...-/. -.--/---/..-
.- -/---/--/---/.-./.-./---/.--/.-.-.-
--./.-/-.../.-./.././.-../.-.-.-