📄 makefile
字号:
# Hey Emacs, this is a -*- makefile -*-# On command line:## make all = Make software.## make clean = Clean out built project files.## make rebuild = Clean out built project files and make them again# Copyright (c) 2006, Atmel Corporation All rights reserved. ## Redistribution and use in source and binary forms, with or without# modification, are permitted provided that the following conditions are met:## 1. Redistributions of source code must retain the above copyright notice,# this list of conditions and the # following disclaimer. ## 2. Redistributions in binary form must reproduce the above copyright notice,# this list of conditions and the following disclaimer in the documentation# and/or other materials provided with the distribution.## 3. The name of ATMEL may not be used to endorse or promote products derived# from this software without specific prior written permission. ## THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND# SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # ********************************## SETTINGS## Alter the settings below to add or remove files from your project or other options## ********************************# C source filesSRC = usart.c usart_example.c# Project nameTARGET = usart_project# Optimization level, can be [0, 1, 2, 3, s]. OPT = 2# Set your target processorMCPU = ap7000# Set your jtag mkII port. i.e USB, /dev/ttyS0JTAG_PORT = USB# ** ** ENVIRONMENT SETTINGS ** **MAKE = makeCC = avr32-gccCC_FLAGS = -Wall -Werror -c -g -mcpu=$(MCPU) -O$(OPT) LD = avr32-gccLD_FLAGS = OBJCOPY = avr32-objcopyREMOVE = rm -rfOBJ = $(SRC:.c=.o)# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# USR RULES# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# default rule, build the projectall: gccversion build#clean upclean: clean_list#rebuild projectrebuild: clean_list gccversion build# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# MESSAGES DISPLAYED DURING PROCESS# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **MSG_BIN = Creating binary:MSG_CLEANING = Cleaning project:MSG_COMPILING = Compiling:MSG_LINKING = Linking:MSG_COPY = Copying:# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# END USR RULES# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# COMPILATION RULES. # ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# Link: create ELF output file from object files.build: $(OBJ) @echo $(MSG_LINKING) $(LD) $(OBJ) $(LD_FLAGS) -o $(TARGET).elf @echo @echo $(MSG_COPY) $(OBJCOPY) -O binary $(TARGET).elf $(TARGET).bin @echo# Compile: create object files from C source files.%.o: %.c @echo $(MSG_COMPILING) $(CC) $(CC_FLAGS) -o $@ $< @echo# Remove generated files clean_list: @echo @echo $(MSG_CLEANING) $(REMOVE) $(TARGET).elf $(REMOVE) $(TARGET).bin $(REMOVE) $(OBJ)#display gcc versiongccversion : @echo @$(CC) --version# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **# END# ** ** ** *** ** ** ** ** ** ** ** ** ** ** **
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -