开发者

Makefile error: Unexpected end of line seen

Trying to install Git, I ran configure and make, but got the following error message:

make: Fatal error in reader: Makefile, line 221: Unexpected end of line seen

The Makefile looks like:

218:    GIT-VERSION-FILE: FORCE
219:            @$(SHELL_PATH) ./GIT-VERSION-GEN
220:    -include GIT-VERSION-FILE
221:
222:    uname_S := $(shell sh -c 'uname -s 2>/dev/null øø echo not')

What's causing the error?

The following information may or may not be relevant:

  • I tried to install Git 1.7.0.3 on SunOS 5.9 (Solaris 9) in a directory in my account.
  • The gcc version is 3.4.2 (older then the version of 3.4.6 stated by sunfreeware.com).
  • I don't have root p开发者_开发知识库rivileges.


Using gmake on SunOS instead of make fixed this issue for me.


Use gmake instead of make.

Genrally solaris has two command, gmake and make. In this gmake is GNU style make command, and make is solaris style make command. I hope you have written your makefile in GNU style. So use gmake command.


This might be due to DOS line endings (CRLF) in your makefile. I have just had a similar problem and solved it by running dos2unix on the makefile. Linux make seems unfazed by the same makefile.


Make sure that you have actually tabbed the line and it is not all spaces. I had this issue but I found out the command was not properly tabbed in and that is why I was running into this error.


Its a problem with your "make", install "make-3.81.tar" and then try


I came to this error with 2 simple makefiles, one of which was working, and one which produced the error.

Both had properly tabbed lines, and both had "CRLF" line endings.

For one reason or another, I managed to fix the problem by changing the line endings to "LF", but I am confused as to why the other makefile was parsed successfully even though it had "CRLF" endings. There is, however, a clue: the first one or two times, "make" gave another error:

mksh: Warning: newline is not last character...

After opening the makefile in a text-editor, and adding a line ending at the end, it started producing the OP's error.

In this situation, it's good to have an editor that can display line endings and tabs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