打印
[AVR单片机]

make: *** No rule to make target `main.elf', needed by `elf'. Stop.

[复制链接]
15645|8
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
donkey89|  楼主 | 2010-1-7 20:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
代码能顺利编译的,但是拷贝到另外一个目录就不行了,提示
make: *** No rule to make target `main.elf', needed by `elf'.  Stop.
我检查了,makefile没有使用绝对目录
# Hey Emacs, this is a -*- makefile -*-
#----------------------------------------------------------------------------
# WinAVR Makefile Template written by Eric B. Weddington, J鰎g Wunsch, et al.
#
# Released to the Public Domain
#
# Additional material for this makefile was written by:
# Peter Fleury
# Tim Henigan
# Colin O'Flynn
# Reiner Patommel
# Markus Pfaff
# Sander Pool
# Frederik Rouleau
# Carlos Lamas
#
#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device, using avrdude.
#                Please customize the avrdude settings below first!
#
# make debug = Start either simulavr or avarice as specified for debugging,
#              with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
#                   bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------


# MCU name
MCU = atmega8


# Processor frequency.
#     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.
#     Typical values are:
#         F_CPU =  1000000
#         F_CPU =  1843200
#         F_CPU =  2000000
#         F_CPU =  3686400
#         F_CPU =  4000000
#         F_CPU =  7372800
#         F_CPU =  8000000
#         F_CPU = 11059200
#         F_CPU = 14745600
#         F_CPU = 16000000
#         F_CPU = 18432000
#         F_CPU = 20000000
F_CPU = 7372800


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


# Target file name (without extension).
TARGET = main


# Object files directory
#     To put object files in current directory, use a dot (.), do NOT make
#     this an empty or blank macro!
OBJDIR = .


# List C source files here. (C dependencies are automatically generated.)
SRC = main.c  pwm.c uart/uart.c /trip_commands/trip_commands.c 1602/1602.c keys/key.c


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


# List Assembler source files here.
#     Make them always end in a capital .S.  Files ending in a lowercase .s
#     will not be considered source files but generated files (assembler
#     output from the compiler), and will be deleted upon "make clean"!
#     Even though the DOS/Win* filesystem matches both .s and .S the same,
#     it will preserve the spelling of the filenames, and gcc itself does
#     care about how the name is spelled on its command-line.
ASRC =


# Optimization level, can be [0, 1, 2, 3, s].
#     0 = turn off optimization. s = optimize for size.
#     (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
OPT = s


# Debugging format.
#     Native formats for AVR-GCC's -g are dwarf-2 [default] or stabs.
#     AVR Studio 4.10 requires dwarf-2.
#     AVR [Extended] COFF format requires stabs, plus an avr-objcopy run.
DEBUG = dwarf-2


# List any extra directories to look for include files here.
#     Each directory must be seperated by a space.
#     Use forward slashes for directory separators.
#     For a directory that has spaces, enclose it in quotes.
EXTRAINCDIRS =

Makefile.rar

5.76 KB

相关帖子

沙发
wangwo| | 2010-1-9 00:02 | 只看该作者
楼主想干嘛?资料?

使用特权

评论回复
板凳
muslimsali| | 2010-1-9 12:10 | 只看该作者
注意中文路径

使用特权

评论回复
地板
thf2008| | 2010-1-9 22:22 | 只看该作者
注意中文路径
muslimsali 发表于 2010-1-9 12:10


哈哈,很幽默

使用特权

评论回复
5
香如故| | 2010-1-10 17:43 | 只看该作者
先make clear下,应该就可以了

使用特权

评论回复
6
donkey89|  楼主 | 2010-1-10 19:48 | 只看该作者
已经解决了,版本管理的时候路径出了问题,导致缺了一个文件,多谢大家

使用特权

评论回复
7
mym_rainbow| | 2012-7-27 12:02 | 只看该作者
楼主怎么解决这个问题的,可否指教一下

使用特权

评论回复
8
mym_rainbow| | 2012-7-27 12:02 | 只看该作者
楼主怎么解决这个问题的,可否指教一下:)

使用特权

评论回复
9
bbslhb| | 2012-8-7 09:12 | 只看该作者
没解决问题的请确认一下:makefile里面制定的路径和源文件实际所在路径,肯定有不同的地方。
makefile里面的路径在这后面:
# List C source files here. (C dependencies are automatically generated.)
SRC =

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

241

主题

1609

帖子

1

粉丝