搜索
bottom↓
回复: 24

请教:GCC编译时,提示 “No rule to make target `all'. Stop.”是什么地方没设好

[复制链接]

出0入0汤圆

发表于 2005-8-30 09:37:25 | 显示全部楼层 |阅读模式
我是刚刚开始学习AVR和GCC。看了网站的AVRGCC入门开始试试,编译时出现如下提示

H:\WinAVR\utils\bin\make.exe: *** No rule to make target `all'.  Stop.

GCC是本网站的20050214



请多多指教

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

曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……

出0入0汤圆

发表于 2005-8-30 11:18:37 | 显示全部楼层
是makefile的原因。因为用旧版本的makefile,里面没有make all的选项。

建议用mfile重新生成makefile,替代原来的makefile,就可以了。

出0入0汤圆

 楼主| 发表于 2005-8-30 12:45:25 | 显示全部楼层
我重新生成了,还是不行。请指教,具体如何做

出0入0汤圆

发表于 2005-8-30 13:00:58 | 显示全部楼层
把例子贴上来吧,这样清楚些...

出0入0汤圆

 楼主| 发表于 2005-8-30 13:35:26 | 显示全部楼层
程序

void main()

{

DDRB=0XFF;

while(1)

  {

   PORTB=0xF0;

  }

}

出0入0汤圆

发表于 2005-8-30 13:38:51 | 显示全部楼层
恐怕 LZ 没有生成 makefile 吧?

出0入0汤圆

 楼主| 发表于 2005-8-30 13:47:17 | 显示全部楼层
我刚刚接触,不太懂。怎么生成

出0入0汤圆

 楼主| 发表于 2005-8-30 13:49:38 | 显示全部楼层
我是用MFile选了CPU、改了晶振频率、输出格式后就SAVE了。

出0入0汤圆

 楼主| 发表于 2005-8-30 13:52:28 | 显示全部楼层
LZ是什么,怎么用。还有makefile文件应该放在哪个目录下

出0入0汤圆

发表于 2005-8-30 14:07:51 | 显示全部楼层
LZ 就是 LouZhu楼主

makefile 文件放在C文件所在目录。



最起码要修改以下参数:



# MCU name

# 单片机类型

MCU = atmega16





# Processor frequency.

# 系统时钟频率(Hz),用于生成延时 _delay_us() _delay_ms() 见delay.h

#     This will define a symbol, F_CPU, in all source code files equal to the

#     processor frequency. You can then use this symbol in your source code to

#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done

#     automatically to create a 32-bit value in your source code.

F_CPU = 8000000



# Target file name (without extension).

# 目标文件名(即生成的.hex/.eep/.elf的文件名)

TARGET = main



# List C source files here. (C dependencies are automatically generated.)

# C源文件名(不带路径)

# 多个文件名间用空格隔开 例如 SRC = file1.c file2.c file3.c

# 不需要加上 h头文件

SRC = main.c

出0入0汤圆

 楼主| 发表于 2005-8-30 14:20:57 | 显示全部楼层
以下是makefile的部分内容



# MCU name

MCU = atmega16



# Processor frequency.

F_CPU = 11.0592





# Output format. (can be srec, ihex, binary)

FORMAT = ihex





# Target file name (without extension).

TARGET = t1





# List C source files here. (C dependencies are automatically generated.)

SRC = t1.c

出0入0汤圆

发表于 2005-8-30 14:24:34 | 显示全部楼层
# Processor frequency.

# 系统时钟频率(Hz),用于生成延时 _delay_us() _delay_ms() 见delay.h  

#     This will define a symbol, F_CPU, in all source code files equal to the  

#     processor frequency. You can then use this symbol in your source code to  

#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done

#     automatically to create a 32-bit value in your source code.

F_CPU = 11059200



不可能还出错?

重装吧。

出0入0汤圆

 楼主| 发表于 2005-8-30 14:30:14 | 显示全部楼层
谢谢,马上重装

出0入0汤圆

 楼主| 发表于 2005-8-30 14:48:22 | 显示全部楼层
谢谢,重装后,可以用了,十分感谢

出0入0汤圆

发表于 2005-8-31 10:24:29 | 显示全部楼层
新手,我也遇到这样的问题,看了各位的回复解决了,把makefile文件放在C文件所在目录。
头像被屏蔽

出0入0汤圆

发表于 2005-8-31 10:39:04 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽

出0入0汤圆

发表于 2006-9-11 20:46:18 | 显示全部楼层
我在用winAVR 的时候也遇到同样的问题,只是我编译的是工程文件,在编译时出现:



make.exe: *** No rule to make target `../ee.c', needed by `ee.o'.  Stop.



> Process Exit Code: 2

> Time Taken: 00:00



其中,ee.c是项目工程中的一个.C文件

请各位多多指教!谢谢!

出0入0汤圆

发表于 2006-9-11 22:00:03 | 显示全部楼层
在仔细理解以上各位LZ的解释后,问题解决了!

在按上述方法生成了makefile后,必须把它(makefile)放在相应的工程文件的C文件中!再编译,即可!

出0入0汤圆

发表于 2006-9-11 22:23:53 | 显示全部楼层
但是,只能编译工程中单个文件,如main.c

而main.c中应用的包含文件(如include "public.h",自己定义的)它就是说没有

列出:

Main.c:10:20: public.h: No such file or directory

出0入0汤圆

发表于 2006-12-19 16:28:09 | 显示全部楼层
make.exe: *** No rule to make target `obj/main.o', needed by `cs.elf'.  Stop.

请教是什么意思?

出0入0汤圆

发表于 2007-1-12 12:20:26 | 显示全部楼层
> "make.exe" all



-------- begin --------

avr-gcc (GCC) 3.4.6

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.



make.exe: *** No rule to make target `obj/main.o', needed by `aa.c.elf'.  Stop.



> Process Exit Code: 2

> Time Taken: 00:00

出0入0汤圆

发表于 2009-12-2 12:04:29 | 显示全部楼层
学习了!

出0入0汤圆

发表于 2010-11-18 15:30:29 | 显示全部楼层
mark

出0入0汤圆

发表于 2010-11-18 22:43:44 | 显示全部楼层
mark

出0入0汤圆

发表于 2011-11-9 12:53:51 | 显示全部楼层
mark
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-6-3 10:20

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

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