Makefile:33: *** mixed implicit and normal rules: deprecated syntax

转载/参考自:https://blog.csdn.net/sinat_24088685/article/details/51009472

在Ubuntu 18.04上编译一个以前的模块,发现会报错误信息

Makefile:33: *** mixed implicit and normal rules: deprecated syntax
make[4]: *** No rule to make target 'install'.  Stop.
原因
系统的make工具太新,make的旧版规则已经无法兼容新版。
解决方法
修改makefile里面的规则,例如
-   config %config: scripts_basic outputmakefile FORCE
+   %config: scripts_basic outputmakefile FORCE

解决方法二
考虑到有其他模块可能也会有旧版的make规则,于是决定降级make版本到3.81(当前版本为4.1)
$ wget ftp://ftp.gnu.org/gnu/make/make-3.81.tar.gz
$ tar -xvf make-3.81.tar.gz
$ cd make-3.81
$ ./configure
$ make
$ sudo make install

编译 make-3.81 的时候如果碰到编译问题 - undefined reference to `__alloca’
请参考http://gnu-make.2324884.n4.nabble.com/undefined-reference-to-alloca-td18308.html

diff --git a/glob/glob.c b/glob/glob.c 
   index f3911bc..8adbde3 100644 
   --- a/glob/glob.c 
   +++ b/glob/glob.c 
   @@ -208,7 +208,7 @@ my_realloc (p, n) 
     #endif /* __GNU_LIBRARY__ || __DJGPP__ */ 
   - #if !defined __alloca && !defined __GNU_LIBRARY__ 
   + #if !defined __alloca && defined __GNU_LIBRARY__ 
     # ifdef    __GNUC__ 
     #  undef alloca 

降级后重新登陆 Ubuntu 18 后可以看到 make 版本已经变成 3.81

$ make --version
GNU Make 3.81
Copyright (C) 2006  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.

This program built for x86_64-unknown-linux-gnu

你可能感兴趣的:(Makefile:33: *** mixed implicit and normal rules: deprecated syntax)