From 09c1fa76b04bdfba8266c34000cd12cda8fff91f Mon Sep 17 00:00:00 2001 From: Jimmy Date: Mon, 24 Aug 2020 12:33:09 +0800 Subject: [PATCH] improve qmk documentation --- board/TencentOS_tiny_EVB_MX_Plus/BSP/Makefile | 4 ++-- ..._Qmk_A_Makefile_Framework_For_TencentOS.md | 21 ++++++++++++++----- platform/hal/Makefile | 4 ++-- platform/vendor_bsp/Makefile | 4 ++-- qmk/generic/Make.debug | 2 +- qmk/generic/Make.depend | 2 +- qmk/generic/Make.exec | 2 +- qmk/generic/Make.lib | 2 +- qmk/generic/Make.subdirs | 2 +- qmk/generic/Make.tools | 2 +- qmk/generic/Make.tpl | 4 +--- 11 files changed, 29 insertions(+), 20 deletions(-) diff --git a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Makefile b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Makefile index 3939796b..c607bc93 100644 --- a/board/TencentOS_tiny_EVB_MX_Plus/BSP/Makefile +++ b/board/TencentOS_tiny_EVB_MX_Plus/BSP/Makefile @@ -30,13 +30,13 @@ subdirs= ifneq (help,$(findstring help,$(MAKECMDGOALS))) ifeq (, $(strip ${BP})) -$(error when compile arch/, must specify BP and BSP_LSRCS obviously , see `make help`) +$(error when compile BSP/, must specify BP obviously , see `make help`) endif include ${QTOP}/qmk/board-pack/bp.${BP} ifeq (,$(strip ${BSP_LSRCS})) -$(error when compile arch/, must specify BP and BSP_LSRCS obviously , see `make help`) +$(error when compile BSP/, must specify BSP_LSRCS on your bp.${BP}, see `make help`) endif endif diff --git a/doc/qmk/01. Intro_Qmk_A_Makefile_Framework_For_TencentOS.md b/doc/qmk/01. Intro_Qmk_A_Makefile_Framework_For_TencentOS.md index 06c31b01..c874e4a4 100644 --- a/doc/qmk/01. Intro_Qmk_A_Makefile_Framework_For_TencentOS.md +++ b/doc/qmk/01. Intro_Qmk_A_Makefile_Framework_For_TencentOS.md @@ -4,7 +4,7 @@ ### Qmk 是什么 -qmk, 是TecentOS的一个Makefile编译框架。 +[qmk](../../qmk), 是TecentOS的一个Makefile编译框架。 ### Qmk 的特点 - 使用简单,任意目录均可make,支持帮助`make help`; @@ -77,6 +77,16 @@ make help 要求对所有board、所有gcc-toolchain、cpu、arch、bsp适用。 所以一般只包含通用的规则。 +| 模板文件 |说明| +| :-------- |:------| +|[Make.tpl](../../qmk/generic/Make.tpl) | 一个目录或者多个目录编译成`.a`的通用模板 | +|[Make.exec](../../qmk/generic/Make.exec) | 多个`.a`链接成 `elf`,生成`.bin`的通用模板 | +|[Make.lib](../../qmk/generic/Make.lib) | 处理多个`.o`生成`.a`的通用模板| +|[Make.subdirs](../../qmk/generic/Make.subdirs) | 处理 make递归进入多个subdir make的通用模板| +|[Make.depend](../../qmk/generic/Make.depend) | 处理 一个`.o`依赖多个`.h`,的规则模板 | +|[Make.debug](../../qmk/generic/Make.debug) | 用于调试Makefile的模板| +|[Make.tools](../../qmk/generic/Make.debug) | 用于屏蔽在多种OS使用qmk,sed、等基础shell/cli命令路径不同 | + ### boardpack-Makefile(mk/board-pack) `board-pack/bp.TencentOS_tiny_EVB_MX_Plus` 属于这类。 @@ -309,25 +319,26 @@ board-pack 是对 board 在编译时的一个抽象。 ## qmk的 make 命令行参数 -```cookie +```shell make help ``` ### make V=1 E=1 -```cookie +```shell # verbose打印编译时的命令 make V=1 # 调试头文件包含,宏扩展时很有用,会在生成`.o`文件的同时生成`.i`预处理文件 make E=1 ``` -```cookie +```shell # verbose打印链接时的库搜索过程 make V=2 make V=3 ``` ## 调试Makefile -```cookie +```shell #进入含Makefile的目录 make BP=TencentOS_tiny_EVB_MX_Plus dm ``` + ## Qmk 后续 diff --git a/platform/hal/Makefile b/platform/hal/Makefile index 84b75b68..f320f8b4 100644 --- a/platform/hal/Makefile +++ b/platform/hal/Makefile @@ -30,13 +30,13 @@ subdirs= ifneq (help,$(findstring help,$(MAKECMDGOALS))) ifeq (, $(strip ${BP})) -$(error when compile arch/, must specify BP obviously , see `make help`) +$(error when compile platform/, must specify BP obviously , see `make help`) endif include ${QTOP}/qmk/board-pack/bp.${BP} ifeq (,$(strip ${PLATFORM_HAL_LSRCS})) -$(error when compile arch/, must specify PLATFORM_HAL_LSRCS on your bp.${BP} , see `make help`) +$(error when compile platform/, must specify PLATFORM_HAL_LSRCS on your bp.${BP} , see `make help`) endif endif diff --git a/platform/vendor_bsp/Makefile b/platform/vendor_bsp/Makefile index c5546e2d..1ac234ed 100644 --- a/platform/vendor_bsp/Makefile +++ b/platform/vendor_bsp/Makefile @@ -30,13 +30,13 @@ subdirs= ifneq (help,$(findstring help,$(MAKECMDGOALS))) ifeq (, $(strip ${BP})) -$(error when compile arch/, must specify BP obviously, see `make help`) +$(error when compile platform/, must specify BP obviously, see `make help`) endif include ${QTOP}/qmk/board-pack/bp.${BP} ifeq (,$(strip ${PLATFORM_VENDOR_BSP_LSRCS})) -$(error when compile arch/, must specify PLATFORM_VENDOR_BSP_LSRCS on your bp.${BP}, see `make help`) +$(error when compile platform/, must specify PLATFORM_VENDOR_BSP_LSRCS on your bp.${BP}, see `make help`) endif endif diff --git a/qmk/generic/Make.debug b/qmk/generic/Make.debug index 9c58b2e4..64389a06 100644 --- a/qmk/generic/Make.debug +++ b/qmk/generic/Make.debug @@ -1,5 +1,5 @@ # QMK for TencentOS -# @author Jimmin.huang jimmin@163.com +# @author Jimmin.huang jimminh@163.com # Makefile template # aim for debug makefile ######################################################################## diff --git a/qmk/generic/Make.depend b/qmk/generic/Make.depend index f68c644a..0f89af19 100644 --- a/qmk/generic/Make.depend +++ b/qmk/generic/Make.depend @@ -1,5 +1,5 @@ # QMK for TencentOS -# @author Jimmin.huang jimmin@163.com +# @author Jimmin.huang jimminh@163.com # Makefile template ######################################################################## diff --git a/qmk/generic/Make.exec b/qmk/generic/Make.exec index 027a1b87..6b876400 100644 --- a/qmk/generic/Make.exec +++ b/qmk/generic/Make.exec @@ -1,5 +1,5 @@ # QMK for TencentOS -# @author Jimmin.huang jimmin@163.com +# @author Jimmin.huang jimminh@163.com ######################################################################## # Make rules/targets for handling user application diff --git a/qmk/generic/Make.lib b/qmk/generic/Make.lib index 77806d3f..52cb9ca8 100644 --- a/qmk/generic/Make.lib +++ b/qmk/generic/Make.lib @@ -1,5 +1,5 @@ # QMK for TencentOS -# @author Jimmin.huang jimmin@163.com +# @author Jimmin.huang jimminh@163.com # Makefile template ######################################################################## diff --git a/qmk/generic/Make.subdirs b/qmk/generic/Make.subdirs index b4305163..d946f818 100644 --- a/qmk/generic/Make.subdirs +++ b/qmk/generic/Make.subdirs @@ -1,5 +1,5 @@ # QMK for TencentOS -# @author Jimmin.huang jimmin@163.com +# @author Jimmin.huang jimminh@163.com # Makefile template ######################################################################## diff --git a/qmk/generic/Make.tools b/qmk/generic/Make.tools index d294bff7..1d082277 100644 --- a/qmk/generic/Make.tools +++ b/qmk/generic/Make.tools @@ -1,5 +1,5 @@ # QMK for TencentOS -# @author Jimmin.huang jimmin@163.com +# @author Jimmin.huang jimminh@163.com # Makefile template ######################################################################## diff --git a/qmk/generic/Make.tpl b/qmk/generic/Make.tpl index 5b40566d..73e3256d 100644 --- a/qmk/generic/Make.tpl +++ b/qmk/generic/Make.tpl @@ -1,5 +1,5 @@ # QMK for TencentOS -# @author Jimmin.huang jimmin@163.com +# @author Jimmin.huang jimminh@163.com # Makefile template ######################################################################## @@ -104,8 +104,6 @@ else BLDDIR = ${BLDROOT} endif -LIBDIR = ${BLDROOT} - #