From owner-freebsd-bugs Mon Dec 10 17:10:10 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 4549437B422 for ; Mon, 10 Dec 2001 17:10:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBB1A1v76003; Mon, 10 Dec 2001 17:10:01 -0800 (PST) (envelope-from gnats) Date: Mon, 10 Dec 2001 17:10:01 -0800 (PST) Message-Id: <200112110110.fBB1A1v76003@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Bruce Evans Subject: Re: kern/32671: Patch to generate usbdevs.h automatically in kernel build Reply-To: Bruce Evans Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR kern/32671; it has been noted by GNATS. From: Bruce Evans To: "Erik H. Bakke" Cc: Subject: Re: kern/32671: Patch to generate usbdevs.h automatically in kernel build Date: Tue, 11 Dec 2001 12:06:26 +1100 (EST) On Mon, 10 Dec 2001, Erik H. Bakke wrote: > >Description: > This patch will make sure usbdevs.h and usbdevs_data.h are > regenerated automatically when a kernel is built. It is > done from the depend target, so the files will be present and > updated as early as possible in the build process. > This eliminates the need for separately checked in and maintained > versions of these files. > > >How-To-Repeat: > > >Fix: > > --- kern.post.mk.bak Sun Nov 11 07:16:53 2001 > +++ kern.post.mk Mon Dec 10 14:10:39 2001 > @@ -76,7 +76,12 @@ > > ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h > > -kernel-depend: > +# This rule makes sure usbdevs.h and usbdevs_data.h are updated from > +# usbdevs > +usbdevs: > + cd ../../../dev/usb && ${MAKE} -f Makefile.usbdevs > + > +kernel-depend: usbdevs > .if defined(EXTRA_KERNELDEP) > ${EXTRA_KERNELDEP} > .endif Er, this clobbers the src tree at kernel build time and has other problems (it doesn't work unless "make depend" is run first...). Generated files need to be handled something like the *if.h files, but without the dependency bugs in that handling. Dependencies for the latter were broken by excessively zealous cleanups in sys/conf/files*, so there are only enough dependencies for things to work right if either "make depend" is run first or .depend doesn't exist (when .depend doesn't exist, the fudged dependency of all objects on all headers gives enough dependencies). In general, generated headers must be in BEFORE_DEPENDS and in all relevant places in .depend for things to work right. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message