mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Verych <olecom@flower.upol.cz>
To: Sam Ravnborg <sam@ravnborg.org>, Rusty Russell <rusty@rustcorp.com.au>
Cc: LKML <linux-kernel@vger.kernel.org>, kbuild-devel@lists.sourceforge.net
Subject: [patch 02/03] kbuild, asm-values: successor of asm-offsets
Date: Wed, 13 Jun 2007 01:36:52 +0200	[thread overview]
Message-ID: <20070612234558.782193000@flower.upol.cz> (raw)
In-Reply-To: <20070612233650.486224000@flower.upol.cz>

[-- Attachment #1: kbuild-asm-values-successor-of-asm-offsets.patch --]
[-- Type: text/plain, Size: 3035 bytes --]

	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)

--


  parent reply	other threads:[~2007-06-12 23:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-12 23:36 [patch 00/03] kbuild, asm-values: not only offsets, not only for $ARCH Oleg Verych
2007-06-12 23:36 ` [patch 01/03] kbuild, asm-values: infrastructure Oleg Verych
2007-06-14  7:41   ` Oleg Verych
2007-06-14  9:12     ` Sam Ravnborg
2007-06-14 11:16       ` Need opinions on asm-offsets cleanup (Re: [patch 01/03] kbuild, asm-values: infrastructure) Oleg Verych
2007-06-14 11:23         ` Sam Ravnborg
2007-09-16 18:29   ` [patch 01/03] kbuild, asm-values: infrastructure Sam Ravnborg
2007-09-16 19:32     ` Rename asm-offsets tool or not? (Re: [patch 01/03] kbuild, asm-values: infrastructure) Oleg Verych
2007-09-16 20:12       ` Sam Ravnborg
2007-06-12 23:36 ` Oleg Verych [this message]
2007-06-13  8:55   ` Removing of dummy asm-offset files (Re: [patch 02/03] kbuild, asm-values: successor of asm-offsets) Oleg Verych
2007-06-12 23:36 ` [patch 03/03] kbuild, asm-values: private for lguest Oleg Verych

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070612234558.782193000@flower.upol.cz \
    --to=olecom@flower.upol.cz \
    --cc=kbuild-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®