Bug 3486 - "make clean" on external driver will clean the kernel source tree, not the driver's tree
Summary: "make clean" on external driver will clean the kernel source tree, not the dr...
Status: CLOSED CODE_FIX
Alias: None
Product: Other
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Sam Ravnborg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-28 10:12 UTC by Timur Tabi
Modified: 2008-01-09 08:58 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.4-52
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Timur Tabi 2004-09-28 10:12:07 UTC
Distribution: Any 2.6-based distribution
Hardware Environment: N/A
Software Environment: N/A
Problem Description: 

The 2.6 kernel uses the new "kbuild" mechanism for building.  kbuild is really
nothing more than a fancy master Makefile that sets up a bunch of stuff, parses
the local makefile, and then does a build.  

The problem is that if I have a module that's compile outside the kernel (and
this might also happen to internal modules), it's the master makefile that
interprets the targets, not the local makefile.  This is because the make
command is issued with the -C parameter, which means all targets are passed to
the master makefile first.  

Steps to reproduce:

1) Create a driver and a makefile in a directory outside of /usr/src/linux (for
example).
2) In the directory for your driver, issue the command "make -C /usr/src/linux
SUBDIRS=$PWD clean"
3) Watch in horror as your /usr/src/linux tree gets cleaned out.
Comment 1 Natalie Protasevich 2007-11-17 21:40:30 UTC
Timur, is this still the case with recent kernel?
Thanks.
Comment 2 Sam Ravnborg 2007-11-17 22:58:47 UTC
I have tried to reproduce it in the past with no success.
But if the commanline conain mistakes suchs as:
make -C /user/src/linux SUBDIRSS=`pwd`

The we will see the behaviour Timur describers.
Likewise if the assignment is empty like in
make -C /user/src/linux SUBDIRS=`pwdd`

Timur - any chance this was what hit you.

With the external module I have around the bug
is not reproduceable.

If you still see this bug then please send me
the output of "make V=1 -C ...."
And a copy of your Makefile.

	Sam
Comment 3 Timur Tabi 2007-11-18 05:50:17 UTC
Wow, I've completely forgotten about this bug.  Unfortunately, I'm on vacation this week so I won't be able to try it out, but I'll try it next week and let you guys know.
Comment 4 Sam Ravnborg 2008-01-03 13:34:20 UTC
Hi Timur.
Any news on this?
Comment 5 Timur Tabi 2008-01-09 08:21:42 UTC
This bug is so old, that I don't do this kind of work any more.  If you can't reproduce it, then just close it.
Comment 6 Sam Ravnborg 2008-01-09 08:58:19 UTC
Closed as it cannot be reproduced.

Original submitter does not do this kind of work anymore,
and I have tried to reproduce with various setups without success.

As I asusme it is fixed some time ago resolution was set to "CODE_FIX".

/Sam

Note You need to log in before you can comment on or make changes to this bug.