Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

makefile : missing separator

Tags:

linux

makefile

#kernel build system and can use its lanauge
ifneq($(KERNELRELEASE),)
 obj-m:=helloworld.o
else
 KDIR:= /lib/modules/2.6.33.3-85.fc13.i686/build
all:
 make -C $(KDIR) M=$(PWD) modules
clean:
 rm -f *.ko *.o *.mod.o *.mod.c *.symvers
endif

The error is:

makefile:2:*** missing separator . stop

but for the ifneq($(KERNELRELEASE),), if I add a tab before, I get another error:

makefile:2: ***commands commence before first target. stop

like image 281
Grey Avatar asked Jul 23 '10 03:07

Grey


People also ask

What does missing separator in makefile?

Means that the makefile contains spaces instead of Tab's. The make utility is notoriously picky about the use of Space instead of Tab . So it's likely that the makefile contains Space at the beginning of rule stanzas within the file.

What is in makefile?

Makefile sets a set of rules to determine which parts of a program need to be recompile, and issues command to recompile them. Makefile is a way of automating software building procedure and other complex tasks with dependencies. Makefile contains: dependency rules, macros and suffix(or implicit) rules.


1 Answers

There must be a space between ifneq and (.

The TAB prefix means that it is a shell command, so be sure that the shell commands (make and rm) begin with TAB, and all other lines such as ifneq do not begin with TAB.

like image 174
mark4o Avatar answered Oct 03 '22 00:10

mark4o