Make error: missing separator

后端 未结 12 2073
说谎
说谎 2020-11-22 08:07

I am getting the following error running make:

Makefile:168: *** missing separator.  Stop.

What is causing this?

相关标签:
12条回答
  • 2020-11-22 08:46

    In my case, the same error was caused because colon: was missing at end as in staging.deploy:. So note that it can be easy syntax mistake.

    0 讨论(0)
  • 2020-11-22 08:46

    Following Makefile code worked:

    obj-m = hello.o
    
    all:
        $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules 
    
    clean:
        $(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
    
    0 讨论(0)
  • 2020-11-22 08:52

    Just for grins, and in case somebody else runs into a similar error:

    I got the infamous "missing separator" error because I had invoked a rule defining a function as

    ($eval $(call function,args))
    

    rather than

    $(eval $(call function,args))
    

    i.e. ($ rather than $(.

    0 讨论(0)
  • 2020-11-22 08:54

    For me, the problem was that I had some end-of-line # ... comments embedded within a define ... endef multi-line variable definition. Removing the comments made the problem go away.

    0 讨论(0)
  • 2020-11-22 08:54

    In my case error caused next. I've tried to execute commands globally i.e outside of any target.

    UPD. To run command globally one must be properly formed. For example command

    ln -sf ../../user/curl/$SRC_NAME ./$SRC_NAME
    

    would become:

    $(shell ln -sf ../../user/curl/$(SRC_NAME) ./$(SRC_NAME))
    
    0 讨论(0)
  • 2020-11-22 08:57

    So apparently, all I needed was the "build-essential" package, then to run autoconf first, which made the Makefile.pre.in, then the ./configure then the make which works perfectly...

    0 讨论(0)
提交回复
热议问题