顶层makefile

COMMON_TARGETS        := pan utils

COMMON_TARGETS    += tools testcases/ddt
COMMON_TARGETS    += testcases/kernel/timers
COMMON_TARGETS    += testcases/kernel/ipc
COMMON_TARGETS    += testcases/kernel/mem
COMMON_TARGETS    += testcases/kernel/lib
COMMON_TARGETS    += testcases/kernel/syscalls
COMMON_TARGETS    += testcases/kernel/security
COMMON_TARGETS    += testcases/kernel/sched
COMMON_TARGETS    += testcases/kernel/hotplug
COMMON_TARGETS    += testcases/misc/math
COMMON_TARGETS    += testcases/lib
COMMON_TARGETS    += testcases/realtime
COMMON_TARGETS    += testcases/cve
COMMON_TARGETS    += testcases/commands/keyctl

需要编译的目标,可以在此处注释掉,不进行编译,最终目标文件夹会小很多(只编译pan utils tools testcases/ddt 和testcases/lib 54MB)

all: $(addsuffix -all,$(COMMON_TARGETS)) Version

$(MAKE_TARGETS): lib-all

$(MAKE_TARGETS) include-all lib-all:
    $(MAKE) -C "$(subst -all,,$@)" \
        -f "$(abs_top_srcdir)/$(subst -all,,$@)/Makefile" all

先编译lib,之后按照COMMON_TARGETS  顺序逐一编译。

./testcases:

top_srcdir        ?= ..

include $(top_srcdir)/include/mk/env_pre.mk

FILTER_OUT_DIRS        := kdump

ifneq ($(WITH_OPEN_POSIX_TESTSUITE),yes)
FILTER_OUT_DIRS        += open_posix_testsuite
endif

ifneq ($(WITH_REALTIME_TESTSUITE),yes)
FILTER_OUT_DIRS        += realtime
endif

include $(top_srcdir)/include/mk/generic_trunk_target.mk # 包含generic_trunk_target.inc 中包含all:

./testcases/ddt:

top_srcdir        ?= ../..

include $(top_srcdir)/include/mk/env_pre.mk

include $(top_srcdir)/include/mk/generic_trunk_target.mk

./testcases/ddt/i2c_test_suite:

top_srcdir              ?= ../../..

include $(top_srcdir)/include/mk/env_pre.mk

KERNEL_DIR        := $(patsubst %/include,%,$(KERNEL_INC))
INSTALL_DIR             := testcases/bin/ddt

FILTER_OUT_DIRS         :=

# We don't want to copy over the Makefile
UNWANTED_FILES          := Makefile

INSTALL_MODE            := 00755

#INSTALL_TARGETS         := $(filter-out $(UNWANTED_FILES),$(notdir $(patsubst $(abs_srcdir)/%,%,$(wildcard $(abs_srcdir)/*))))

CFLAGS          += -g -Wall -O1 -fomit-frame-pointer
LDFLAGS         += -g -static
INCLUDES        = -I $(KERNEL_USR_INC) -I src/interface/common -I ../utils/user

#List of source files- Update this on adding a new C file
SOURCES := \
        ../utils/user/st_timer.c \
        ../utils/user/st_cpu_load.c \
        src/testcases/st_i2c_eeprom.c \
        src/interface/common/st_i2c_common.c \
        src/parser/st_i2c_parser.c

MAKE_TARGETS            := i2c_tests

i2c_tests:
    $(CC) $(CFLAGS) $(LDFLAGS) -o i2c_tests ${INCLUDES} ${SOURCES}

include $(top_srcdir)/include/mk/generic_leaf_target.mk #包含generic_leaf_target.inc 中包含all:

./testcases/ddt/scripts

top_srcdir        ?= ../../..

include $(top_srcdir)/include/mk/env_pre.mk

# Define directories to exclude from build/installation
#FILTER_OUT_DIRS        := kdump

include $(top_srcdir)/include/mk/generic_trunk_target.mk

./testcases/ddt/scripts/eth

top_srcdir        ?= ../../../..

include $(top_srcdir)/include/mk/env_pre.mk

