tracing: extend sched_pi_setprio
[deliverable/linux.git] / Kbuild
1 #
2 # Kbuild for top-level directory of the kernel
3 # This file takes care of the following:
4 # 1) Generate bounds.h
5 # 2) Generate timeconst.h
6 # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
7 # 4) Check for missing system calls
8 # 5) Generate constants.py (may need bounds.h)
9
10 # Use filechk to avoid rebuilds when a header changes, but the resulting file
11 # does not
12 define filechk_offsets
13 (set -e; \
14 echo "#ifndef $2"; \
15 echo "#define $2"; \
16 echo "/*"; \
17 echo " * DO NOT MODIFY."; \
18 echo " *"; \
19 echo " * This file was generated by Kbuild"; \
20 echo " */"; \
21 sed -ne '/#define/{s/\$$//;s/#//2;s/$$/*\//;p;}'; \
22 echo "#endif" )
23 endef
24
25 #####
26 # 1) Generate bounds.h
27
28 bounds-file := include/generated/bounds.h
29
30 always := $(bounds-file)
31 targets := kernel/bounds.s
32
33 # We use internal kbuild rules to avoid the "is up to date" message from make
34 kernel/bounds.s: kernel/bounds.c FORCE
35 $(Q)mkdir -p $(dir $@)
36 $(call if_changed_dep,cc_s_c)
37
38 $(obj)/$(bounds-file): kernel/bounds.s FORCE
39 $(call filechk,offsets,__LINUX_BOUNDS_H__)
40
41 #####
42 # 2) Generate timeconst.h
43
44 timeconst-file := include/generated/timeconst.h
45
46 targets += $(timeconst-file)
47
48 quiet_cmd_gentimeconst = GEN $@
49 define cmd_gentimeconst
50 (echo $(CONFIG_HZ) | bc -q $< ) > $@
51 endef
52 define filechk_gentimeconst
53 (echo $(CONFIG_HZ) | bc -q $< )
54 endef
55
56 $(obj)/$(timeconst-file): kernel/time/timeconst.bc FORCE
57 $(call filechk,gentimeconst)
58
59 #####
60 # 3) Generate asm-offsets.h
61 #
62
63 offsets-file := include/generated/asm-offsets.h
64
65 always += $(offsets-file)
66 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
67
68 # We use internal kbuild rules to avoid the "is up to date" message from make
69 arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
70 $(obj)/$(timeconst-file) $(obj)/$(bounds-file) FORCE
71 $(Q)mkdir -p $(dir $@)
72 $(call if_changed_dep,cc_s_c)
73
74 $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
75 $(call filechk,offsets,__ASM_OFFSETS_H__)
76
77 #####
78 # 4) Check for missing system calls
79 #
80
81 always += missing-syscalls
82 targets += missing-syscalls
83
84 quiet_cmd_syscalls = CALL $<
85 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
86
87 missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
88 $(call cmd,syscalls)
89
90 #####
91 # 5) Generate constants for Python GDB integration
92 #
93
94 extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
95
96 build_constants_py: $(obj)/$(timeconst-file) $(obj)/$(bounds-file)
97 @$(MAKE) $(build)=scripts/gdb/linux $@
98
99 # Keep these three files during make clean
100 no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)
This page took 0.04006 seconds and 5 git commands to generate.