]> git.ipfire.org Git - thirdparty/linux.git/blame - init/Makefile
Merge tag 'char-misc-6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[thirdparty/linux.git] / init / Makefile
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
1da177e4
LT
2#
3# Makefile for the linux kernel.
4#
5
b67067f1
NP
6ccflags-y := -fno-function-sections -fno-data-sections
7
c33df4ea
JPS
8obj-y := main.o version.o mounts.o
9ifneq ($(CONFIG_BLK_DEV_INITRD),y)
10obj-y += noinitramfs.o
11else
12obj-$(CONFIG_BLK_DEV_INITRD) += initramfs.o
13endif
1da177e4 14obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o
a6359d1e 15
a6359d1e 16obj-y += init_task.o
1da177e4
LT
17
18mounts-y := do_mounts.o
1da177e4
LT
19mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o
20mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o
1da177e4 21
2df8220c
MY
22#
23# UTS_VERSION
24#
25
26smp-flag-$(CONFIG_SMP) := SMP
27preempt-flag-$(CONFIG_PREEMPT_BUILD) := PREEMPT
28preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) := PREEMPT_DYNAMIC
29preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT
30
31build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto))
32build-timestamp = $(or $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto))
33
34# Maximum length of UTS_VERSION is 64 chars
35filechk_uts_version = \
36 utsver=$$(echo '$(pound)'"$(build-version)" $(smp-flag-y) $(preempt-flag-y) "$(build-timestamp)" | cut -b -64); \
37 echo '$(pound)'define UTS_VERSION \""$${utsver}"\"
38
39#
40# Build version.c with temporary UTS_VERSION
41#
1da177e4 42
2df8220c
MY
43$(obj)/utsversion-tmp.h: FORCE
44 $(call filechk,uts_version)
3eb3c740 45
2df8220c
MY
46clean-files += utsversion-tmp.h
47
a55f283e 48$(obj)/version.o: $(obj)/utsversion-tmp.h
2df8220c
MY
49CFLAGS_version.o := -include $(obj)/utsversion-tmp.h
50
2df8220c
MY
51#
52# Build version-timestamp.c with final UTS_VERSION
53#
54
55include/generated/utsversion.h: build-version-auto = $(shell $(srctree)/$(src)/build-version)
56include/generated/utsversion.h: build-timestamp-auto = $(shell LC_ALL=C date)
57include/generated/utsversion.h: FORCE
58 $(call filechk,uts_version)
59
60$(obj)/version-timestamp.o: include/generated/utsversion.h
61CFLAGS_version-timestamp.o := -include include/generated/utsversion.h
42633ed8 62KASAN_SANITIZE_version-timestamp.o := n
2d7ce49f 63KCSAN_SANITIZE_version-timestamp.o := n
ddf56288 64GCOV_PROFILE_version-timestamp.o := n