GNU make yields “commands commence before first target” error
Asked Answered
G

1

9

Trying to install Emacs 22.3 from sources on Fedora 15 x86_64.

./configure

command goes ok, but

make yields error:

[sigrlami@server emacs-22.3]# make
cd lib-src; make all  \
CC='gcc' CFLAGS='-g -O2 -Wno-pointer-sign ' CPPFLAGS='-D_BSD_SOURCE  ' \
LDFLAGS='-Wl,-znocombreloc ' MAKE='make'
make[1]: Entering directory `/home/sigrlami/bin/emacs-22.3/lib-src'
Makefile:148: *** recipe commences before first target.  Stop.
make[1]: Leaving directory `/home/sigrlami/bin/emacs-22.3/lib-src'
make: *** [lib-src] Error 2

In makefile, where I don't touch anything, everything seems ok in row 148:

144 # ========================== start of cpp stuff =======================
145 LIBS_MOVE=$(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(HESIODLIB)
146 LOADLIBES= -lc
147 ALL_CFLAGS = -D_BSD_SOURCE -DHAVE_CONFIG_H
148           -I. -I../src -I${srcdir} -I${srcdir}/../src ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
149 LINK_CFLAGS = -D_BSD_SOURCE -DHAVE_CONFIG_H

Any suggestions how to fix this? Maybe system doesn't have some libraries?

Garlaand answered 16/10, 2011 at 11:20 Comment(2)
Line 148 is not ok. If you need that to be appended to ALL_CFLAGS, you'll need to put a ` \ ` at the very end of line 147.Hydric
Not that it matters now, but I'll bet somehow the whitespace at the beginning of 148 was a tab, not spaces, which is kind of odd.Synapsis
T
12

The make input language is white-space sensitive.

In particular commands (actions to be run in order to remake targets) begin with a tab, so the error is telling you unambiguously that you have a tab out of place.

While it is only tabs at the beginning of lines that have the special significance, I try to not use any tabs in my makefiles other than that the signal the beginning of commands.

Talamantes answered 16/10, 2011 at 15:58 Comment(1)
the thing is, that is standard files for Emacs 22.3, and in my makefile I use whitespaces, but here was tab. I was trying to set whitespaces, but there was an error on this. There was other bugs after that, but I handle them. In the end I set up 23.3 beta and there was no errors. It was a surprise.Garlaand

© 2022 - 2024 — McMap. All rights reserved.