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

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

Embedded crifan 9255浏览

【背景】

在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

84 queries in 0.617 seconds, using 19.30MB memory