📄 makefile
字号:
# MCU name # 单片机类型 参考格式是:atmega8 / at90s2313 / attiny15#MCU = atmega8 MCU_TARGET = atmega8# 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# 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 PRG = mainOBJ = main.oOPTIMIZE = -O2DEFS =LIBS =# You should not have to change anything below here.CC = avr-gcc# Override is only needed by avr-lib build system.override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS)override LDFLAGS = -Wl,-Map,$(PRG).mapOBJCOPY = avr-objcopyOBJDUMP = avr-objdumpall: $(PRG).elf lst text eeprom$(PRG).elf: $(OBJ) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)# dependency:main.o: main.c iocompat.hclean: rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak rm -rf *.lst *.map $(EXTRA_CLEAN_FILES)lst: $(PRG).lst%.lst: %.elf $(OBJDUMP) -h -S $< > $@# Rules for building the .text rom imagestext: hex bin srechex: $(PRG).hexbin: $(PRG).binsrec: $(PRG).srec%.hex: %.elf $(OBJCOPY) -j .text -j .data -O ihex $< $@%.srec: %.elf $(OBJCOPY) -j .text -j .data -O srec $< $@%.bin: %.elf $(OBJCOPY) -j .text -j .data -O binary $< $@# Rules for building the .eeprom rom imageseeprom: ehex ebin esrecehex: $(PRG)_eeprom.hexebin: $(PRG)_eeprom.binesrec: $(PRG)_eeprom.srec%_eeprom.hex: %.elf $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@%_eeprom.srec: %.elf $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O srec $< $@%_eeprom.bin: %.elf $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O binary $< $@# Every thing below here is used by avr-libc's build system and can be ignored# by the casual user.FIG2DEV = fig2devEXTRA_CLEAN_FILES = *.hex *.bin *.srecdox: eps png pdfeps: $(PRG).epspng: $(PRG).pngpdf: $(PRG).pdf%.eps: %.fig $(FIG2DEV) -L eps $< $@%.pdf: %.fig $(FIG2DEV) -L pdf $< $@%.png: %.fig $(FIG2DEV) -L png $< $@
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -