栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

学习[30天自制操作系统]day02遇到的makefile的问题

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

学习[30天自制操作系统]day02遇到的makefile的问题

学习[30天自制操作系统]day02遇到的问题|场景还原|尝试过的解决办法
    • 【问题一】make run运行错误
      • 问题描述
      • make run错误 解决方案
      • 【问题一】解决完毕
    • 【问题二】make clean运行(系统找不到指定的文件。)
    • [附]完整Makefile文件代码
    • 【结束】

【问题一】make run运行错误 问题描述

光盘代码day_02 helloos_4 helloos_5
在使用makefile 运行qemu 模拟器过程出错

# 默认动作

default :
	../z_tools/make.exe img

# 镜像文件生成

ipl.bin : ipl.nas Makefile
	../z_tools/nask.exe ipl.nas ipl.bin ipl.lst

helloos.img : ipl.bin Makefile
	../z_tools/edimg.exe   imgin:../z_tools/fdimg0at.tek 
		wbinimg src:ipl.bin len:512 from:0 to:0   imgout:helloos.img

# 其他指令

asm :
	../z_tools/make.exe -r ipl.bin

img :
	../z_tools/make.exe -r helloos.img

run :
	../z_tools/make.exe img
	copy helloos.img ..z_toolsqemufdimage0.bin
	../z_tools/make.exe -C ../z_tools/qemu

install :
	../z_tools/make.exe img
	../z_tools/imgtol.com w a: helloos.img

clean :
	-del ipl.bin
	-del ipl.lst

src_only :
	../z_tools/make.exe clean
	-del helloos.img

文字报错信息:

D:Userstolsethelloos4>..z_toolsmake.exe run -i
../z_tools/make.exe img
make.exe[1]: Entering directory `D:/Users/tolset/helloos4'
../z_tools/make.exe -r helloos.img
make.exe[2]: Entering directory `D:/Users/tolset/helloos4'
make.exe[2]: `helloos.img' is up to date.
make.exe[2]: Leaving directory `D:/Users/tolset/helloos4'
make.exe[1]: Leaving directory `D:/Users/tolset/helloos4'
#copy helloos.img ../z_tools/qemu/fdimage0.bin
copy helloos.img ..z_toolsqemufdimage0.bin
process_begin: CreateProcess((null), copy helloos.img ..z_toolsqemufdimage0.bin, ...) failed.
make (e=2): 系统找不到指定的文件。
..z_toolsmake.exe: [run] Error 2 (ignored)
../z_tools/make.exe -C ../z_tools/qemu
make.exe[1]: Entering directory `D:/Users/tolset/z_tools/qemu'
qemu-win.bat
make run错误 解决方案
copy helloos.img ..z_toolsqemufdimage0.bin

改为:

cp helloos.img ..z_toolsqemufdimage0.bin
【问题一】解决完毕 【问题二】make clean运行(系统找不到指定的文件。)

运行信息

del ipl.bin
process_begin: CreateProcess((null), del ipl.bin, ...) failed.
make (e=2): 系统找不到指定的文件。
..z_toolsmake.exe: [clean] Error 2 (ignored)
del ipl.lst
process_begin: CreateProcess((null), del ipl.lst, ...) failed.
make (e=2): 系统找不到指定的文件。

将 makefile 中的 clean: 部分修改即可

clean :
	-rm -f ipl.bin
	-rm -f ipl.lst
src_only :
	../z_tools/make.exe clean
	-rm -f helloos.img

好了,问题解决。

[附]完整Makefile文件代码
# 默认动作

default :
	../z_tools/make.exe img

# 镜像文件生成

ipl.bin : ipl.nas Makefile
	../z_tools/nask.exe ipl.nas ipl.bin ipl.lst

helloos.img : ipl.bin Makefile
	../z_tools/edimg.exe   imgin:../z_tools/fdimg0at.tek 
		wbinimg src:ipl.bin len:512 from:0 to:0   imgout:helloos.img

# 其他指令

asm :
	../z_tools/make.exe -r ipl.bin

img :
	../z_tools/make.exe -r helloos.img

run :
	../z_tools/make.exe img
	cp helloos.img ..z_toolsqemufdimage0.bin
	../z_tools/make.exe -C ../z_tools/qemu

install :
	../z_tools/make.exe img
	../z_tools/imgtol.com w a: helloos.img

clean :
	-rm -f ipl.bin
	-rm -f ipl.lst

src_only :
	../z_tools/make.exe clean
	-rm -f helloos.img

【结束】

谢谢你的浏览,希望可以帮助到你。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/642974.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号