hanfei69882

hanfei69882

2个粉丝

26

问答

0

专栏

2

资料

hanfei69882  发布于  2016-12-20 12:25:31
采纳率 0%
26个问答
3702

【已解决】makefile嵌套调用问题

 
本帖最后由 hanfei69882 于 2016-12-20 16:28 编辑

目标:去除编译警告

在顶层makefile里面编译子目录下的代码会有警告,调用方法如下
$(MAKE) -C $(OSDRV_DIR)/tools/board/reg-tools-1.0.0  >/dev/null

在shell窗口进入目录直接make命令是没有警告的

头疼几天了,有明白的朋友指点一下:handshake

警告log如下
[code]make -C /home/fly/share/trunk/osdrv/tools/board/reg-tools-1.0.0  >/dev/null
source/tools/hil2s.c: In function ‘hil2s’:
source/tools/hil2s.c:123:3: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
   second = atoi(argv[1]);
   ^
source/tools/i2c_ops.c: In function ‘i2c_read’:
source/tools/i2c_ops.c:79:3: warning: passing argument 2 of ‘StrToNumber’ from incompatible pointer type [enabled by default]
   if (StrToNumber(argv, &tmp)) {
   ^
In file included from source/tools/i2c_ops.c:12:0:
include/utils/strfunc.h:33:19: note: expected ‘U32 *’ but argument is of type ‘unsigned int *’
EXTERNFUNC HI_RET StrToNumber(IN CHAR *str , OUT U32 * ulValue);
                   ^
source/tools/i2c_ops.c: In function ‘i2c_write’:
source/tools/i2c_ops.c:202:3: warning: passing argument 2 of ‘StrToNumber’ from incompatible pointer type [enabled by default]
   if (StrToNumber(argv, &tmp)) {
   ^
In file included from source/tools/i2c_ops.c:12:0:
include/utils/strfunc.h:33:19: note: expected ‘U32 *’ but argument is of type ‘unsigned int *’
EXTERNFUNC HI_RET StrToNumber(IN CHAR *str , OUT U32 * ulValue);
                   ^
source/tools/ssp_rw.c: In function ‘ssp_read’:
source/tools/ssp_rw.c:322:3: warning: passing argument 1 of ‘reverse8’ from incompatible pointer type [enabled by default]
   reverse8(&tmp, 1);
   ^
source/tools/ssp_rw.c:131:6: note: expected ‘unsigned char *’ but argument is of type ‘int *’
void reverse8(unsigned char *buf, unsigned int len)
      ^
[/code]

直接make log如下
[code]osdrv/tools/board/reg-tools-1.0.0$ make V=1
arm-hisiv300-linux-gcc -o "btools"  source/hi_message.o source/hi_thread.o source/hi_dbg.o source/cmdshell.o source/argparser.o source/strfunc.o source/memmap.o   -lpthread -lrt  -mcpu=arm926ej-s   source/btools.o  source/himd.o source/himm.o source/himc.o source/hivd.o source/hiddrs.o source/hil2s.o source/hii2c.o source/i2c_ops.o source/ssp_rw.o
arm-hisiv300-linux-strip btools
ln -s btools himd
ln -s btools himd.l
ln -s btools himm
ln -s btools himc
ln -s btools hiddrs
ln -s btools hil2s
ln -s btools hier
ln -s btools hiew
ln -s btools i2c_read
ln -s btools i2c_write
ln -s btools ssp_read
ln -s btools ssp_write
mkdir -p bin/
mv hi* bin
mv i2c* bin
mv ssp* bin
mv btools bin
[/code]
我来回答
回答1个
时间排序
认可量排序

hanfei69882

2个粉丝

26

问答

0

专栏

2

资料

hanfei69882 2016-12-20 16:28:05
认可0
已解决,没有clean的问题:L
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区