ninja: error: build.ninja:6: expected 'command =' line
ninja: error: build.ninja:6: expected 'command =' line
我正在制作操作系统我正在使用 makefile 但我正在尝试迁移到 ninja-build 但我收到此错误:
ninja: error: build.ninja:6: expected 'command =' line
build.ninja
GPPPARAMS = -m32 -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -
fno-exceptions -fno-leading-underscore
ASPARAMS = --32
LDPARAMS = -melf_i386 -T
rule compile-cpp
command = gcc $GPPPARAMS -o $out -c $in
rule compile-asm
command = as $ASPARAMS -o $out -c $in
rule link
command = ld $LDPARAMS -c $in
rule kernel
command = sudo cp $in /boot/kernel.bin
build ./src/kernel.o: compile-cpp ./src/kernel.cpp
build ./src/loader.o: compile-asm ./src/loader.s
build fgos: link ./src/linker.ld
生成文件
'GPPPARAMS = -m32 -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -fno-exceptions -fno-leading-underscore
ASPARAMS = --32
LDPARAMS = -melf_i386
objects = loader.o kernel.o
%.o: %.cpp
g++ $(GPPPARAMS) -o $@ -c $<
%.o: %.s
as $(ASPARAMS) -o $@ $<
kernel.bin: linker.ld $(objects)
ld $(LDPARAMS) -T $< -o $@ $(objects)
install: kernel.bin
sudo cp $< /boot/kernel.bin
存储库
我解决了这个问题,给了 2 个 ident spaces 而不是 4,并在 ninja 文件的末尾给出了 space
我正在制作操作系统我正在使用 makefile 但我正在尝试迁移到 ninja-build 但我收到此错误:
ninja: error: build.ninja:6: expected 'command =' line
build.ninja
GPPPARAMS = -m32 -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -
fno-exceptions -fno-leading-underscore
ASPARAMS = --32
LDPARAMS = -melf_i386 -T
rule compile-cpp
command = gcc $GPPPARAMS -o $out -c $in
rule compile-asm
command = as $ASPARAMS -o $out -c $in
rule link
command = ld $LDPARAMS -c $in
rule kernel
command = sudo cp $in /boot/kernel.bin
build ./src/kernel.o: compile-cpp ./src/kernel.cpp
build ./src/loader.o: compile-asm ./src/loader.s
build fgos: link ./src/linker.ld
生成文件
'GPPPARAMS = -m32 -fno-use-cxa-atexit -nostdlib -fno-builtin -fno-rtti -fno-exceptions -fno-leading-underscore
ASPARAMS = --32
LDPARAMS = -melf_i386
objects = loader.o kernel.o
%.o: %.cpp
g++ $(GPPPARAMS) -o $@ -c $<
%.o: %.s
as $(ASPARAMS) -o $@ $<
kernel.bin: linker.ld $(objects)
ld $(LDPARAMS) -T $< -o $@ $(objects)
install: kernel.bin
sudo cp $< /boot/kernel.bin
存储库
我解决了这个问题,给了 2 个 ident spaces 而不是 4,并在 ninja 文件的末尾给出了 space