小编ton*_*gko的帖子

没有规则来制作目标'%.o'

由于未知原因,GNU Make不能为我完成这项工作.我有这个MAKE文件,我确实为每个食谱,我使用标签,而不是空间.但是我看着它,我无法发现会导致错误信息的任何地方.

操作系统:Ubuntu 17.10/GNU Make:4.1/GCC:交叉编译到i686-elf-gcc.

运行它:make(在同一目录中)给我

make: *** No rule to make target '%.o', needed by 'kernel.elf'.  Stop.
Run Code Online (Sandbox Code Playgroud)

我有一个bash脚本,完全相同的东西,它就像魅力一样.谁能说出我做错了什么?

Makefile文件:

NASM=nasm
QEMU=qemu-system-i386
GCC=~/opt/cross/bin/i686-elf-gcc
CFLAGS=-std=c11 -ffreestanding -Wall -Wextra -Werror -masm=intel -g -O0
ASFLAGS=-felf32 -g

.PHONY: all clean
all:boot.iso

%.o : %.c
    $(GCC) -c $< $(CFLAGS) -o $@

%.so : %.asm
    $(NASM) $(ASFLAGS) -o $@ $<

kernel.elf : %.o
    $(GCC) -T link.ld -o $@ -ffreestanding -O0 -nostdlib -lgcc --verbose $^
    grub-file --is-x86-multiboot2 kernel.elf

boot.iso : kernel.elf grub.cfg
    mkdir -p ./iso/boot/grub
    cp kernel.elf …
Run Code Online (Sandbox Code Playgroud)

c linux makefile gnu-make

4
推荐指数
1
解决办法
2974
查看次数

是否会执行"return"关键字后的语句?

我是C++初学者,想知道这个场景的影响:

PCONSOLE_SCREEN_BUFFER_INFOEX GetConsoleInfo(void) {
    WaitForSingleObject(m_hSync);   // m_hSync is HANDLE to mutex created using CreateMutex()

    return m_pcsbi;    // m_pcsbi is of type PCONSOLE_SCREEN_BUFFER_INFOEX

    ReleaseMutex(m_hSync);      // <== will this line be executed?
}
Run Code Online (Sandbox Code Playgroud)

想知道[ReleaseMutex()]会被执行吗?

c++ return visual-c++

2
推荐指数
1
解决办法
150
查看次数

标签 统计

c ×1

c++ ×1

gnu-make ×1

linux ×1

makefile ×1

return ×1

visual-c++ ×1