TJM TJM - 2 months ago 25
Linux Question

missing separator on Makefile

I am now having problems with a autotools generated Makefile, and it first looks like this. When I was trying

make
an error arised:

Makefile:327: *** missing separator. Stop.


Then, I tried the following change:

326,327c326
< LDFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -L/home/tjm/tmp/fake-root/libgd/usr/local/lib/ -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/fake-root/freetype/usr/local/lib -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/jpeg-6b
< -static
---
> LDFLAGS = -Wl,-O1,--sort-common,--as-needed,-z,relro -L/home/tjm/tmp/fake-root/libgd/usr/local/lib/ -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/fake-root/freetype/usr/local/lib -L /home/tjm/tmp/fake-root/libpng/usr/local/lib -L /home/tjm/tmp/jpeg-6b -static


But, this time, I got this error:

Making all in intl
Makefile:35: *** missing separator. Stop.
make[1]: *** [Makefile:582: all-recursive] Error 1
make: *** [Makefile:489: all] Error 2


The related lines look like these:

32 skip_next=no; \
33 strip_trailopt () \
34 { \
35 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
36 }; \


And I teird a lot of things like:

34 { flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \

34 { \
35 flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \

33 strip_trailopt () { flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; }; \


and

35 ^Iflg=printf '%s\n' "$$flg" | sed "s/$$1.*$$//"; \$


But still got the same error.

Does anyone can give me some ieda about how to fix it?

Answer

(Note: I'm not sure if this is correct in StackOverflow vs SuperUser.)

If you edited the Makefile, it'll not be useful as it'll just re-generate out of Makefile.in, and that one in turn will be generated out of Makefile.am.

Check your Makefile.am file, and put -static in the same line as everything else; what is happening is that it does not have a continuation symbol at the end of the previous line (\), so the variable definition is not continued. And because of that it tries to parse it as a rule, which it's not.