From owner-freebsd-new-bus Thu Nov 18 19:53:15 1999 Delivered-To: freebsd-new-bus@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 9A8A115306 for ; Thu, 18 Nov 1999 19:53:10 -0800 (PST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id UAA13632; Thu, 18 Nov 1999 20:53:10 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id UAA30168; Thu, 18 Nov 1999 20:53:41 -0700 (MST) Message-Id: <199911190353.UAA30168@harmony.village.org> To: Bruce Evans Subject: Re: Makefile module cleanup Cc: new-bus@FreeBSD.ORG In-reply-to: Your message of "Thu, 18 Nov 1999 20:42:14 +1100." References: Date: Thu, 18 Nov 1999 20:53:41 -0700 From: Warner Losh Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message Bruce Evans writes: : Plan: : - repository-copy bsd.kmod.mk and bsd.kern.mk to : sys/conf/maybe-better-names.mk. I can see it now: .include "${.CURDIR}/../../conf/maybe-better-names.mk" :-) Since we're moving to a "everything is a module" approach in the kernel, wouldn't we just need bsd.module.mk? Or does the remaining husk of the kernel still need its own bsd.kernel.mk? : - arrange to find bsd.kmod.mk there using searches like the ones now in : bsd.kmod.mk (only kernel makefiles and makefiles for modules in : sys/modules can use relative paths). May need a stub bsd.kmod.mk : in the standard place. ok. That's actually one area of problem in the current scheme. There is no standard way to say "My kernel sources live here" so that the gross rules for _if.h work. No, /usr/src/sys/ isn't where my kernel sources live :-). ~imp/work/tsc/FreeBSD-tsc-3/sys happens to be the place on this machine, but others have them in even odder locations. The sources to my drivers live in ~imp/tsc-dev/drivers/{src,inc,lkm} which has little or no relationship with the kernel sources most days. : - put general rules like the one for device_if.h above in the : new bsd.kern.mk and remove them from module makefiles, kernel : makefiles, sys/conf/files and sys/${MACHINE}/conf/files.${MACHINE}. So have a .m.h rule? Cool, I like it. At the very least, we could define ${NORMAL_M2H} and ${NORMAL_M2C} (or use better names) so that the kernel makefiles go from device_if.c: $S/kern/makedevops.pl $S/kern/device_if.m perl5 $S/kern/makedevops.pl -c $S/kern/device_if.m device_if.h: $S/kern/makedevops.pl $S/kern/device_if.m perl5 $S/kern/makedevops.pl -h $S/kern/device_if.m to device_if.c: $S/kern/device_if.m ${NORMAL_M2C} device_if.h: $S/kern/device_if.m ${NORMAL_M2H} But I kinda like the more generic: PERL=perl5 MAKEDEVOPS=$S/kern/makedevops.pl NORMAL_M2H= ${PERL} ${MAKEDEVOPS} -h $< NORMAL_M2C= ${PERL} ${MAKEDEVOPS} -c $< .SUFFIXES: ${.SUFFIXES} .m .m.c: ${NORMAL_M2C} .m.h: ${NORMAL_M2H} for the bsd.module.mk, but I don't know how well make deals with two levels of indirection like this (but for modules, one wouldn't need the two levels of indirection...). : - add support to the new bsd.kmod.mk for putting *_if.h in SRCS and : CLEANFILES as required. The VFS_KLD macro handles this well for : vfs modules, but modules are probably too diverse for a generalisation : of this to work well. I think I'll try requiring module makefiles : put the required foo_if.h's in SRCS. I think that would work well because with the right .PATH directives it will find the foo_if.m. Hmmm, thinking out loud.... Maybe have a NEWBUS_H_FILES = foo_if.h bar_if.h and have, if nothing else, a SRCS += ${NEWBUS_H_FILES} as well as a .for i in ${NEWBUS_H_FILES} $i: ${i:S/.h/.m/g} $S/kern/makedevops.pl ${NORMAL_M2H} .endfor in bsd.module.mk and let the .PATH directive sort things out... Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message