3 Star 1 Fork 1

Arthur Zheng/TheaBoot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 6.29 KB
一键复制 编辑 原始数据 按行查看 历史
Arthur Zheng 提交于 2018-08-08 12:54 . 添加f4版本,USB
#--------------------------------------------------------------------------------------------------#
# TheaBoot #
# Copyright (c) 2018 YiQiChuang(ShanXi) Electronic Technology CO,LTD. #
# Copyright (c) 2012-2014 PX4 Development Team. #
# #
# This file is part of TheaBoot project. #
# #
# File : makeifle #
# Brief : #
# Author : Arthur Zheng #
# Email : 15034186698@163.com #
# Version : 1.1.0.0 #
# Date : 2018/07/15 #
# #
#--------------------------------------------------------------------------------------------------#
# Remark : #
#--------------------------------------------------------------------------------------------------#
# Change History : #
# <Date> | <Version> | <Author> | <Description> #
#--------------------------------------------------------------------------------------------------#
# 2017/01/27 | 1.0.0.0 | Arthur Zheng | Create file #
# 2018/07/15 | 1.1.0.0 | Arthur Zheng | Restyle the structure of project #
#--------------------------------------------------------------------------------------------------#
# Lisense : BSD 3-Clause #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR #
# CONTRIBUTORS 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. #
#--------------------------------------------------------------------------------------------------#
#---------------------------------------------------------------------------------------------------
# 路径设定
#---------------------------------------------------------------------------------------------------
export BUILD_DIR_ROOT ?= build
export BL_BASE ?= $(wildcard .)
export LIBOPENCM3 ?= $(wildcard libopencm3)
MKFLAGS=--no-print-directory
#---------------------------------------------------------------------------------------------------
# 工具链设定
#---------------------------------------------------------------------------------------------------
export CC = arm-none-eabi-gcc
export OBJCOPY = arm-none-eabi-objcopy
#---------------------------------------------------------------------------------------------------
# 公共配置
#---------------------------------------------------------------------------------------------------
export FLAGS = -std=gnu99 -Os -g -Wundef -Wall -fno-builtin -fgnu89-inline\
-I$(LIBOPENCM3)/include -ffunction-sections -nostartfiles\
-lnosys -Wl,-gc-sections -Wl,-g \
-Werror
export COMMON_SRCS = bl.c
export ARCH_SRCS = cdcacm.c usart.c
#---------------------------------------------------------------------------------------------------
# 构建对象
#---------------------------------------------------------------------------------------------------
TARGETS = \
STM32F103_WARSHIP_V2_0 \
STM32F429_DISCO
all: $(TARGETS) sizes
clean:
cd libopencm3 && make --no-print-directory clean && cd ..
rm -f *.elf *.bin *.hex
rm -rf build
#---------------------------------------------------------------------------------------------------
# 对象构建指令
#---------------------------------------------------------------------------------------------------
STM32F103_WARSHIP_V2_0: $(MAKEFILE_LIST) $(LIBOPENCM3)
make ${MKFLAGS} -f Makefile.f1 TARGET_HW=STM32F103_WARSHIP_V2_0 LINKER_FILE=stm32f1.ld TARGET_FILE_NAME=$@
STM32F429_DISCO: $(MAKEFILE_LIST) $(LIBOPENCM3)
make ${MKFLAGS} -f Makefile.f4 TARGET_HW=STM32F429_DISCO LINKER_FILE=stm32f4.ld TARGET_FILE_NAME=$@
#---------------------------------------------------------------------------------------------------
# libopencm3构建
#---------------------------------------------------------------------------------------------------
.PHONY: $(LIBOPENCM3)
$(LIBOPENCM3):
make -C $(LIBOPENCM3) lib
#---------------------------------------------------------------------------------------------------
# 显示文件大小
#---------------------------------------------------------------------------------------------------
.PHONY: sizes
sizes:
@-find build/*/ -name '*.elf' -type f | xargs size 2> /dev/null || :
#********* Copyright (C) 2018 YiQiChuang(ShanXi) Electronic Technology CO,LTD *****END OF FILE****#
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/zhengyangliu/TheaBoot.git
git@gitee.com:zhengyangliu/TheaBoot.git
zhengyangliu
TheaBoot
TheaBoot
master

搜索帮助