XV6操作系统make报错Makefile:192: *** recipe commences before first target. Stop. 的解决方法

  大家好,我叫亓官劼(qí guān jié ),在CSDN中记录学习的点滴历程,时光荏苒,未来可期,加油~博客地址为:亓官劼的博客,B站昵称为:亓官劼,地址为亓官劼的B站

本文原创为亓官劼,请大家支持原创,部分平台一直在盗取博主的文章!!!


  有很多小伙伴在使用XV6操作系统做相关的实验的时候经常会遇到报错Makefile:192: *** recipe commences before first target. Stop.,然后不知错所,这里提供一个可能报错这个情形,以及解决方法(目前仅用这种方法复习了这个报错,如果有其他情形报错一样,可以把Makefile文件发一份过来看一下)。

这里先上一下我这里复习这种报错时的Makefile文件的内容:

OBJS = \bio.o\console.o\exec.o\file.o\fs.o\ide.o\ioapic.o\kalloc.o\kbd.o\lapic.o\log.o\main.o\mp.o\picirq.o\pipe.o\proc.o\sleeplock.o\spinlock.o\string.o\swtch.o\syscall.o\sysfile.o\sysproc.o\trapasm.o\trap.o\uart.o\vectors.o\vm.o\# Cross-compiling (e.g., on Mac OS X)
# TOOLPREFIX = i386-jos-elf# Using native tools (e.g., on X86 Linux)
#TOOLPREFIX = # Try to infer the correct TOOLPREFIX if not set
ifndef TOOLPREFIX
TOOLPREFIX := $(shell if i386-jos-elf-objdump -i 2>&1 | grep '^elf32-i386$$' >/dev/null 2>&1; \then echo 'i386-jos-elf-'; \elif objdump -i 2>&1 | grep 'elf32-i386' >/dev/null 2>&1; \then echo ''; \else echo "***" 1>&2; \echo "*** Error: Couldn't find an i386-*-elf version of GCC/binutils." 1>&2; \echo "*** Is the directory with i386-jos-elf-gcc in your PATH?" 1>&2; \echo "*** If your i386-*-elf toolchain is installed with a command" 1>&2; \echo "*** prefix other than 'i386-jos-elf-', set your TOOLPREFIX" 1>&2; \echo "*** environment variable to that prefix and run 'make' again." 1>&2; \echo "*** To turn off this error, run 'gmake TOOLPREFIX= ...'." 1>&2; \echo "***" 1>&2; exit 1; fi)
endif# If the makefile can't find QEMU, specify its path here
# QEMU = qemu-system-i386# Try to infer the correct QEMU
ifndef QEMU
QEMU = $(shell if which qemu > /dev/null; \then echo qemu; exit; \elif which qemu-system-i386 > /dev/null; \then echo qemu-system-i386; exit; \elif which qemu-system-x86_64 > /dev/null; \then echo qemu-system-x86_64; exit; \else \qemu=/Applications/Q.app/Contents/MacOS/i386-softmmu.app/Contents/MacOS/i386-softmmu; \if test -x $$qemu; then echo $$qemu; exit; fi; fi; \echo "***" 1>&2; \echo "*** Error: Couldn't find a working QEMU executable." 1>&2; \echo "*** Is the directory containing the qemu binary in your PATH" 1>&2; \echo "*** or have you tried setting the QEMU variable in Makefile?" 1>&2; \echo "***" 1>&2; exit 1)
endifCC = $(TOOLPREFIX)gcc
AS = $(TOOLPREFIX)gas
LD = $(TOOLPREFIX)ld
OBJCOPY = $(TOOLPREFIX)objcopy
OBJDUMP = $(TOOLPREFIX)objdump
CFLAGS = -fno-pic -static -fno-builtin -fno-strict-aliasing -O2 -Wall -MD -ggdb -m32 -Werror -fno-omit-frame-pointer
CFLAGS += $(shell $(CC) -fno-stack-protector -E -x c /dev/null >/dev/null 2>&1 && echo -fno-stack-protector)
ASFLAGS = -m32 -gdwarf-2 -Wa,-divide
# FreeBSD ld wants ``elf_i386_fbsd''
LDFLAGS += -m $(shell $(LD) -V | grep elf_i386 2>/dev/null | head -n 1)# Disable PIE when possible (for Ubuntu 16.10 toolchain)
ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e '[^f]no-pie'),)
CFLAGS += -fno-pie -no-pie
endif
ifneq ($(shell $(CC) -dumpspecs 2>/dev/null | grep -e '[^f]nopie'),)
CFLAGS += -fno-pie -nopie
endifxv6.img: bootblock kerneldd if=/dev/zero of=xv6.img count=10000dd if=bootblock of=xv6.img conv=notruncdd if=kernel of=xv6.img seek=1 conv=notruncxv6memfs.img: bootblock kernelmemfsdd if=/dev/zero of=xv6memfs.img count=10000dd if=bootblock of=xv6memfs.img conv=notruncdd if=kernelmemfs of=xv6memfs.img seek=1 conv=notruncbootblock: bootasm.S bootmain.c$(CC) $(CFLAGS) -fno-pic -O -nostdinc -I. -c bootmain.c$(CC) $(CFLAGS) -fno-pic -nostdinc -I. -c bootasm.S$(LD) $(LDFLAGS) -N -e start -Ttext 0x7C00 -o bootblock.o bootasm.o bootmain.o$(OBJDUMP) -S bootblock.o > bootblock.asm$(OBJCOPY) -S -O binary -j .text bootblock.o bootblock./sign.pl bootblockentryother: entryother.S$(CC) $(CFLAGS) -fno-pic -nostdinc -I. -c entryother.S$(LD) $(LDFLAGS) -N -e start -Ttext 0x7000 -o bootblockother.o entryother.o$(OBJCOPY) -S -O binary -j .text bootblockother.o entryother$(OBJDUMP) -S bootblockother.o > entryother.asminitcode: initcode.S$(CC) $(CFLAGS) -nostdinc -I. -c initcode.S$(LD) $(LDFLAGS) -N -e start -Ttext 0 -o initcode.out initcode.o$(OBJCOPY) -S -O binary initcode.out initcode$(OBJDUMP) -S initcode.o > initcode.asmkernel: $(OBJS) entry.o entryother initcode kernel.ld$(LD) $(LDFLAGS) -T kernel.ld -o kernel entry.o $(OBJS) -b binary initcode entryother$(OBJDUMP) -S kernel > kernel.asm$(OBJDUMP) -t kernel | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > kernel.sym# kernelmemfs is a copy of kernel that maintains the
# disk image in memory instead of writing to a disk.
# This is not so useful for testing persistent storage or
# exploring disk buffering implementations, but it is
# great for testing the kernel on real hardware without
# needing a scratch disk.
MEMFSOBJS = $(filter-out ide.o,$(OBJS)) memide.o
kernelmemfs: $(MEMFSOBJS) entry.o entryother initcode kernel.ld fs.img$(LD) $(LDFLAGS) -T kernel.ld -o kernelmemfs entry.o  $(MEMFSOBJS) -b binary initcode entryother fs.img$(OBJDUMP) -S kernelmemfs > kernelmemfs.asm$(OBJDUMP) -t kernelmemfs | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > kernelmemfs.symtags: $(OBJS) entryother.S _initetags *.S *.cvectors.S: vectors.pl./vectors.pl > vectors.SULIB = ulib.o usys.o printf.o umalloc.o_%: %.o $(ULIB)$(LD) $(LDFLAGS) -N -e main -Ttext 0 -o $@ $^$(OBJDUMP) -S $@ > $*.asm$(OBJDUMP) -t $@ | sed '1,/SYMBOL TABLE/d; s/ .* / /; /^$$/d' > $*.sym_forktest: forktest.o $(ULIB)# forktest has less library code linked in - needs to be small# in order to be able to max out the proc table.$(LD) $(LDFLAGS) -N -e main -Ttext 0 -o _forktest forktest.o ulib.o usys.o$(OBJDUMP) -S _forktest > forktest.asmmkfs: mkfs.c fs.hgcc -Werror -Wall -o mkfs mkfs.c# Prevent deletion of intermediate files, e.g. cat.o, after first build, so
# that disk image changes after first build are persistent until clean.  More
# details:
# http://www.gnu.org/software/make/manual/html_node/Chained-Rules.html
.PRECIOUS: %.oUPROGS=\_cat\_echo\_forktest\_grep\_init\_kill\_ln\_ls\_mkdir\_rm\_sh\_stressfs\_usertests\_wc\_zombie\
fs.img: mkfs README $(UPROGS)./mkfs fs.img README $(UPROGS)-include *.dclean: rm -f *.tex *.dvi *.idx *.aux *.log *.ind *.ilg \*.o *.d *.asm *.sym vectors.S bootblock entryother \initcode initcode.out kernel xv6.img fs.img kernelmemfs \xv6memfs.img mkfs .gdbinit \$(UPROGS)# make a printout
FILES = $(shell grep -v '^\#' runoff.list)
PRINT = runoff.list runoff.spec README toc.hdr toc.ftr $(FILES)xv6.pdf: $(PRINT)./runoffls -l xv6.pdfprint: xv6.pdf# run in emulatorsbochs : fs.img xv6.imgif [ ! -e .bochsrc ]; then ln -s dot-bochsrc .bochsrc; fibochs -q# try to generate a unique GDB port
GDBPORT = $(shell expr `id -u` % 5000 + 25000)
# QEMU's gdb stub command line changed in 0.11
QEMUGDB = $(shell if $(QEMU) -help | grep -q '^-gdb'; \then echo "-gdb tcp::$(GDBPORT)"; \else echo "-s -p $(GDBPORT)"; fi)
ifndef CPUS
CPUS := 2
endif
QEMUOPTS = -drive file=fs.img,index=1,media=disk,format=raw -drive file=xv6.img,index=0,media=disk,format=raw -smp $(CPUS) -m 512 $(QEMUEXTRA)qemu: fs.img xv6.img$(QEMU) -serial mon:stdio $(QEMUOPTS)qemu-memfs: xv6memfs.img$(QEMU) -drive file=xv6memfs.img,index=0,media=disk,format=raw -smp $(CPUS) -m 256qemu-nox: fs.img xv6.img$(QEMU) -nographic $(QEMUOPTS).gdbinit: .gdbinit.tmplsed "s/localhost:1234/localhost:$(GDBPORT)/" < $^ > $@qemu-gdb: fs.img xv6.img .gdbinit@echo "*** Now run 'gdb'." 1>&2$(QEMU) -serial mon:stdio $(QEMUOPTS) -S $(QEMUGDB)qemu-nox-gdb: fs.img xv6.img .gdbinit@echo "*** Now run 'gdb'." 1>&2$(QEMU) -nographic $(QEMUOPTS) -S $(QEMUGDB)# CUT HERE
# prepare dist for students
# after running make dist, probably want to
# rename it to rev0 or rev1 or so on and then
# check in that version.EXTRA=\mkfs.c ulib.c user.h cat.c echo.c forktest.c grep.c kill.c\ln.c ls.c mkdir.c rm.c stressfs.c usertests.c wc.c zombie.c\printf.c umalloc.c\README dot-bochsrc *.pl toc.* runoff runoff1 runoff.list\.gdbinit.tmpl gdbutil\dist:rm -rf distmkdir distfor i in $(FILES); \do \grep -v PAGEBREAK $$i >dist/$$i; \donesed '/CUT HERE/,$$d' Makefile >dist/Makefileecho >dist/runoff.speccp $(EXTRA) distdist-test:rm -rf distmake distrm -rf dist-testmkdir dist-testcp dist/* dist-testcd dist-test; $(MAKE) printcd dist-test; $(MAKE) bochs || truecd dist-test; $(MAKE) qemu# update this rule (change rev#) when it is time to
# make a new revision.
tar:rm -rf /tmp/xv6mkdir -p /tmp/xv6cp dist/* dist/.gdbinit.tmpl /tmp/xv6(cd /tmp; tar cf - xv6) | gzip >xv6-rev10.tar.gz  # the next one will be 10 (9/17).PHONY: dist-test dist

解决方法:其实很简单,因为你在fs.img:少了一个空行,可能是修改的时候把这个空行不小心删除了,导致了他的错误。在图示位置将UPROGS结尾加一个空行即可。


  大家好,我是亓官劼(qí guān jié ),在【亓官劼】公众号、CSDN、GitHub、B站、华为开发者论坛等平台分享一些技术博文,主要包括前端开发、python后端开发、小程序开发、数据结构与算法、docker、Linux常用运维、NLP等相关技术博文,时光荏苒,未来可期,加油~
  如果喜欢博主的文章可以关注博主的个人公众号【亓官劼】(qí guān jié),里面的文章更全更新更快。如果有需要找博主的话可以在公众号后台留言,我会尽快回复消息,其他平台私信回复较慢。

由于学习工作的需要,算法刷题将会逐渐由C++向Python3过度,正在过度中,如实现的不太优美,请见谅。

本文原创为【亓官劼】(qí guān jié ),请大家支持原创,部分平台一直在恶意盗取博主的文章!!! 全部文章请关注微信公众号【亓官劼】。

XV6操作系统make报错Makefile:192: *** recipe commences before first target. Stop. 的解决方法相关推荐

  1. centos在yum install报错:Another app is currently holding the yum lock解决方法

    centos在yum install报错:Another app is currently holding the yum lock解决方法 参考文章: (1)centos在yum install报错 ...

  2. phpmyadmin登录报错crypt_random_string requires at least one symmetric cipher be loaded 解决方法

    phpmyadmin登录报错crypt_random_string requires at least one symmetric cipher be loaded 解决方法 参考文章: (1)php ...

  3. 控制台报错:java.lang.ClassNotFoundException: javax.xml.bind.JAXBException之解决方法

    控制台报错:java.lang.ClassNotFoundException: javax.xml.bind.JAXBException之解决方法 参考文章: (1)控制台报错:java.lang.C ...

  4. msfconsole启动失败并报错`not_after=‘: bignum too big to convert into `long‘的解决方法

    msfconsole启动失败并报错`not_after=': bignum too big to convert into `long'的解决方法 参考文章: (1)msfconsole启动失败并报错 ...

  5. SVN报错:can‘t open file db/txn-current-lock:permission denied 解决方法

    SVN报错:can't open file db/txn-current-lock:permission denied 解决方法 参考文章: (1)SVN报错:can't open file db/t ...

  6. mysql 1033_mysql报错1033 Incorrect information in file: ''''xxx.frm''''问题的解决方法(图)...

    这篇文章主要介绍了关于mysql报错1033 Incorrect information in file: 'xxx.frm'问题的解决方法,文中通过示例代码介绍的很详细,需要的朋友可以参考借鉴,下面 ...

  7. 上传文件报错500或者文件大于2M上传不上去解决方法

    上传文件报错500或者文件大于2M上传不上去解决方法 参考文章: (1)上传文件报错500或者文件大于2M上传不上去解决方法 (2)https://www.cnblogs.com/sillong/p/ ...

  8. Python使用pip安装报错ModuleNotFoundError: No module named ‘pip._internal.cli.main‘的解决方法

    Python使用pip安装报错ModuleNotFoundError: No module named 'pip._internal.cli.main'的解决方法   大家好,我叫亓官劼(qí guā ...

  9. dedecms后台报错“Notice: Use of undefined constant MYSQL_ASSOC - assumed ‘MYSQL_ASSOC‘ ”的解决方法

    dedecms后台报错"Notice: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' "的解决方法 p ...

最新文章

  1. 如何用Swift实现一个好玩的弹性动画
  2. iptable 命令
  3. 产品经理经验谈:与产品经理有关的100件小事儿~
  4. 电脑主板接口_PCI接口借尸还魂?精英发布新款B450电脑主板,配备老式PCI接口...
  5. 【python】python的环境搭建
  6. html li占用两行,谁帮我解决一下LI上下两行错位的BUG。_html/css_WEB-ITnose
  7. ReactiveCocoa入门教程--第二部分
  8. Sketch 54 中文版发布 新增深色模式
  9. docker修改服务器防火墙,docker宿主机iptables配置
  10. 日程安排工具Calendso
  11. 解决openwrt package目录下多个文件夹重名编译警告(call subdir 函数)
  12. gdb调试的插件安装——gef插件
  13. 亲测linux系统安装mysql5.7.22
  14. 第三届阿里巴巴全球数学竞赛落下帷幕,这届90后属实优秀!北大恐成最大赢家!
  15. 樊登读书会用事实说话读后感_《用事实说话:透明化沟通的8项原则》【美】马克·墨菲电子书【pdf mobi txt epub 在线阅读 读后感】 - 精英日记网...
  16. 新编《守株待兔》—C语言版—兼聊为什么不应该用%d格式转换输出指针
  17. Hive性能调优实战 分享
  18. 魔方机器人(基于OpenCV、Arduino)
  19. VS2019无法打开源文件
  20. 关于ansys里面的谐分析和瞬态分析结果的讨论

热门文章

  1. ChatGPT飙升苹果商店榜首,每周订阅需7.99美元,结果是个假的???
  2. ASP.NET Session详细介绍
  3. 安卓仿微信录音功能实现
  4. oracle的set函数,setex(oracle trunc函数)
  5. matlab批量读取图像图片并批量处理图像(以伽马校正为例)以及批量保存图像
  6. lwip-SNMP移植
  7. python 会计分录模板_常见会计分录大全(15种小企业模板)
  8. 手机连接电脑不读手机的终极解决方案
  9. iPhone X 的适配
  10. 强大的第三方视频播放器。