Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Jun 1996 19:27:04 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-current@freebsd.org, jhay@mikom.csir.co.za
Subject:   Re: make clean in src/lkm problems
Message-ID:  <199606290927.TAA32420@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Well somehow I got the .o and vnode_if.c and vnode_if.h files in my
>src/lkm/*/ directories and not in the obj dir. I have tried all
>the normal ways (make clean, make cleandir) to get rid of them so that
>they can be created in /usr/obj, but to no avail. I even deleted /usr/obj

This is just a bug in the nesting of the target in *.mk.  bsd.kmod.mk
doesn't have its own clean target.  It gets a bad one (depending on
_SUBDIR but not on cleanfiles) by including bsd.dep.mk before including
bsd.obj.mk.  This breaks cleaning in all lkm directories, independent of
the existence and location of the obj directories.

All the other top level bsd.*.mk files avoid this problem by having their
own `clean' target.  The `clean' target in the included files are rarely if
ever used.

Quick fix: add a `clean' target to bsd.kmod.mk.

Complete fix: either remove `clean' targets from included files, or
define them in only one included file, or use use `clean::' instead of
`clean:' to allow the rules to accumulate.  The current method of
defining `clean' targets in included files if the target doesn't already
exist just breaks things if the files are included in an unfortunate
order.

>thinking that if make don't find it, it will work in the src directory.
>At the end I found a target "cleanfiles" which works if you are in a
>specific directory eg. /usr/src/lkm/msdos, but you can't call it from
>src, ot src/lkm.

`cleanfiles' doesn't depend on _SUBDIR so it doesn't support recursion.
Grepping for `clean' in *.mk shows several inconsistencies involving
_SUBDIR.  This is because some of the targets weren't intended for
direct use.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606290927.TAA32420>