ia64/linux-2.6.18-xen.hg

annotate Kbuild @ 0:831230e53067

Import 2.6.18 from kernel.org tarball.
author Ian Campbell <ian.campbell@xensource.com>
date Wed Apr 11 14:15:44 2007 +0100 (2007-04-11)
parents
children
rev   line source
ian@0 1 #
ian@0 2 # Kbuild for top-level directory of the kernel
ian@0 3 # This file takes care of the following:
ian@0 4 # 1) Generate asm-offsets.h
ian@0 5
ian@0 6 #####
ian@0 7 # 1) Generate asm-offsets.h
ian@0 8 #
ian@0 9
ian@0 10 offsets-file := include/asm-$(ARCH)/asm-offsets.h
ian@0 11
ian@0 12 always := $(offsets-file)
ian@0 13 targets := $(offsets-file)
ian@0 14 targets += arch/$(ARCH)/kernel/asm-offsets.s
ian@0 15
ian@0 16 # Default sed regexp - multiline due to syntax constraints
ian@0 17 define sed-y
ian@0 18 "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
ian@0 19 endef
ian@0 20 # Override default regexp for specific architectures
ian@0 21 sed-$(CONFIG_MIPS) := "/^@@@/{s/^@@@//; s/ \#.*\$$//; p;}"
ian@0 22
ian@0 23 quiet_cmd_offsets = GEN $@
ian@0 24 define cmd_offsets
ian@0 25 (set -e; \
ian@0 26 echo "#ifndef __ASM_OFFSETS_H__"; \
ian@0 27 echo "#define __ASM_OFFSETS_H__"; \
ian@0 28 echo "/*"; \
ian@0 29 echo " * DO NOT MODIFY."; \
ian@0 30 echo " *"; \
ian@0 31 echo " * This file was generated by $(srctree)/Kbuild"; \
ian@0 32 echo " *"; \
ian@0 33 echo " */"; \
ian@0 34 echo ""; \
ian@0 35 sed -ne $(sed-y) $<; \
ian@0 36 echo ""; \
ian@0 37 echo "#endif" ) > $@
ian@0 38 endef
ian@0 39
ian@0 40 # We use internal kbuild rules to avoid the "is up to date" message from make
ian@0 41 arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
ian@0 42 $(Q)mkdir -p $(dir $@)
ian@0 43 $(call if_changed_dep,cc_s_c)
ian@0 44
ian@0 45 $(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
ian@0 46 $(Q)mkdir -p $(dir $@)
ian@0 47 $(call cmd,offsets)
ian@0 48