Files

63 lines
1.8 KiB
Makefile
Raw Permalink Normal View History

# SPDX-License-Identifier: GPL-2.0
2005-04-16 15:20:36 -07:00
#
# Makefile for the linux kernel.
#
ccflags-y := -fno-function-sections -fno-data-sections
2007-02-10 01:44:43 -08:00
obj-y := main.o version.o mounts.o
ifneq ($(CONFIG_BLK_DEV_INITRD),y)
obj-y += noinitramfs.o
else
obj-$(CONFIG_BLK_DEV_INITRD) += initramfs.o
endif
2005-04-16 15:20:36 -07:00
obj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o
obj-$(CONFIG_INITRAMFS_TEST) += initramfs_test.o
obj-y += init_task.o
2005-04-16 15:20:36 -07:00
mounts-y := do_mounts.o
mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o
mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o
2022-08-28 11:39:53 +09:00
#
# UTS_VERSION
#
2005-04-16 15:20:36 -07:00
2022-08-28 11:39:53 +09:00
smp-flag-$(CONFIG_SMP) := SMP
preempt-flag-$(CONFIG_PREEMPT_BUILD) := PREEMPT
preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) := PREEMPT_DYNAMIC
preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT
2007-01-10 14:45:28 +01:00
2022-08-28 11:39:53 +09:00
build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto))
build-timestamp = $(or $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto))
# Maximum length of UTS_VERSION is 64 chars
filechk_uts_version = \
utsver=$$(echo '$(pound)'"$(build-version)" $(smp-flag-y) $(preempt-flag-y) "$(build-timestamp)" | cut -b -64); \
echo '$(pound)'define UTS_VERSION \""$${utsver}"\"
#
# Build version.c with temporary UTS_VERSION
#
$(obj)/utsversion-tmp.h: FORCE
$(call filechk,uts_version)
clean-files += utsversion-tmp.h
$(obj)/version.o: $(obj)/utsversion-tmp.h
2022-08-28 11:39:53 +09:00
CFLAGS_version.o := -include $(obj)/utsversion-tmp.h
#
# Build version-timestamp.c with final UTS_VERSION
#
2024-06-12 03:24:47 +09:00
include/generated/utsversion.h: build-version-auto = $(shell $(srctree)/scripts/build-version)
2022-08-28 11:39:53 +09:00
include/generated/utsversion.h: build-timestamp-auto = $(shell LC_ALL=C date)
include/generated/utsversion.h: FORCE
$(call filechk,uts_version)
$(obj)/version-timestamp.o: include/generated/utsversion.h
CFLAGS_version-timestamp.o := -include include/generated/utsversion.h