tracing: extend sched_pi_setprio
[deliverable/linux.git] / Kbuild
... / ...
CommitLineData
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
12define 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" )
23endef
24
25#####
26# 1) Generate bounds.h
27
28bounds-file := include/generated/bounds.h
29
30always := $(bounds-file)
31targets := kernel/bounds.s
32
33# We use internal kbuild rules to avoid the "is up to date" message from make
34kernel/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
44timeconst-file := include/generated/timeconst.h
45
46targets += $(timeconst-file)
47
48quiet_cmd_gentimeconst = GEN $@
49define cmd_gentimeconst
50 (echo $(CONFIG_HZ) | bc -q $< ) > $@
51endef
52define filechk_gentimeconst
53 (echo $(CONFIG_HZ) | bc -q $< )
54endef
55
56$(obj)/$(timeconst-file): kernel/time/timeconst.bc FORCE
57 $(call filechk,gentimeconst)
58
59#####
60# 3) Generate asm-offsets.h
61#
62
63offsets-file := include/generated/asm-offsets.h
64
65always += $(offsets-file)
66targets += arch/$(SRCARCH)/kernel/asm-offsets.s
67
68# We use internal kbuild rules to avoid the "is up to date" message from make
69arch/$(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
81always += missing-syscalls
82targets += missing-syscalls
83
84quiet_cmd_syscalls = CALL $<
85 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
86
87missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
88 $(call cmd,syscalls)
89
90#####
91# 5) Generate constants for Python GDB integration
92#
93
94extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
95
96build_constants_py: $(obj)/$(timeconst-file) $(obj)/$(bounds-file)
97 @$(MAKE) $(build)=scripts/gdb/linux $@
98
99# Keep these three files during make clean
100no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)
This page took 0.032781 seconds and 5 git commands to generate.