2
2
# Kbuild for top-level directory of the kernel
3
3
# This file takes care of the following:
4
4
# 1) Generate bounds.h
5
- # 2) Generate asm-offsets.h (may need bounds.h)
6
- # 3) Check for missing system calls
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
7
8
8
9
# Default sed regexp - multiline due to syntax constraints
9
10
define sed-y
@@ -47,7 +48,26 @@ $(obj)/$(bounds-file): kernel/bounds.s FORCE
47
48
$(call filechk,offsets,__LINUX_BOUNDS_H__)
48
49
49
50
# ####
50
- # 2) Generate asm-offsets.h
51
+ # 2) Generate timeconst.h
52
+
53
+ timeconst-file := include/generated/timeconst.h
54
+
55
+ # always += $(timeconst-file)
56
+ targets += $(timeconst-file )
57
+
58
+ quiet_cmd_gentimeconst = GEN $@
59
+ define cmd_gentimeconst
60
+ (echo $(CONFIG_HZ ) | bc -q $< ) > $@
61
+ endef
62
+ define filechk_gentimeconst
63
+ (echo $(CONFIG_HZ ) | bc -q $< )
64
+ endef
65
+
66
+ $(obj ) /$(timeconst-file ) : kernel/time/timeconst.bc FORCE
67
+ $(call filechk,gentimeconst)
68
+
69
+ # ####
70
+ # 3) Generate asm-offsets.h
51
71
#
52
72
53
73
offsets-file := include/generated/asm-offsets.h
@@ -57,15 +77,15 @@ targets += arch/$(SRCARCH)/kernel/asm-offsets.s
57
77
58
78
# We use internal kbuild rules to avoid the "is up to date" message from make
59
79
arch/$(SRCARCH ) /kernel/asm-offsets.s : arch/$(SRCARCH ) /kernel/asm-offsets.c \
60
- $(obj)/$(bounds-file) FORCE
80
+ $(obj)/$(timeconst-file) $(obj)/$( bounds-file) FORCE
61
81
$(Q)mkdir -p $(dir $@)
62
82
$(call if_changed_dep,cc_s_c)
63
83
64
84
$(obj ) /$(offsets-file ) : arch/$(SRCARCH ) /kernel/asm-offsets.s FORCE
65
85
$(call filechk,offsets,__ASM_OFFSETS_H__)
66
86
67
87
# ####
68
- # 3 ) Check for missing system calls
88
+ # 4 ) Check for missing system calls
69
89
#
70
90
71
91
always += missing-syscalls
@@ -77,5 +97,5 @@ quiet_cmd_syscalls = CALL $<
77
97
missing-syscalls : scripts/checksyscalls.sh $(offsets-file ) FORCE
78
98
$(call cmd,syscalls)
79
99
80
- # Keep these two files during make clean
81
- no-clean-files := $(bounds-file ) $(offsets-file )
100
+ # Keep these three files during make clean
101
+ no-clean-files := $(bounds-file ) $(offsets-file ) $( timeconst-file )
0 commit comments