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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值