From sam@ravnborg.org Thu Mar 6 12:59:38 2008 Date: Thu, 6 Mar 2008 22:00:05 +0100 From: Sam Ravnborg To: Christoph Lameter Cc: Andrew Morton , ak@suse.de, Mel Gorman , apw@shadowen.org, KAMEZAWA Hiroyuki , KOSAKI Motohiro , Rik van Riel , linux-mm@kvack.org Subject: Re: [patch 2/8] Kbuild: Create a way to create preprocessor constants from C expressions On Thu, Mar 06, 2008 at 12:20:17PM -0800, Christoph Lameter wrote: > On Wed, 5 Mar 2008, Andrew Morton wrote: > > > > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > > > +++ linux-2.6/include/linux/bounds.h 2008-02-29 19:29:50.000000000 -0800 > > > @@ -0,0 +1,10 @@ > > > +#ifndef __LINUX_BOUNDS_H__ > > > +#define __LINUX_BOUNDS_H__ > > > +/* > > > + * DO NOT MODIFY. > > > + * > > > + * This file was generated by Kbuild > > > + * > > > + */ > > > + > > > +#endif > > > > a) I'm not sure that we should check in a file which is supposed to get > > overwritten at build-time. > > Well but it needs to be present in order to generate it. If the > definitions are not present then the new values of the constants cannot be > determined. A .config determined the value of these. Ehh - the file above is empty. I do not understand why we need an empty file to be present??? > > > b) Is this `make O=' friendly? > > These are just symbol definitions. Should be handled the > same way as arch/x86/*/asm-offsets.* stuff > > > c) > > make mrproper > > make allmodconfig > > make > > > > In file included from include/linux/mm.h:192, > > from include/linux/suspend.h:11, > > from arch/x86/kernel/asm-offsets_64.c:12, > > from arch/x86/kernel/asm-offsets.c:4: > > include/linux/page-flags.h:10:26: error: linux/bounds.h: No such file or directory > So asm-offset need bounds.h. We better tell make so - updated patch below. Sam --- Kbuild | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Index: linux-2.6.25-rc3-mm1/Kbuild =================================================================== --- linux-2.6.25-rc3-mm1.orig/Kbuild 2008-03-06 12:25:59.579255627 -0800 +++ linux-2.6.25-rc3-mm1/Kbuild 2008-03-06 14:26:32.360184124 -0800 @@ -58,7 +58,8 @@ define cmd_bounds endef # We use internal kbuild rules to avoid the "is up to date" message from make -arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c FORCE +arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ + $(obj)/$(bounds-file) FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cc_s_c) @@ -76,7 +77,7 @@ $(obj)/$(bounds): kernel/bounds.s Kbuild $(call cmd,bounds) ##### -# 2) Check for missing system calls +# 3) Check for missing system calls # quiet_cmd_syscalls = CALL $< @@ -85,3 +86,7 @@ quiet_cmd_syscalls = CALL $< PHONY += missing-syscalls missing-syscalls: scripts/checksyscalls.sh FORCE $(call cmd,syscalls) + +# Delete all targets during make clean +clean-files := $(addprefix $(objtree)/,$(targets)) +