Makefile 1.3 KB

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