Makefile:
export KDIR:=linux-5.4.188
all:
make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KDIR) M=$(PWD) modules
cp axpu_ldd_kc.ko /srv/tftp/.
clean:
make ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KDIR) M=$(PWD) clean
rm -f axpu_ldd_kc.ko
%: %.c
$(CROSS_COMPILE)gcc -fmax-errors=2 $^ -o $@
include Makefile.qemuMakefile.qemu:
q_kernel_g :
${QEMU} -machine ab21q,gic-version=max,secure=off,virtualization=true -cpu max -kernel ${LINUX_DIR}/arch/arm64/boot/Image -m 2G -nographic -netdev user,id=vnet,hostfwd=:127.0.0.1:0-:22,tftp=/srv/tftp -device virtio-net-pci,netdev=vnet -machine iommu=smmuv3 --append "root=/dev/ram init=/init nokaslr earlycon ip=dhcp hugepages=16" -s -S
g_kernel :
pid=`ps aux | grep qemu-system | awk 'NR==1{print $2}'`
aarch64-none-elf-gdb linux-5.4.188/vmlinux $pid -x gdb_script当我做make时,它会给我这个错误。
make[1]: Entering directory '/home/ckim/ProjX/QEMU/qemu_test/test_ldd_540/linux-5.4.188'
/home/ckim/ProjX/QEMU/qemu_test/test_ldd_540/Makefile:35: Makefile.qemu: No such file or directory
make[2]: *** No rule to make target 'Makefile.qemu'. Stop.我不知道为什么要在linux-5.4.188目录下找到Makefile.qemu。如果我将Makefile.qemu复制到linux-5.4.188下,一切正常。为了使目标all变为目录Linux5.4.188,但是它为什么期望Makefile.qemu在目录下呢?
发布于 2022-04-06 10:19:02
我相信Linux内核Makefile将包含Makefile,因为这是在不同的目录下完成的,因此出现了错误。您可以分离只与常规Makefile调用相关的部分,而不是与内核构建相关的部分,如文档所述
ifeq ($(KERNELRELEASE),)
include Makefile.qemu
endifhttps://stackoverflow.com/questions/71763115
复制相似问题