make error:“make [1]:*** [目录]错误1”

时间:2013-03-07 14:35:37

标签: makefile gnu-make

当我尝试在makefile上运行“make all”时遇到一些复杂性我得到了这个错误:

C:\BITCLOUD\BitCloud_PS_SAM3S_EK_1_10_0\BitCloud_PS_SAM3S_EK_1_10_0\Applications\ZAppSi\Dem o\SEDevice>make all 
make -C makefiles/PC -f Makefile_PC_Gcc all APP_NAME=DemoSE
make[1]: Entering directory
'C:/BITCLOUD/BitCloud_PS_SAM3S_EK_1_10_0/BitCloud_PS_SAM3S_EK_1_10_0/Applications/ZAppSi/Demo/SEDevice/makefiles/PC'
A sintaxe do comando está incorrecta.
make[1]: *** [directories] Error 1
make[1]: Leaving directory
'C:/BITCLOUD/BitCloud_PS_SAM3S_EK_1_10_0/BitCloud_PS_SAM3S_EK_1_10_0/Applications/ZAppSi/Demo/SEDevice/makefiles/PC'
make: *** [all] Error 2

A sintaxe do comando está incorrecta.  

翻译成英文意味着:“命令的语法不正确”

我已经尝试将项目更改为不同的目录,检查文件名中的空格,使用GNU make并使用MinGW make(mingw32-make),结果与“make”相同。我还检查了makefile中包含的所有文件,它们是对应的。

我不是makefile的专家,所以我请求帮助。 当make抛出这种类型的错误时,会出现什么主要问题?

1 个答案:

答案 0 :(得分:0)

可能不会make抛出此错误,但make执行的命令返回非零退出状态,在这种情况下状态为1(由于错误1);然后顶级make因错误2而停止。请注意,make默认情况下会在命令失败时立即停止。 由于输出没有显示执行了什么命令,因此无法确切地说明出了什么问题。

编辑:来自GNU make手册:

   -d   Print debugging information in addition  to  normal  processing.
        The  debugging information says which files are being considered
        for remaking, which file-times are being compared and with  what
        results,  which files actually need to be remade, which implicit
        rules are considered and which are  applied---everything  inter‐
        esting about how make decides what to do.

   --debug[=FLAGS]
        Print  debugging  information  in addition to normal processing.
        If the FLAGS are omitted, then the behavior is the same as if -d
        was specified.  FLAGS may be a for all debugging output (same as
        using -d), b for basic  debugging,  v  for  more  verbose  basic
        debugging,  i for showing implicit rules, j for details on invo‐
        cation of commands, and m for  debugging  while  remaking  make‐
        files.

我建议运行make --debug=j来查看命令。