Makefile的问题 - 在阅读器致命错误 [英] Makefile issues - fatal error in reader

查看:401
本文介绍了Makefile的问题 - 在阅读器致命错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个makefile我创建了一个学校项目的一些问题。我编译和装配C文件和SPARC汇编文件(分别)以及联系起来。我在Unix环境中工作。下面是生成文件:

I am having some issues with a makefile I am creating for a school project. I am compiling and assembling a C file and a SPARC assembly file (respectively) and linking them. I'm working in a Unix environment. Here is the makefile:

proj09.exe: proj09.driver.o proj09.support.o
<tab>gcc -Wall proj09.driver.o proj09.support.o -o proj09.exe

proj09.driver.o: proj09.driver.c /user/cse320/Projects/project09.support.h
<tab>gcc -Wall -c proj09.driver.c /user/cse320/Projects/project09.support.h

proj09.support.o: proj09.support.s
<tab>gcc -Wall proj09.support.s 

当我尽量做到,不过,我得到一个错误的读者,特别是:

When I try to make it, though, I get a reader error, specifically:

,在读者致命错误:proj09.makefile,2号线:线路意外结束看过

"Fatal error in reader: proj09.makefile, line 2: Unexpected end of line seen"

现在我知道,这通常意味着什么格式不正确,但我不知道它可能是在这种情况下。另外,我不是100%肯定这是正确的code的生成文件(我support.s和文件的专门装配,和这两个文件的链接)。我道歉,如果这是一个重复的问题,我从档案看事前并没有找到使用任何东西。任何帮助将大大AP preciated!

Now I know that usually this means that something is formatted incorrectly, but I have no idea what it could be in this case. Also, I am not 100% sure that this is the correct code for the makefile (specifically the assembling of my support.s file, and the linking of both files). I apologize if this is a repeat question, I looked through the archives beforehand and couldn't find anything of use. Any help would be greatly appreciated!

编辑:我不明白为什么这会有所作为,但我使用的gedit实际编写了code,然后将文件转移到SSH用于连接。

I don't see why this would make a difference, but I am using gedit to actually write the code and then transferring the files into SSH for linking.

推荐答案

随着勒夫告诉你,行应该由标签缩进,而不是空格,所以第二行应该是这样的:

As Joachim told you, the lines should be indented by tab, not by spaces, so the second line should look like:

[TAB]gcc -Wall proj09.driver.o proj09.support.o -o proj09.exe[NEWLINE]

其中,[TAB]是指制表符。

where [TAB] means TAB character.

也有不应该的命令后,任何空格。这就是为什么我已经把[NEWLINE]字符。

Also there shouldn't be any spaces after the command. That's why I've put [NEWLINE] char.

这篇关于Makefile的问题 - 在阅读器致命错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