搜索
bottom↓
回复: 11

自动生成Makefile的工具autotool-automake请教了!

[复制链接]

出0入0汤圆

发表于 2013-4-15 11:35:14 | 显示全部楼层 |阅读模式
看了两三天,还没弄好这个autotool真是郁闷。
目前的情况是知道了这个autotool生成Makefile的流程,试普通的例子都能行得通,但是现在要链接成arm能用的,就是不行。真是
走投无路了。.


之前已经成功的生成的Makefile

现在编译也能通过,

$CC=arm-linux-gcc CFLAGS="-Wall -g" ./configure –host=arm-linux        

此时虚拟机上已经有有arm-linux-gcc系统的编译工具
  

然后是make,就出这些错误了。。。。。。。。:::


[root@bogon uart_ask]# CC=arm-linux-gcc DEFS=-D CFLAGS="-Wall -g" ./configure --host=arm-linux
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-strip... arm-linux-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-gcc... arm-linux-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gcc accepts -g... yes
checking for arm-linux-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of arm-linux-gcc... gcc3
checking dependency style of arm-linux-gcc... gcc3
checking for arm-linux-ranlib... arm-linux-ranlib
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating inc/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
[root@bogon uart_ask]# make
make  all-recursive
make[1]: 进入目录“/share2win/project/uart_ask”
Making all in inc
make[2]: 进入目录“/share2win/project/uart_ask/inc”
make[2]: 对“all”无需做任何事。
make[2]: 离开目录“/share2win/project/uart_ask/inc”
make[2]: 进入目录“/share2win/project/uart_ask”
arm-linux-gcc -DHAVE_CONFIG_H -I. -I /share2win/project/uart_ask    -Wall -g -MT uart.o -MD -MP -MF .deps/uart.Tpo -c -o uart.o uart.c
uart.c:1:18: fatal error: regs.h: No such file or directory
compilation terminated.
make[2]: *** [uart.o] 错误 1
make[2]: 离开目录“/share2win/project/uart_ask”
make[1]: *** [all-recursive] 错误 1
make[1]: 离开目录“/share2win/project/uart_ask”
make: *** [all] 错误 2
[root@bogon uart_ask]#





真心求指导~~~~

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

 楼主| 发表于 2013-4-15 12:15:40 | 显示全部楼层
顶起啊,没有具体解决办法,也可以提提意见嘛

出0入0汤圆

发表于 2013-4-15 15:27:23 | 显示全部楼层
CC=arm-linux-gcc CFLAGS="-Wall -g" ./configure –host=arm-linux    && make

出0入0汤圆

 楼主| 发表于 2013-4-15 16:38:40 | 显示全部楼层
abnerle 发表于 2013-4-15 15:27
CC=arm-linux-gcc CFLAGS="-Wall -g" ./configure –host=arm-linux    && make

就是make后才有一堆错误,。Makefile是生成了 的

出0入0汤圆

发表于 2013-4-15 16:43:23 | 显示全部楼层
jjvip136 发表于 2013-4-15 16:38
就是make后才有一堆错误,。Makefile是生成了 的

makefile应该还是有问题,才提示对all没有规则可执行

出0入0汤圆

发表于 2013-4-15 17:13:27 | 显示全部楼层
原来还有自动生成makefile的工具啊,我是新手,长见识了,回去玩下看

出0入0汤圆

发表于 2013-4-15 17:18:04 | 显示全部楼层
CC=arm-linux-gcc DEFS=-D CFLAGS="-Wall -g" ./configure --host=arm-linux 加到Makefile里面去啊.最好把Makefile发上来看看吧.

出0入0汤圆

 楼主| 发表于 2013-4-15 17:56:15 | 显示全部楼层
笑笑我笑了 发表于 2013-4-15 17:18
CC=arm-linux-gcc DEFS=-D CFLAGS="-Wall -g" ./configure --host=arm-linux 加到Makefile里面去啊.最好把 ...

