LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   /root/proclist/Makefile:5: *** missing separator. Stop. (https://www.linuxquestions.org/questions/programming-9/root-proclist-makefile-5-%2A%2A%2A-missing-separator-stop-478308/)

raklo 08-29-2006 12:26 AM

/root/proclist/Makefile:5: *** missing separator. Stop.
 
hi all,
i've written a small driver code for whcih ive created a Makefile the contents of which r as shown below

####################################

#MODULE_NAME = test
#$(MODULE_NAME)-objs=inode.o proclist.o

#obj-m := $(MODULE_NAME).o
ifneq($(KERNELRELEASE),)
obj-m:=proclist.o
else
KDIR:=/usr/src/linux-2.6.11.1
PWD:=$(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
#########################################

when i tried to compile the code with #make,it shows the message

/root/proclist/Makefile:5: *** missing separator. Stop.

.I know the above problem occurs when TAB is replace by
8 SPACES during process of copying contents by the system.
i've verified it and there is no replace ment,as i've manually typed in the code.

so wot is probably the problem???????/
ANY INPUT IS APPRECIATED
regards
rakesh

tuxdev 08-29-2006 05:29 PM

First, use [code] to preserve indentation, as it is important for Makefiles. Your editor may be replacing the tabs with spaces automatically

xhi 08-29-2006 08:40 PM

> i've verified it and there is no replace ment,as i've manually typed in the code.

so you typed it in wrong. we cant help though because as tuxdev said

raklo 08-30-2006 01:36 AM

as u had asked the distro,i'm using FC3 packages and the kernel is 2.6.11.1.
as u said,my editor must be automatically replacing TABS with SPACES,i changed the editor(from vi to gedit to emacs )but still no change in the outcome.is there any other editor that i can try

as u had said, i may have typed wrong,the code that i hav pasted in the query(between the ###### lines) is copy of my code,is it wrong somewhere???

THANX for ur replies
rakesh

xhi 08-30-2006 09:15 AM

did you read either of the two previous posts? check out the link that i posted in my first post (psst code tags) and then edit or repost your makefile source.

tuxdev 08-30-2006 09:29 AM

Really, we can't help you at all without the [code] tags. For this question, it is really, really important. You might try vim with my .vimrc, which disables replacing tabs with spaces for files that look like ?akefile* (that means it starts with any character, then akefile, then any number of any character). "syn on" will do syntax highlighting, so if you have syntax errors, it will complain loudly with an unpleasant color. The hi lines simply change the colours, so you can skip that if you like the defaults (it is actually what I remember the defaults are before they suddenly decided to change). "bs=2" means that you can backspace freely, "ts=3" means that my tabs are 3 spaces, "sw=3" means that the > and < shifting keys will shift by 3 space, "bg=dark" for better colours on a black background, "ai" means autoindent stuff, "et" means expand tabs into spaces, "ic" means ignore case for searching, and "ru" means provide a bit of text on the bottom to tell me where I am in the file.
Code:

set ff=unix bs=2 ts=3 sw=3 bg=dark ai et ic ru
syn on
hi SpecialKey    term=bold ctermfg=4
hi NonText        term=bold cterm=bold ctermfg=4
hi Directory      term=bold ctermfg=4
hi ErrorMsg      term=standout cterm=bold ctermfg=7 ctermbg=1
hi IncSearch      term=reverse cterm=reverse
hi Search        term=reverse ctermbg=3
hi MoreMsg        term=bold ctermfg=2
hi ModeMsg        term=bold cterm=bold
hi LineNr        term=underline ctermfg=3
hi Question      term=standout ctermfg=2
hi StatusLine    term=bold,reverse cterm=bold,reverse
hi StatusLineNC  term=reverse cterm=reverse
hi VertSplit      term=reverse cterm=reverse
hi Title          term=bold ctermfg=5
hi Visual        term=reverse cterm=reverse
hi VisualNOS      term=bold,underline cterm=bold,underline
hi WarningMsg    term=standout ctermfg=1
hi WildMenu      term=standout ctermfg=0 ctermbg=3
hi Folded        term=standout ctermfg=4 ctermbg=7
hi FoldColumn    term=standout ctermfg=4 ctermbg=7
hi DiffAdd        term=bold ctermbg=4
hi DiffChange    term=bold ctermbg=5
hi DiffDelete    term=bold cterm=bold ctermfg=4 ctermbg=6
hi DiffText      term=reverse cterm=bold ctermbg=1
hi SignColumn    term=standout ctermfg=4 ctermbg=7
hi Comment        term=bold ctermfg=4
hi Constant      term=underline ctermfg=1
hi Special        term=bold ctermfg=5
hi Identifier    term=underline ctermfg=6
hi Statement      term=bold ctermfg=3
hi PreProc        term=underline ctermfg=5
hi Type          term=underline ctermfg=2
hi Underlined    term=underline cterm=underline ctermfg=5
hi Ignore        cterm=bold ctermfg=7
hi Error          term=reverse cterm=bold ctermfg=7 ctermbg=1
hi Todo          term=standout ctermfg=0 ctermbg=3
au BufEnter ?akefile* set noet
au BufLeave ?akefile* set et
augroup Binary
  au!
  au BufReadPre  *.bin let &bin=1
  au BufReadPost *.bin if &bin | %!xxd
  au BufReadPost *.bin set ft=xxd | endif
  au BufWritePre *.bin if &bin | %!xxd -r
  au BufWritePre *.bin endif
  au BufWritePost *.bin if &bin | %!xxd
  au BufWritePost *.bin set nomod | endif
augroup END


raklo 08-30-2006 11:11 PM

thanx xhi and tuxdev,
but the post that u (xhi)have snt basically contains some VB tags,and i dont know wht my Makefile has to do with those tags.
very sorry if the question is too STUPID.
thanx again n waiting for reply
regards
rakesh

xhi 08-30-2006 11:21 PM

ok. luckily i am drinking heavily (Evan Williams, i love kentucky bourbon), so i will be able to actually answer this in a civilized way. :)

your question is not "too STUPID", not stupid at all. i think we are simply misunderstanding each other here.

USE CODE TAGS means that you should wrap code (code being anything that is intended to be interpreted, compiled, or otherwise not plain english) within the [code] tags that are show on the link i posted.

>but the post that u (xhi)have snt basically contains some VB tags,and i dont know wht my Makefile has to do with those tags.

what those tags have to do with your Makefile? they have nothing to do with your makefile, but they have everything to do with someone here being able to analyze the make code that you posted and tell you what you did wrong. if you do not use code tags you lose all formatting including tabs, which are very important to a makefile.

just repost the makefile with a [code] at the beginning and a [ /code] at the end as in the example that is at the link i posted.

raklo 08-30-2006 11:53 PM

thanx again,as u said here is the makefile
#################################
#################################
#MODULE_NAME = test
#$(MODULE_NAME)-objs=inode.o proclist.o

#obj-m := $(MODULE_NAME).o
Code:

ifneq($(KERNELRELEASE),)
obj-m := proclist.o
else
KDIR := /usr/src/linux-2.6.11.1
PWD := $(shell pwd)
default:
        $(MAKE) -C $(KDIR) SUBDIRS = $(PWD) modules
endif

#proclist-objs:=inode.o
#proclist-y:=devpts.o #devpts.o shud be renamed as devpts.o_shipped

clean:
        rm -f *.ko *.mod.c *.mod.o proclist.o .*.cmd

###############################################

i'd like to attach the file but i dont know how to so i'm again pasting the code.

hope i didnt disturb ur session with kentucky bourbon!!
i'm from a place in india where alchohol is legally banned,so dont know much bout drinks.

anywayz if want any more details ,just let me know

regards
rakesh

xhi 08-31-2006 12:07 AM

banned alcohol? wow, that is wrong.

but anyhow, well done with the code tags

i am seeing an extra tab in front of default (there should be nothing, default should be at the start of the line)

and also there are 8 spaces instead of a tab infrom of the clean command

raklo 08-31-2006 12:14 AM

but the ban cant deter us from drinking!

u said u can see a TAB in from of 'default' and 8 SPACES in front of 'clear',but in my Makefile 'default' does start from the start of the line and same is the case with 'clean'
r u using any utility that shows such EXTRA TAGS and SPACES.?????

even in the code,that ive sent u they start from the start of line.

how to remove the TABS and SPACES that i cant see??

regards
rakesh

xhi 08-31-2006 12:25 AM

> but the ban cant deter us from drinking!
that is good to hear! that sounds like a terrible law, im sure the people who put it in place are enjoying a drink behind closed doors ..

yes i am seeing an extra tab in front of default:

Code:

ifneq($(KERNELRELEASE),)
obj-m := proclist.o
else
KDIR := /usr/src/linux-2.6.11.1
PWD := $(shell pwd)
default:
        $(MAKE) -C $(KDIR) SUBDIRS = $(PWD) modules
endif

#proclist-objs:=inode.o
#proclist-y:=devpts.o #devpts.o shud be renamed as devpts.o_shipped

clean:
        rm -f *.ko *.mod.c *.mod.o proclist.o .*.cmd

that is your makefile with the tabs fixed.. copy and past and see what that does.

raklo 08-31-2006 12:38 AM

sme is the case,
still it is showing

Makefile:1: *** missing separator. Stop

do u think therez some prob with the editor(i have also tried with gedit and emacs)

but when i copy it from the site the work
fneq is copied,due to some reason 'i' is not printed and i have to manually print in the 'i'
is that th eproblem
regards
rakesh

xhi 08-31-2006 12:40 AM

what happens if you get rid of the if else and just do this..

Code:

KDIR := /usr/src/linux-2.6.11.1
PWD := $(shell pwd)
default:
        $(MAKE) -C $(KDIR) SUBDIRS = $(PWD) modules

#proclist-objs:=inode.o
#proclist-y:=devpts.o #devpts.o shud be renamed as devpts.o_shipped

clean:
        rm -f *.ko *.mod.c *.mod.o proclist.o .*.cmd


raklo 08-31-2006 02:08 AM

when i do that, i get

Code:

[root@pc-00064 proclist]# make
make -C /usr/src/linux-2.6.11.1 SUBDIRS = /root/proclist modules
make: *** empty variable name.  Stop.
make: *** [default] Error 2

also i want to make a module that can be insmod'ed and rmmod'ed,for which i have to add the line

Code:

obj-m:=proclist.o
while the code which u have sent does not have that line.

i'd like to know,how r u able to see the TABS that r not visible to me??(any special editor or tool???)

regards
rakesh


All times are GMT -5. The time now is 07:28 PM.