mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 13:41:51 +00:00
67d7c3023a
I added $(srctree)/ to some included Makefiles in the following commits: -3204a7fb98
("kbuild: prefix $(srctree)/ to some included Makefiles") -d828563955
("kbuild: do not require sub-make for separate output tree builds") They were a preparation for removing --include-dir flag. I have never thought --include-dir useful. Rather, it _is_ harmful. For example, run the following commands: $ make -s ARCH=x86 mrproper defconfig $ make ARCH=arm O=foo dtbs make[1]: Entering directory '/tmp/linux/foo' HOSTCC scripts/basic/fixdep Error: kernelrelease not valid - run 'make prepare' to update it UPD include/config/kernel.release make[1]: Leaving directory '/tmp/linux/foo' The first command configures the source tree for x86. The next command tries to build ARM device trees in the separate foo/ directory - this must stop because the directory foo/ has not been configured yet. However, due to --include-dir=$(abs_srctree), the top Makefile includes the wrong include/config/auto.conf from the source tree and continues building. Kbuild traverses the directory tree, but of course it does not work correctly. The Error message is also pointless - 'make prepare' does not help at all for fixing the issue. This commit fixes more arch Makefile, and finally removes --include-dir from the top Makefile. There are more breakages under drivers/, but I do not volunteer to fix them all. I just moved --include-dir to drivers/Makefile. With this commit, the second command will stop with a sensible message. $ make -s ARCH=x86 mrproper defconfig $ make ARCH=arm O=foo dtbs make[1]: Entering directory '/tmp/linux/foo' SYNC include/config/auto.conf.cmd *** *** The source tree is not clean, please run 'make ARCH=arm mrproper' *** in /tmp/linux *** make[2]: *** [../Makefile:646: outputmakefile] Error 1 /tmp/linux/Makefile:770: include/config/auto.conf.cmd: No such file or directory make[1]: *** [/tmp/linux/Makefile:793: include/config/auto.conf.cmd] Error 2 make[1]: Leaving directory '/tmp/linux/foo' make: *** [Makefile:226: __sub-make] Error 2 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
47 lines
1.5 KiB
Makefile
47 lines
1.5 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the linux kernel.
|
|
#
|
|
|
|
ifdef CONFIG_DYNAMIC_FTRACE
|
|
CFLAGS_REMOVE_ftrace.o = -pg
|
|
endif
|
|
|
|
extra-y := vmlinux.lds
|
|
|
|
obj-y := head.o entry.o efi.o efi_stub.o gate-data.o fsys.o irq.o irq_ia64.o \
|
|
irq_lsapic.o ivt.o pal.o patch.o process.o ptrace.o sal.o \
|
|
salinfo.o setup.o signal.o sys_ia64.o time.o traps.o unaligned.o \
|
|
unwind.o mca.o mca_asm.o topology.o dma-mapping.o iosapic.o acpi.o \
|
|
acpi-ext.o
|
|
|
|
obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
|
|
|
|
obj-$(CONFIG_IA64_PALINFO) += palinfo.o
|
|
obj-$(CONFIG_MODULES) += module.o
|
|
obj-$(CONFIG_SMP) += smp.o smpboot.o
|
|
obj-$(CONFIG_NUMA) += numa.o
|
|
obj-$(CONFIG_IA64_CYCLONE) += cyclone.o
|
|
obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
|
|
obj-$(CONFIG_KPROBES) += kprobes.o
|
|
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
|
|
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
|
|
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
|
obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
|
|
obj-$(CONFIG_AUDIT) += audit.o
|
|
obj-y += msi_ia64.o
|
|
mca_recovery-y += mca_drv.o mca_drv_asm.o
|
|
obj-$(CONFIG_IA64_MC_ERR_INJECT)+= err_inject.o
|
|
obj-$(CONFIG_STACKTRACE) += stacktrace.o
|
|
|
|
obj-$(CONFIG_IA64_ESI) += esi.o esi_stub.o # must be in kernel proper
|
|
obj-$(CONFIG_INTEL_IOMMU) += pci-dma.o
|
|
|
|
obj-$(CONFIG_ELF_CORE) += elfcore.o
|
|
|
|
# fp_emulate() expects f2-f5,f16-f31 to contain the user-level state.
|
|
CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31
|
|
|
|
# The gate DSO image is built using a special linker script.
|
|
include $(srctree)/$(src)/Makefile.gate
|