- 1、本文档共14页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
WinAVR(GCC)新手入门的makefile范例
#这是一个简单makefile,仅用于初学者使用#修改于WINAV生成的makefile#简单实验只需更改 [单片机类型][目标文件名][C源文件名][系统时钟频率]即可#修改好参数后另存到单片机程序所在目录,然后执行[make all]命令#生成 烧录FLASH的*.hex,烧录EEPROM的*.eep,调试用的*.elf 文件##?????????
MCU name # 单片机类型 参考格式是:atmega8 / at90s2313 / attiny15MCU = 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 = 1000000
# 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 = $(TARGET).c
#**************后面内容基本不需要修改,除非你是老手*****************************#
# Output format. (can be srec, ihex, binary)# 输出烧录文件格式FORMAT = ihex
# 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-GCCs -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 Assembler source files here.# 汇编源文件名(不带路径,但扩展名 .sS 需大写,否则将会被make clean 所误删)# 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 =
# Hey Emacs, this is a -*- makefile -*-#-----
文档评论(0)