⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 yampp的MP3资料 非常好大家来看一看
💻
字号:
#
# Makefile for yampp-3
#
# Jesper Hansen 2001-05-22
#


# Tools and directories
CC		= avr-gcc
AS		= avr-gcc -x assembler-with-cpp	
RM		= rm -f
RN		= mv
BIN		= avr-objcopy
INCDIR	= .
LIBDIR	= $(AVR)/avr/lib
SHELL   = $(AVR)/bin/sh.exe
FORMAT  = srec


############################################################################################
############################################################################################

	
# CPU type
MCU = at90s8515

# Target
TRG	= yampp3

# C-source files
SRC	= vs1001.c rec80.c lcd.c fat.c ata_if.c delay.c uart.c $(TRG).c

# Assembler source files
ASRC    =

# Libraries 
LIB = $(AVR)/avr/lib/libc.a

# Compiler flags
CPFLAGS	=  -g -O3 -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst) -mcall-prologues

# Assembler flags
ASFLAGS = -Wa,-gstabs

# Linker flags
LDFLAGS = -Wl,-Map=$(TRG).map,--cref


############################################################################################
############################################################################################

#define all project specific object files
	OBJ	= $(ASRC:.s=.o) $(SRC:.c=.o)
	CPFLAGS += -mmcu=$(MCU)
	ASFLAGS += -mmcu=$(MCU)
	LDFLAGS += -mmcu=$(MCU)

	  
#this defines the aims of the make process
all:	$(TRG).obj $(TRG).elf $(TRG).rom $(TRG).eep


#compile: instructions to create assembler and/or object files from C source
%o : %c 
	$(CC) -c $(CPFLAGS) -I$(INCDIR) $< -o $@

%s : %c
	$(CC) -S $(CPFLAGS) -I$(INCDIR) $< -o $@

#assemble: instructions to create object file from assembler files
%o : %s
	$(AS) -c $(ASFLAGS) -I$(INCDIR) $< -o $@


#link: instructions to create elf output file from object files
%elf: $(OBJ)
	$(CC) $(OBJ) $(LIB) $(LDFLAGS) -o $@

#create avrobj file from elf output file
%obj: %elf
	$(BIN) -O avrobj $< $@

#create bin (ihex, srec) file from elf output file
%rom: %elf
	$(BIN) -O $(FORMAT) $< $@

%eep: %elf
	$(BIN) -j .eeprom --set-section-flags=.eeprom="alloc,load" -O $(FORMAT) $< $@
	avr-size $(TRG).elf


#make instruction to delete created files
clean:
	$(RM) $(OBJ)
	$(RM) $(TRG).map
	$(RM) $(TRG).elf
	$(RM) $(TRG).obj
	$(RM) $(TRG).eep
	$(RM) $(TRG).rom
	$(RM) *.bak
	$(RM) *.lst
	$(RM) *.?_sym


############################################################################################
############################################################################################

###### dependecies, add any dependencies you need here ###################

vs1001.o	: vs1001.c vs1001.h mem.h
rec80.o		: rec80.c rec80.h
lcd.o		: lcd.c lcd.h
ata_if.o	: ata_if.c ata_if.h
fat.o		: fat.c fat.h mem.h
uart.o 		: uart.c uart.h
delay.o		: delay.c delay.h
$(TRG).o	: $(TRG).c types.h mem.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -