[PATCH] crc16: remove w1 specific comments.
[pandora-kernel.git] / Kbuild
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
10 offsets-file := include/asm-$(ARCH)/asm-offsets.h
11
12 always  := $(offsets-file)
13 targets := $(offsets-file)
14 targets += arch/$(ARCH)/kernel/asm-offsets.s
15
16 # Default sed regexp - multiline due to syntax constraints
17 define sed-y
18         "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
19 endef
20 # Override default regexp for specific architectures
21 sed-$(CONFIG_MIPS) := "/^@@@/s///p"
22
23 quiet_cmd_offsets = GEN     $@
24 define cmd_offsets
25         mkdir -p $(dir $@); \
26         cat $< | \
27         (set -e; \
28          echo "#ifndef __ASM_OFFSETS_H__"; \
29          echo "#define __ASM_OFFSETS_H__"; \
30          echo "/*"; \
31          echo " * DO NOT MODIFY."; \
32          echo " *"; \
33          echo " * This file was generated by $(srctree)/Kbuild"; \
34          echo " *"; \
35          echo " */"; \
36          echo ""; \
37          sed -ne $(sed-y); \
38          echo ""; \
39          echo "#endif" ) > $@
40 endef
41
42 # We use internal kbuild rules to avoid the "is up to date" message from make
43 arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
44         $(Q)mkdir -p $(dir $@)
45         $(call if_changed_dep,cc_s_c)
46
47 $(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
48         $(call cmd,offsets)
49