xref: /openbmc/linux/init/Makefile (revision 41eba23e)
1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
21da177e4SLinus Torvalds#
31da177e4SLinus Torvalds# Makefile for the linux kernel.
41da177e4SLinus Torvalds#
51da177e4SLinus Torvalds
6b67067f1SNicholas Pigginccflags-y := -fno-function-sections -fno-data-sections
7b67067f1SNicholas Piggin
8c33df4eaSJean-Paul Samanobj-y                          := main.o version.o mounts.o
9c33df4eaSJean-Paul Samanifneq ($(CONFIG_BLK_DEV_INITRD),y)
10c33df4eaSJean-Paul Samanobj-y                          += noinitramfs.o
11c33df4eaSJean-Paul Samanelse
12c33df4eaSJean-Paul Samanobj-$(CONFIG_BLK_DEV_INITRD)   += initramfs.o
13c33df4eaSJean-Paul Samanendif
141da177e4SLinus Torvaldsobj-$(CONFIG_GENERIC_CALIBRATE_DELAY) += calibrate.o
15a6359d1eSThomas Gleixner
16a6359d1eSThomas Gleixnerobj-y                          += init_task.o
171da177e4SLinus Torvalds
181da177e4SLinus Torvaldsmounts-y			:= do_mounts.o
191da177e4SLinus Torvaldsmounts-$(CONFIG_BLK_DEV_RAM)	+= do_mounts_rd.o
201da177e4SLinus Torvaldsmounts-$(CONFIG_BLK_DEV_INITRD)	+= do_mounts_initrd.o
211da177e4SLinus Torvalds
221da177e4SLinus Torvalds# dependencies on generated files need to be listed explicitly
2392045954SSam Ravnborg$(obj)/version.o: include/generated/compile.h
241da177e4SLinus Torvalds
253eb3c740SRoman Zippel# compile.h changes depending on hostname, generation number, etc,
263eb3c740SRoman Zippel# so we regenerate it always.
273eb3c740SRoman Zippel# mkcompile_h will make sure to only update the
283eb3c740SRoman Zippel# actual file if its content has changed.
293eb3c740SRoman Zippel
30*41eba23eSMasahiro Yamadaquiet_cmd_compile.h = CHK     $@
31*41eba23eSMasahiro Yamada      cmd_compile.h = \
32*41eba23eSMasahiro Yamada	$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@	\
334b950bb9SThomas Gleixner	"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)"	\
349a950154SMasahiro Yamada	"$(CONFIG_PREEMPT_RT)" $(CONFIG_CC_VERSION_TEXT) "$(LD)"
35*41eba23eSMasahiro Yamada
36*41eba23eSMasahiro Yamadainclude/generated/compile.h: FORCE
37*41eba23eSMasahiro Yamada	$(call cmd,compile.h)
38