11

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 privileges.
Winston C. Yang
  • 1,497
  • 2
  • 18
  • 27
  • 4
    The make version would be more relevant than the gcc version. Perhaps it's too old to support the `-include` directive? – Cascabel Apr 01 '10 at 02:31
  • 3
    @Jefromi: or it isn't GNU Make...the Sun Make probably does not understand '-include' - and will be expecting either a colon or an equals sign on line 220 (since it can't be a command because the first character is not a tab), and all other lines are comments, rules (with a colon) or macros (with an equals) and line 220 doesn't fit any of those. – Jonathan Leffler Apr 01 '10 at 02:39
  • 1
    If your Makefile really says `øø` then it somehow became corrupted. It should be `||`. Try downloading again. – mark4o Apr 01 '10 at 02:40
  • @mark4o: maybe Winston is working with a Scandinavian (Danish?) code set where ø appears at the code point where | appears in 8859-1. – Jonathan Leffler Apr 01 '10 at 02:42
  • @ Jefromi, Jonathan Leffler: Here is the information about make: RELEASE VERSION SunOS 5.9 Patch 111703-03 October 2002. @mark4o, Jonathan Leffler: I don't know how the || got changed. Maybe from copying and pasting, or I hit the wrong keys. After your comments, I used gmake (3.80, from 2002) and got error messages about include files and openssl. Do I have to ask root to install dependencies? Or can I install them locally and tell gmake where to look for them? – Winston C. Yang Apr 01 '10 at 14:24

6 Answers6

11

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

lennon310
  • 12,503
  • 11
  • 43
  • 61
user2554726
  • 179
  • 2
  • 3
  • also change the line "= cc" to instead be "= gcc" – jim Jun 14 '16 at 17:03
  • Same answer already answered before you. https://stackoverflow.com/questions/2557787/makefile-error-unexpected-end-of-line-seen/23390765#23390765 – rashok Apr 30 '20 at 04:45
6

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.

rashok
  • 12,790
  • 16
  • 88
  • 100
2

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.

Paulus
  • 1,385
  • 16
  • 20
1

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.

Diavolche
  • 21
  • 1
1

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

xpert
  • 19
  • 1
1

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.

Ate Somebits
  • 287
  • 1
  • 18