xen-blkfront: don't add indirect pages to list when !feature_persistent
[linux-2.6-block.git] / Kbuild
CommitLineData
86feeaa8
SR
1#
2# Kbuild for top-level directory of the kernel
3# This file takes care of the following:
1cdf25d7
CL
4# 1) Generate bounds.h
5# 2) Generate asm-offsets.h (may need bounds.h)
6# 3) Check for missing system calls
86feeaa8 7
39664e2f
MY
8# Default sed regexp - multiline due to syntax constraints
9define sed-y
10 "/^->/{s:->#\(.*\):/* \1 */:; \
11 s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
12 s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
13 s:->::; p;}"
14endef
1cdf25d7 15
70a4fd6c
MM
16# Use filechk to avoid rebuilds when a header changes, but the resulting file
17# does not
18define filechk_offsets
1cdf25d7 19 (set -e; \
39664e2f
MY
20 echo "#ifndef $2"; \
21 echo "#define $2"; \
1cdf25d7
CL
22 echo "/*"; \
23 echo " * DO NOT MODIFY."; \
24 echo " *"; \
25 echo " * This file was generated by Kbuild"; \
1cdf25d7
CL
26 echo " */"; \
27 echo ""; \
70a4fd6c 28 sed -ne $(sed-y); \
1cdf25d7 29 echo ""; \
70a4fd6c 30 echo "#endif" )
1cdf25d7
CL
31endef
32
39664e2f
MY
33#####
34# 1) Generate bounds.h
35
36bounds-file := include/generated/bounds.h
37
38always := $(bounds-file)
8a58e162 39targets := kernel/bounds.s
39664e2f 40
1cdf25d7
CL
41# We use internal kbuild rules to avoid the "is up to date" message from make
42kernel/bounds.s: kernel/bounds.c FORCE
43 $(Q)mkdir -p $(dir $@)
44 $(call if_changed_dep,cc_s_c)
45
70a4fd6c
MM
46$(obj)/$(bounds-file): kernel/bounds.s FORCE
47 $(call filechk,offsets,__LINUX_BOUNDS_H__)
1cdf25d7
CL
48
49#####
50# 2) Generate asm-offsets.h
86feeaa8
SR
51#
52
559df2e0 53offsets-file := include/generated/asm-offsets.h
86feeaa8 54
1cdf25d7 55always += $(offsets-file)
6752ed90 56targets += arch/$(SRCARCH)/kernel/asm-offsets.s
1cdf25d7 57
86feeaa8 58# We use internal kbuild rules to avoid the "is up to date" message from make
1cdf25d7
CL
59arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
60 $(obj)/$(bounds-file) FORCE
86feeaa8
SR
61 $(Q)mkdir -p $(dir $@)
62 $(call if_changed_dep,cc_s_c)
63
70a4fd6c
MM
64$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
65 $(call filechk,offsets,__ASM_OFFSETS_H__)
86feeaa8 66
c53aeca0 67#####
1cdf25d7 68# 3) Check for missing system calls
c53aeca0
SR
69#
70
5f7efb4c
AL
71always += missing-syscalls
72targets += missing-syscalls
73
c53aeca0 74quiet_cmd_syscalls = CALL $<
44656fa0 75 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
c53aeca0 76
5f7efb4c 77missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
c53aeca0 78 $(call cmd,syscalls)
1cdf25d7 79
ef8ff89b
MM
80# Keep these two files during make clean
81no-clean-files := $(bounds-file) $(offsets-file)