aboutsummaryrefslogtreecommitdiffstats
path: root/Kbuild
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.(none)>2005-09-09 13:28:28 -0400
committerSam Ravnborg <sam@mars.(none)>2005-09-09 13:28:28 -0400
commit86feeaa8120bb1b0ab21efed49e9754039395ef1 (patch)
tree548ab411f20c74b6aebb839e01b6bc938ffa41f6 /Kbuild
parent8920e8f94c44e31a73bdf923b04721e26e88cadd (diff)
kbuild: full dependency check on asm-offsets.h
Building asm-offsets.h has been moved to a seperate Kbuild file located in the top-level directory. This allow us to share the functionality across the architectures. The old rules in architecture specific Makefiles will die in subsequent patches. Furhtermore the usual kbuild dependency tracking is now used when deciding to rebuild asm-offsets.s. So we no longer risk to fail a rebuild caused by asm-offsets.c dependencies being touched. With this common rule-set we now force the same name across all architectures. Following patches will fix the rest. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Kbuild')
-rw-r--r--Kbuild41
1 files changed, 41 insertions, 0 deletions
diff --git a/Kbuild b/Kbuild
new file mode 100644
index 000000000000..197ece85034b
--- /dev/null
+++ b/Kbuild
@@ -0,0 +1,41 @@
1#
2# Kbuild for top-level directory of the kernel
3# This file takes care of the following:
4# 1) Generate asm-offsets.h
5
6#####
7# 1) Generate asm-offsets.h
8#
9
10offsets-file := include/asm-$(ARCH)/asm-offsets.h
11
12always := $(offsets-file)
13targets := $(offsets-file)
14targets += arch/$(ARCH)/kernel/asm-offsets.s
15
16quiet_cmd_offsets = GEN $@
17define cmd_offsets
18 cat $< | \
19 (set -e; \
20 echo "#ifndef __ASM_OFFSETS_H__"; \
21 echo "#define __ASM_OFFSETS_H__"; \
22 echo "/*"; \
23 echo " * DO NOT MODIFY."; \
24 echo " *"; \
25 echo " * This file was generated by $(srctree)/Kbuild"; \
26 echo " *"; \
27 echo " */"; \
28 echo ""; \
29 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
30 echo ""; \
31 echo "#endif" ) > $@
32endef
33
34# We use internal kbuild rules to avoid the "is up to date" message from make
35arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
36 $(Q)mkdir -p $(dir $@)
37 $(call if_changed_dep,cc_s_c)
38
39$(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
40 $(call cmd,offsets)
41