From owner-freebsd-current Sat Jun 29 02:32:19 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id CAA20970 for current-outgoing; Sat, 29 Jun 1996 02:32:19 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id CAA20963 for ; Sat, 29 Jun 1996 02:32:12 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id TAA32420; Sat, 29 Jun 1996 19:27:04 +1000 Date: Sat, 29 Jun 1996 19:27:04 +1000 From: Bruce Evans Message-Id: <199606290927.TAA32420@godzilla.zeta.org.au> To: freebsd-current@freebsd.org, jhay@mikom.csir.co.za Subject: Re: make clean in src/lkm problems Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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