Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757222AbXFLXkv (ORCPT ); Tue, 12 Jun 2007 19:40:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754679AbXFLXjv (ORCPT ); Tue, 12 Jun 2007 19:39:51 -0400 Received: from raven.upol.cz ([158.194.120.4]:41894 "EHLO raven.upol.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753407AbXFLXjs (ORCPT ); Tue, 12 Jun 2007 19:39:48 -0400 Message-Id: <20070612234558.782193000@flower.upol.cz> References: <20070612233650.486224000@flower.upol.cz> Organization: Palacky University in Olomouc, experimental physics department. User-Agent: quilt + emacs + jed (x86_64-pc-linux-glibc-debian) X-Mailer: formail(procmail) Date: Wed, 13 Jun 2007 01:36:52 +0200 From: Oleg Verych To: Sam Ravnborg , Rusty Russell Cc: LKML , kbuild-devel@lists.sourceforge.net Subject: [patch 02/03] kbuild, asm-values: successor of asm-offsets Content-Disposition: inline; filename=kbuild-asm-values-successor-of-asm-offsets.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Some asm-offsets files define not only offsets, thus make it clear. Legacy files are supported, but may be freely changed to new scheme. rfc-by: Oleg Verych --- If somebody agrees, of course. Kbuild | 68 ++++++++++++++++++++------------------------------------------- 1 file changed, 24 insertions(+), 44 deletions(-) Index: linux-2.6.22-rc4-mm2/Kbuild =================================================================== --- linux-2.6.22-rc4-mm2.orig/Kbuild 2007-06-13 01:25:27.696264750 +0200 +++ linux-2.6.22-rc4-mm2/Kbuild 2007-06-13 01:28:10.306427250 +0200 @@ -1,60 +1,40 @@ # -# Kbuild for top-level directory of the kernel -# This file takes care of the following: -# 1) Generate asm-offsets.h -# 2) Check for missing system calls - -##### -# 1) Generate asm-offsets.h +# Kbuild for top-level directory of the Linux # +# 1) Generate (if needed) asm-values.h (former asm-offsets) for ARCH +# 2) Check for missing system calls -offsets-file := include/asm-$(ARCH)/asm-offsets.h +#### +# 1) -always := $(offsets-file) -targets := $(offsets-file) -targets += arch/$(ARCH)/kernel/asm-offsets.s -clean-files := $(addprefix $(objtree)/,$(targets)) - -# Default sed regexp - multiline due to syntax constraints -define sed-y - "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" -endef -# Override default regexp for specific architectures -sed-$(CONFIG_MIPS) := "/^@@@/{s/^@@@//; s/ \#.*\$$//; p;}" - -quiet_cmd_offsets = GEN $@ -define cmd_offsets - (set -e; \ - echo "#ifndef __ASM_OFFSETS_H__"; \ - echo "#define __ASM_OFFSETS_H__"; \ - echo "/*"; \ - echo " * DO NOT MODIFY."; \ - echo " *"; \ - echo " * This file was generated by Kbuild"; \ - echo " *"; \ - echo " */"; \ - echo ""; \ - sed -ne $(sed-y) $<; \ - echo ""; \ - echo "#endif" ) > $@ -endef +# legacy asm-offsets support (FIXME: convert all archs and remove this) +old = $(shell test -e $(srctree)/arch/$(ARCH)/kernel/asm-offsets.c && echo yes) +ifeq ($(old),yes) + asm-values =asm-offsets +else + asm-values =asm-values +endif +asm-values_c := $(src)/arch/$(ARCH)/kernel/$(asm-values).c +asm-values_h := $(obj)/include/asm-$(ARCH)/$(asm-values).h +asm-values := $(obj)/arch/$(ARCH)/kernel/$(asm-values).s +include $(srctree)/scripts/Makefile.asm -# We use internal kbuild rules to avoid the "is up to date" message from make -arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE +$(asm-values): $(asm-values_c) FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cc_s_c) -$(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild +$(asm-values_h): $(asm-values) Kbuild $(Q)mkdir -p $(dir $@) - $(call cmd,offsets) + $(call cmd,mkasm-values,$(ARCH)) -##### -# 2) Check for missing system calls -# +#### +# 2) quiet_cmd_syscalls = CALL $< cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) -PHONY += missing-syscalls missing-syscalls: scripts/checksyscalls.sh FORCE $(call cmd,syscalls) + +PHONY += missing-syscalls +.PHONY: $(PHONY) --