最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Makefile.mak *** missing separator. Stop

Embedded crifan 8399浏览 0评论

【背景】

在windows下面,用已有的makefile去编译一个项目,最后出错:

D:\DevRoot\FBK\develop\FBK2_Template\target\mak\FF_FBK_HM_REL>make
make[1]: Nothing to be done for `hw’.
make[1]: Nothing to be done for `osif.emb’.
make[2]: Nothing to be done for `make_fbif’.
../../appl/fdev/mak/Makefile.mak:135: *** missing separator.  Stop.
../std_makefile.mak:325: recipe for target `fdev’ failed
make: *** [fdev] Error 2

需要说明的是,此套环境,在别人的win7中都是工作正常的,而在我这里,却出错了。

【解决过程】

1.去看了看对应代码:

make error code貌似也没看出啥异常的,而且可以确定,此代码在别人系统上是可以正常编译的。

2.需要解释的是,此处的前提是,已经有了对应的和make相关的工具了:

develop tools

并且已经设置好了对应的环境变量了。

所以,按理来说,执行make的时候,应该是去执行的对应的上述develop-tools文件夹下面的make才对的。

但是由于我系统中已经另外按了cygwin,所以虽然是在windows的cmd中执行的make,但是实际上make的时候,所用的make程序,是cygwin下面的make:

D:\DevRoot\FBK\develop\FBK2_Template\target\mak\FF_FBK_HM_REL>which make
/usr/bin/make

 

3.所以,尝试着,把cygwin暂时屏蔽掉,即把windows中的PATH环境变量中的cygwin的bin的路径:

D:\tmp\tmp_dev_root\cgwin\bin;

去掉,然后再重试试试make。

此时,重试make,就可以正常编译了。

然后又去看了看,原先那个develop-tools下面的make的版本是3.79:

D:\DevRoot\FBK\develop\FBK2_Template\target\mak\FF_FBK_HM_REL>make -version
GNU Make version 3.79, by Richard Stallman and Roland McGrath.
Built for i686-pc-cygwin
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to [email protected].

而原先cygwin下面的make的版本是3.82.90:

CLi@PC-CLI-1 ~
$ make -version
GNU Make 3.82.90
Built for i686-pc-cygwin
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

【总结】

不同版本的make,对同样的代码的语法检查,不太一样,导致可以在3.79版本下工作的代码:

ifeq ($(HW_TYPE), FBK2_HW)
  $(or ifeq ($(SW_DOWNLOAD_TYPE), USE_SW_DOWNLOAD), ifeq ($(SW_DOWNLOAD_TYPE), SW_DOWNLOAD_DEV))
  SINCS += da_fbk2_dwld.h
endif

在3.82.90下却无法工作,出现“missing separator. Stop”的错误。

转载请注明:在路上 » 【已解决】Makefile.mak *** missing separator. Stop

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (3)

  1. 搜索missing separator到你这儿。 看到提示版本区别,这边ubuntu12.04 x64下 default gnu make : version 3.81 使用vim编辑makefile,tab键设定为4个空格,导致出现此错误。 改为gedit编辑后,make成功。 So,还不知是不是对tab的检查导致的。先mark一下,等我换了gnu make版本之后检查看看。
    lance10年前 (2014-11-07)回复
    • 刚去搜了下GNU make manual,关键字:missing separator http://www.gnu.org/software/make/manual/make.html 其中一段提到: One of the most common reasons for this message is that you (or perhaps your oh-so-helpful editor, as is the case with many MS-Windows editors) have attempted to indent your recipe lines with spaces instead of a tab character. In this case, make will use the second form of the error above. Remember that every line in the recipe must begin with a tab character. 所以应该就是版本不同对tab的检查不同导致的吧。当然,我还没验证。因为貌似现在换GNU make版本挺麻烦的。手头方便的同鞋帮忙验证一下吧。
      lance10年前 (2014-11-07)回复
      • 试过了,编译3.79版本的gnu make,也是报一样的错误。检查机制难道被修正了?还是说我们俩问题的原因不一样?
        lance10年前 (2014-11-07)回复
88 queries in 0.171 seconds, using 22.20MB memory