LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gnu make separator problem with commands only (https://www.linuxquestions.org/questions/linux-software-2/gnu-make-separator-problem-with-commands-only-754656/)

Jayse66 09-12-2009 10:48 AM

gnu make separator problem with commands only
 
Hi,

This is my first post on these forums, usually my questions are answered before i post :) but not this one, so hopefully someone can shed some light on this for me.

everything on the pc has been installed from kubuntu repositories, no others, and is the current release for 9.04 with all updates applied.

Code:

jayse@mercury:~$ echo "echo \"hello.\"" > newfile
jayse@mercury:~$ cat newfile
echo "hello."
jayse@mercury:~$ make -f newfile
newfile:1: *** missing separator. Stop.

jayse@mercury:~$ nano newfile
ayse@mercury:~$ cat newfile
DUMMY="HELLO"
echo "hello."
jayse@mercury:~$ make -f newfile
newfile:2: *** missing separator. Stop.

It does that with all commands in my makefile, including ifeq statements, but blank lines and assignments are fine.

I've seen threads suggesting issues with cr/lf pairs but i think my example rules that out. i've also seen a couple of posts showing LANG to be the issue, but mine appear to be ok.

Code:

jayse@mercury:~$ make -p | grep LANG
make: *** No targets specified and no makefile found. Stop.
LANGUAGE =
LANG = en_GB.UTF-8
jayse@mercury:~$ echo $LANG
en_GB.UTF-8


You are my last hope obi-wan. ;)


Jayse




Code:

jayse@mercury:~$ uname -a
Linux mercury 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 19:25:34 UTC 2009 x86_64 GNU/Linux

jayse@mercury:~$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu


atom 09-12-2009 11:08 AM

You need a target and, most of all, you need tabs for indentation instead of spaces.
It does that for me with your code too, so it's not your make, it's your syntax.

Code:

atom@saturn /home/atom/dev $ cat dummymake
all:
echo "asdf"
atom@saturn /home/atom/dev $ cat Makefile
all:
        echo "asdf"
atom@saturn /home/atom/dev $ make -f Makefile
echo "asdf"
asdf
atom@saturn /home/atom/dev $ make -f dummymake
dummymake:2: *** missing separator.  Stop.
atom@saturn /home/atom/dev $


Jayse66 09-12-2009 11:23 AM

Thanks for the superfast reply. I just tried the indentation and target bits and heres my results..

Code:

jayse@mercury:~$ cat dummymake
all:
echo "asdf"

jayse@mercury:~$ make -f dummymake
dummymake:2: *** missing separator. Stop.


Jayse

Jayse66 09-12-2009 11:27 AM

Ignore me, i boobed.

i NEED the tab. then it works as you already demonstrated.

thanks

atom 09-12-2009 11:31 AM

I'm glad you were able to resolve the issue.

And, in case you haven't noticed, there's a thanks button on the bottom right of posts of other people. If you click it, I get bragging rights :).


Regards,

Gašper


All times are GMT -5. The time now is 09:24 PM.