?? makefile
字號:
#
# Makefile for yampp-3/U test
#
# Jesper Hansen 2001-07-01
#
# 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
# library (.a) file creation command
AR= avr-ar rc
# second step in .a creation (use "touch" if not needed)
AR2= avr-ranlib
############################################################################################
############################################################################################
# CPU type
MCU = atmega161
# Target
TRG = yampp3u_test
# C-source files
SRC = printf.c memtest.c $(TRG).c
# Assembler source files
ASRC =
# Extra include dir
INC = ../yampp3lib
# Libraries
LIB = $(AVR)/avr/lib/libc.a ../yampp3lib/yampp3lib.a
# Compiler flags
CPFLAGS = -g -Os -Wall -Wstrict-prototypes -Wa,-ahlms=$(<:.c=.lst) -mcall-prologues -I$(INC)
# Assembler flags
ASFLAGS = -Wa,-gstabs,-a=$<.lst
# Linker flags
LDFLAGS = -Wl,-Map=$(TRG).map,--cref
############################################################################################
############################################################################################
#define all project specific object files
OBJ = $(ASRC:.asm=.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).hex $(TRG).bin
#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 : %asm
$(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) $< $@
%hex: %elf
$(BIN) -O ihex $< $@
%bin: %elf
$(BIN) -O binary $< $@
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 ###################
printf.o : printf.c printf.h Constants.h makefile
memtest.o : memtest.c memtest.h Constants.h makefile
$(TRG).o : $(TRG).c types.h Constants.h makefile
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -