1 Star 0 Fork 1

huanglilong/stm32-nuttx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
makefile 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
huanglilong 提交于 2016-08-08 21:36 . add clean target
#
# author : huang li long <huanglilongwk@outlook.com>
# time : 2016/08/02
# brief : configure and build nuttx
#
.PHONY: archive firmware clean distclean upload
# get current top makefile's absolute path
export PATH_BASE := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
# include setup makefile
include $(PATH_BASE)/makefiles/setup.mk
# board
export BOARD := stm32f429discovery
# config
export CONGIF := nsh_romfs
# firmware file
FIRMWARE_BIN := $(BUILD_DIR)/firmware.bin
FIRMWARE_ELF := $(BUILD_DIR)/firmware.elf
# jobs
J ?= 4
# build nuttx and export
archive:$(NUTTX_EXPORT)
# config and export nuttx
$(NUTTX_EXPORT) : $(NUTTX_SRC)
@echo %
@echo % Configure Nuttx for $(BOARD)
@echo %
cd $(NUTTX_SRC)/configs && cp -rf $(PATH_BASE)/nuttx-configs/$(BOARD) .
cd $(NUTTX_SRC)/tools && ./configure.sh $(BOARD)/$(CONGIF)
@echo %
@echo % Build Nuttx for $(BOARD)
@echo %
$(MAKE) -r -j$(J) -C $(NUTTX_SRC) -r CONFIG_ARCH_BOARD=$(BOARD) export
mkdir -p $(BUILD_DIR)
cp -rf $(NUTTX_SRC)/nuttx-export.zip $@
cd $(NUTTX_SRC)/configs && rm -rf $(BOARD)
# build firmware
firmware:
@echo %%%%
@echo %%%% Building firmware
@echo %%%%
mkdir -p $(BUILD_DIR)
$(MAKE) -r -C $(BUILD_DIR) \
-f $(MAKEFILE_DIR)/firmware.mk \
firmware
# clean firmware
clean:
@echo %
@echo % Clean firmware
@echo %
@rm -rf $(BUILD_SRC_DIR)
# clean firmware, archive and configure
distclean:
@echo %
@echo % Clean firmware, archive and configure
@echo %
@rm -rf $(BUILD_DIR)
$(MAKE) -r -j$(J) -C $(NUTTX_SRC) distclean
# upload firmware
upload:
st-flash write $(FIRMWARE_BIN) 0x8000000
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/huanglilong/stm32-nuttx.git
git@gitee.com:huanglilong/stm32-nuttx.git
huanglilong
stm32-nuttx
stm32-nuttx
master

搜索帮助