WinAVR(GCC)新手入门的makefile 范例 #这是一个简单makefile,仅用于初学者使用#修改于WINAVR20050214 所生成的makefile#简单实验只需更改 [单片机类型][目标文件名][C 源文件名][系统时钟频率]即可#修改好参数后另存到单片机程序所在目录,然后执行[make all]命令#生成 烧录 FLASH 的*.hex,烧录 EEPROM 的*.eep,调试用的*.elf 文件## MCU name # 单片机类型 参考格式是:atmega8 / at90s2313 / attiny15 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 = 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-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 Assembler source files here. # 汇编源文件名(不带路径,但扩展名 .sS 需大写,否则将会被 make clean 所误...