好~~~整个都搞上来了,欢迎大家指导 

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x

出0入0汤圆

发表于 2013-4-15 18:03:51 | 显示全部楼层
jjvip136 发表于 2013-4-15 17:56
好~~~整个都搞上来了,欢迎大家指导 

总共要编译的文件就那么几个啊.建议自己吧.或者用下面这个改一下吧,这个是用来编译STM32F3的
  1. # put your *.o targets here, make should handle the rest!
  2. SRCS = main.c stm32f30x_it.c system_stm32f30x.c

  3. # all the files will be generated with this name (main.elf, main.bin, main.hex, etc)

  4. PROJ_NAME=main

  5. # that's it, no need to change anything below this line!

  6. ###################################################

  7. export CC=arm-none-eabi-gcc
  8. export LD=arm-none-eabi-gcc
  9. export AR=arm-none-eabi-ar
  10. export AS=arm-none-eabi-as
  11. export OBJCOPY=arm-none-eabi-objcopy
  12. export RANLIB=arm-none-eabi-ranlib

  13. export LDFLAGS=-Wl,-T,stm32f30_flash.ld -L../FWLib -lstm32f3
  14. #export CFLAGS=-g -O1 -c -nostdlib -fno-common
  15. #CFLAGS += -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mthumb-interwork -mlittle-endian -mfpu=fpv4-sp-d16
  16. #CFLAGS += -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DMANGUSTA_DISCOVERY -DHSE_VALUE=8000000
  17. export CFLAGS=-g -O2
  18. CFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
  19. CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
  20. CFLAGS += -ffreestanding -nostdlib
  21. CFLAGS += -DSTM32F30X

  22. #CWD = $(shell pwd)
  23. #export ROOT=$(CWD)
  24. #export LIB_ROOT=$(ROOT)/lib

  25. ###################################################

  26. vpath %.c ../FWLib/src

  27. CFLAGS += -I../FWLib/inc -I../CMSIS/Include
  28. CFLAGS += -I../USER -I../CMSIS/Device/ST/STM32F30x/Include

  29. SRCS += ../STARTCODE/startup_stm32f30x.s # add startup file to build

  30. OBJS = $(SRCS:.c=.o)

  31. ###################################################

  32. .PHONY: proj

  33. all:         proj


  34. lib:
  35.         $(MAKE) -C lib

  36. proj:         $(PROJ_NAME).elf

  37. $(PROJ_NAME).elf: $(SRCS)
  38.         $(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)
  39. #        $(LD) $(LDFLAGS) --verbose -o $@ $(OBJS) -lstm32f4
  40.         $(OBJCOPY) -O ihex $(PROJ_NAME).elf $(PROJ_NAME).hex
  41.         $(OBJCOPY) -O binary $(PROJ_NAME).elf $(PROJ_NAME).bin

  42. clean:
  43.         rm -f *.o
  44.         rm -f $(PROJ_NAME).elf
  45.         rm -f $(PROJ_NAME).hex
  46.         rm -f $(PROJ_NAME).bin
复制代码

出0入0汤圆

发表于 2013-4-15 18:04:48 | 显示全部楼层
这么简单的东西没有必要configure吧,直接写个makefile就行了

出0入0汤圆

 楼主| 发表于 2013-4-15 18:27:47 | 显示全部楼层
笑笑我笑了 发表于 2013-4-15 18:03
总共要编译的文件就那么几个啊.建议自己吧.或者用下面这个改一下吧,这个是用来编译STM32F3的 ...

好吧。精力不集中在这里了,纯浪费时间,按你说的去搞

出0入0汤圆

 楼主| 发表于 2013-4-15 18:28:12 | 显示全部楼层
abnerle 发表于 2013-4-15 18:04
这么简单的东西没有必要configure吧,直接写个makefile就行了

自己也可以写出来,主要是有点牛角尖了,想搞明白这鸟东东
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-23 13:10

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表