^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # Makefile for the linux kernel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ccflags-y := -fno-function-sections -fno-data-sections
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) obj-y := main.o version.o mounts.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) ifneq ($(CONFIG_BLK_DEV_INITRD),y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) obj-y += noinitramfs.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) obj-$(CONFIG_BLK_DEV_INITRD) += initramfs.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) obj-y += init_task.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) mounts-y := do_mounts.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) # dependencies on generated files need to be listed explicitly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) $(obj)/version.o: include/generated/compile.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) # compile.h changes depending on hostname, generation number, etc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) # so we regenerate it always.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) # mkcompile_h will make sure to only update the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) # actual file if its content has changed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) chk_compile.h = :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) quiet_chk_compile.h = echo ' CHK $@'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) silent_chk_compile.h = :
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) include/generated/compile.h: FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) @$($(quiet)chk_compile.h)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) "$(CONFIG_PREEMPT_RT)" $(CONFIG_CC_VERSION_TEXT) "$(LD)"