Syntax error: word unexpected (expecting “)”)?

后端 未结 1 693
小蘑菇
小蘑菇 2021-01-02 00:19
PLATFORM = x86
CUD = cuda
X86 = x86
PAN = panda
ARM = arm

app: 
    ifeq($(PLATFORM),$(CUD))
CC = dum3
endif
ifeq($(PLATFORM), $(X86))
CC = gcc
endif
ifeq($(PLATFOR         


        
相关标签:
1条回答
  • 2021-01-02 00:19

    The formatting in your question (both the makefile and the error message) is too messed up to be sure, but my suspicion is that your ifeq is indented with a TAB.

    That's not right; ifeq is a make command. (Almost) all lines with TAB characters as the first character on the line in a makefile is passed to the shell. The shell doesn't know anything about ifeq, so, depending on your shell, might print an error like that.

    You should move the app: target after the ifeq blocks to just before the use of $(CC) (and ensure the $(CC) ... line is indented with a TAB as the first character on that line).

    In the future please be sure to use SO's formatting capabilities, and be sure to cut and paste error messages exactly, plus a few lines of context before and after, when asking questions.

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