INSTALL_DIR        := testcases/bin/ddt/$(notdir $(CURDIR:%/=%))

FILTER_OUT_DIRS         :=

# We don't want to copy over the Makefile
UNWANTED_FILES        := Makefile

INSTALL_MODE        := 00755

INSTALL_TARGETS        := $(filter-out $(UNWANTED_FILES),$(notdir $(patsubst $(abs_srcdir)/%,%,$(wildcard $(abs_srcdir)/*)))) #shell脚本只需要install 不要gcc

MAKE_TARGETS        :=

include $(top_srcdir)/include/mk/generic_leaf_target.mk #最底层文件夹用leaf

./testcases/kernel:

top_srcdir        ?= ../..

include $(top_srcdir)/include/mk/env_pre.mk

# NOTE (garrcoop): mce-test isn't integrated into the build.

# Build syscalls in all scenarios.
SUBDIRS            := syscalls

# Build lib
SUBDIRS            += lib

ifneq ($(UCLINUX),1)
# KEEP THIS LIST ALPHABETIZED PLEASE!
SUBDIRS            += connectors \
               containers \
               controllers \
               device-drivers \
               firmware \
               fs \
               hotplug \
               input \
               io \
               ipc \
               logging \
               mem \
               numa \
               pty \
               sched \
               security \
               timers \
               tracing \
               module \

ifeq ($(WITH_POWER_MANAGEMENT_TESTSUITE),yes)
SUBDIRS            += power_management
endif

endif

ifeq ($(ANDROID),1)
FILTER_OUT_DIRS        += containers controllers device-drivers fs io ipc mem \
                sched security timers
endif

include $(top_srcdir)/include/mk/generic_trunk_target.mk

./testcases/kernel/syscalls

top_srcdir        ?= ../../..

include    $(top_srcdir)/include/mk/env_pre.mk

ifeq ($(UCLINUX),1)
FILTER_OUT_DIRS    += capget capset chmod chown clone fork getcontext llseek \
           mincore mprotect nftw profil remap_file_pages sbrk
endif

ifeq ($(UCLIBC),1)
FILTER_OUT_DIRS    += profil
endif

ifeq ($(ANDROID), 1)
FILTER_OUT_DIRS    += \
    accept4 adjtimex cma confstr fcntl fmtmsg futex getcontext getcpu \
    getdomainname getdtablesize gethostid getgroups get_mempolicy ipc \
    linkat kill mallopt memmap mq_notify mq_open mq_timedreceive \
    mq_timedsend mq_unlink mmap mremap open openat profil ptrace quotactl \
    readahead remap_file_pages rt_sigsuspend rt_sigtimedwait \
    sched_getaffinity sched_setaffinity sendmsg setgroups setns sighold \
    sigrelse sigsuspend sigtimedwait sigwait sigwaitinfo stime \
    setdomainname sethostname symlinkat ulimit ustat vfork vhangup vmsplice
endif

include $(top_srcdir)/include/mk/generic_trunk_target.mk

./testcases/kernel/syscalls/alarm

top_srcdir        ?= ../../../..

include $(top_srcdir)/include/mk/testcases.mk

include $(top_srcdir)/include/mk/generic_leaf_target.mk

转载于:https://www.cnblogs.com/idyllcheung/p/10444955.html

ltp-ddt的makefile结构相关推荐

  1. 模仿u-boot的makefile结构

    u-boot(2014.04)是通过顶层makefile调用各子目录中的makefile来实现整个工程的编译的,实际上子目录的makefile是include进来的.这里仿照这种结构写个模板测试一下. ...

  2. 研究基于PX4平台的Ardupilot代码工程的makefile结构

    最近有空,于是想花时间好好研究下ardupilot的软件架构,经过对ardupilot一段时间的熟悉和使用后,对其软件架构已经有了一定的理解,但还称不上特别完备,所以想把每一部分的细节都弄清楚. ma ...

  3. Makefile 文件怎么写

    跟我一起写Makefile:MakeFile介绍 Makefile 使用总结 1. make 命令与 Makefile 文件 在 Linux 平台,执行 make 命令时,会在当前目录下寻找 Make ...

  4. U-Boot移植教程之一:U-Boot分析与启动过程

    内容来自 韦东山<嵌入式Linux应用开发完全手册> 一.Bootloader的引出 当系统上电时,并不是直接进入Linux系统的,而是需要先执行一段程序来把单片机的硬件外围初始化好,比如 ...

  5. GUN Make指南

    GUN Make介绍 1 GUN Make 和 makefile简介 在大型的开发项目中,通常有几十到上百个的源文件,如果每次均手工键入 gcc 命令进行编译的话,则会非常不方便.因此,人们通常利用 ...

  6. 中文分词的古今中外,你想知道的都在这里

    作者:QvQ,夕小瑶,小鹿鹿鹿 前言 分词(word tokenization),也叫切词,即通过某种方式将句子中的各个词语识别并分离开来,使得文本从"字序列"的表示升级为&quo ...

  7. 以jieba为首的主流分词工具总结

    工具篇 下面列了几个较为主流的分词工具(排名不分先后,大家自行试用),相关的paper请在订阅号「夕小瑶的卖萌屋」后台回复[中文分词]领取. 1 Jieba 说到分词工具第一个想到的肯定是家喻户晓的& ...

  8. 史上最全的分词算法与工具介绍

    分词(word tokenization),也叫切词,即通过某种方式将句子中的各个词语识别并分离开来,使得文本从"字序列"的表示升级为"词序列"表示.分词技术不 ...

  9. 鸿蒙关键技术研究,鸿蒙内核源码分析(静态链接篇) | 完整小项目看透静态链接过程 | 百篇博客分析HarmonyOS源码 | v54.02...

    百篇博客系列篇.本篇为: 下图是一个可执行文件编译,链接的过程. 本篇将通过一个完整的小工程来阐述ELF编译,链接过程,并分析.o和bin文件中各区,符号表之间的关系.从一个崭新的视角去看中间过程,阅 ...

最新文章

  1. NanoPi NEO Air使用十三:使用自带的fbtft驱动点亮SPI接口TFT屏幕,ST7789V,模块加载的方式
  2. 人工神经网络之激活函数 -RELU函数
  3. C++为什么使用指针---堆和栈的区别
  4. 新闻发布项目——分页公共类(PageUitl )
  5. 推荐12个绚丽的CSS3图片悬停效果
  6. C#微信公众号开发系列教程二(新手接入指南)
  7. python中paramiko模块的使用
  8. python实战1.1——根据1.0做词云图
  9. jenkines的工作区目录位置查找
  10. Undefined symbols for architecture i386:问题解决
  11. SaltStack 介绍和安装
  12. 分布式搜索引擎Elasticsearch的简单使用
  13. 刘毅5000词汇_不熟词汇整理_lesson_15 and part_2
  14. mac 中word去掉超链接
  15. 图解积分法_计算机模拟图解积分法求气相吸收总传质单元数
  16. 约束布局错误提示(ConstraintLayout)This view is not constrained horizontally: at runtime it will jump to the
  17. 计算机不能再U盘新建文件夹,如何让你的U盘永不中毒?新建一个文件夹就搞定!-u盘文件夹变成exe...
  18. ISTQB初级认证-知识点及脑图总结
  19. 第3章 枚举!很暴力
  20. 赋能 打造应对不确定性的敏捷团队 pdf_协会成长课堂|《赋能》:打造应对不确定性的敏捷团队...

热门文章

  1. MySQL进阶11--DDL数据库定义语言--库创建/修改/删除--表的创建/修改/删除/复制
  2. 数据结构:树套树-替罪羊树套权值线段树
  3. [转]Java8 Lambda表达式教程
  4. Oracle中动态SQL详解
  5. 【Advanced Windows Phone Programming】在windows phone 8中录制MP3和AAC及Amr音频
  6. 在PS里怎样使图层居中对齐?
  7. sql server分布式事务解决方案
  8. 做个插件MaterialSpinner笔记
  9. 【零基础学Java】—TCP通信(五十四)
  10. 前端—每天5道面试题(5)