`
johnson.lee
  • 浏览: 52808 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

模块化工程构建工具 - XBuild

阅读更多
Xbuild is project auto build tool, it's just a simple wrapper of GNUMake. The home page is https://sourceforge.net/projects/xbuild/


1.How to install
----------------
tar -xzvf xbuild-<version>.tar.gz -C /usr/local/sbin

2.Syntax specificatio of build.mk file
--------------------------------------

- Overview
  An build.mk file is written to describe your sources to the build system. More
  specifically:

  o The file is really a tiny GNU Makefile fragment that will be parsed one or
    more times by the build system. As such, you should try to minimize the
    variables you declare there and do not assume that anything is not defined
    during parsing.

  o The file syntax is designed to allow you to group your sources into
    'modules'. A module is one of the following:

    * a static library
    * a shared library
    * a executable

    You can define one or more modules in each build.mk file, and you can use
    the same source file in several modules.

  o The build system handles many details for you. For example, you don't need
    to list header files or explicit dependencies between generated files in
    your build.mk. The build system will compute these automatically for you.

    This also means that, when updating to newer releases of the XBuild, you
    should be able to benefit from new toolchain/platform support without having
    to touch your build.mk files.

- Simple example:
  Before describing the syntax in details, let's consider the simple "hello"
  example, assume the structure of "hello" project is following:
 
    hello
    ├─include
    │ └─hello.h
    ├─src
    │ ├─build.mk
    │ └─hello.c
    └─build.mk

  Here, we can see:
 
  o The 'src' directory containing the c source for the sample project.
  o The 'include' directory containing the c header file for the sample project.
  o The 'hello/build.mk' file that describles the sub diretory to build system.
    Its content is:

    ---------- cut here ----------
    include $(all-subdir-makefiles)
    ---------- cut here ----------
  o The 'src/build.mk' file that describles the shared library to build system.
    Its content is:
   
    ---------- cut here ----------
    $(call prepare-build)
   
    MODULE      := hello
    INCLUDES    := ../include
    CFLAGS      := -O3 -Wall -ggdb -D_DEBUG
    CPPFLAGS    :=
    CXXFLAGS    := $(CPPFLAGS)
    LDFLAGS     := -L/usr/local/lib -L/usr/lib
    LDLIBS      :=
    SHARED_LIBS :=
    STATIC_LIBS :=
    SOURCES     := hello.c
   
    $(call build-shared-library)
    ---------- cut here ----------

- Xbuild provided evironment variables

  o ARCH
    The architecture of the CPU

  o XBUILD_PROJECT
    The absolute path of project

- Xbuild provided variables

  o MODULE
    This variable is required, it's describled the module name.

  o INCLUDES
    A set of C/C++ header file include directory, for example:

      INCLUDES := ../include
      INCLUDES += ../../include

  o CFLAGS
    A set of compile flags for .c source file, for example:

      CFLAGS := -O3 -Wall -ggdb -D_DEBUG

  o CPPFLAGS
    A set of compile flags for .cpp source file, for example:

      CPPFLAGS := -O3 -Wall -ggdb -D_DEBUG -std=gnu++0x

  o CXXFLAGS
    A set of compile flags for .cxx and .cc source file, for example:

      CXXFLAGS := -O3 -Wall -ggdb -D_DEBUG -std++   

  o LDFLAGS
    A set of link flags for build shared library, static library orcutable,
    for example:

      LDFLAGS := -L/usr/local/lib -L/usr/lib -L$(call pwd)/../lib

    NOTE: If the path is relative, should use the function $(call pwd) to locate
    current directory. 

  o LDLIBS
    A set of external library to link, for example:

      LDLIBS := -lrt -lpthr

  o SHARED_LIBS
    A set of shared library module name that dependencied by current module,
    for example:

    SHARED_LIBS := module-foo module-bar

    If the SHARED_LIBS is defined, the module linked after all of dependency
    module linked success.

  o STATIC_LIBS
    A set of static library module name that dependencied by current module,
    it's the same of SHARED_LIBS.

  o SOURCES
    A set of source file to compile.

- Xbuild provided functions & macros

  o add-suffix
  o build-shared-library
  o build-static-library
  o build-executable
  o pwd
  o all-subdir-makefiles
 
  About the details, please see '$Xbuild/core/definitions.mk'

4.Build project
---------------
Usage of xbuild command:

  cd <project-directory>
  xbuild all

  or

  xbuild r[ebuild]
   
   
分享到:
评论

相关推荐

    vue-multipage vue 模块化开发打包

    Vue-multipage 就是针对Vue.js 应用的多页面模块化构建工具。它结合了Webpack等现代前端构建工具,使得在Vue.js应用中实现多页面开发变得更为简单。 Webpack 是一个模块打包器,它能够将JavaScript、CSS、图片等...

    前端构建尝试1-构建工具源代码

    `Browserify` 是一个用于解决在浏览器中使用 CommonJS 规范的模块化开发问题的工具。它允许开发者将Node.js风格的`require()`语法应用于前端代码,使得代码可以按照模块化的方式组织,便于复用和管理。`Browserify`...

    开源大数据ETL工具的模块化组件构建技术研究.zip

    本研究主要探讨的是如何利用模块化组件构建开源大数据ETL工具,以提升数据处理的效率和可扩展性。 一、模块化设计的优势 模块化组件构建技术的核心思想是将复杂系统拆分为多个独立的、可重用的模块,每个模块专注于...

    开源大数据ETL工具的模块化组件构建技术研究.pdf

    本文详细探讨了开源大数据ETL(Extract-Transform-Load)工具中模块化组件构建的技术方法,并以Kettle这个开源ETL软件作为案例,分析了其模块化组件构建的实践应用。Kettle是Pentaho数据集成(PDI)系统的一个重要...

    Magisk模块:Move_Certificates-v1.9

    总的来说,Move_Certificates-v1.9模块通过自动化证书的导入过程,提高了用户在Android设备上管理安全连接的效率。用户只需在Magisk环境中安装此模块并重启设备,就可以享受更加便捷的证书管理体验。然而,值得注意...

    JavaScript前端开发模块化教程_源代码.rar

    3. **模块化工具与框架** - **Webpack**:强大的模块打包工具,可以处理各种静态资源,并提供模块热替换、代码分割等功能。 - **Rollup**:轻量级的模块打包工具,专注于优化JavaScript库的构建。 - **Browserify...

    fedao学而思在线前端工程构建工具

    【标签】:“JavaScript开发-构建工具”表明这套构建工具的核心是JavaScript,它主要服务于JavaScript开发者,通过自动化工具帮助开发者解决项目构建中的各种问题,例如代码转换、优化、打包等,使开发者可以专注于...

    嵌入式系统的微模块化程序设计:实用状态图C_C++实现.pdf

    《嵌入式系统的微模块化程序设计:实用状态图C_C++实现》是一本专为嵌入式系统设计人员及计算机科学和电气工程领域的学生编写的教程书。本书由美籍波兰裔博士Miro Samek撰写,中文版由三万钧翻译,详细介绍了量子...

    springboot模块化框架

    使用Jenkins、GitLab CI/CD等工具,自动化构建、测试和部署各个模块,确保整个流程的高效和稳定。 通过以上对SpringBoot模块化框架的分析,我们可以看出其在提高开发效率、增强代码可维护性和扩展性方面的优势。在...

    微信小程序-微信小程序框架-模块化组件开发工具

    微信小程序模块化组件开发“框架” 更新日志:Changelog 简介 使小程序开发可以采用模块化的开发方式。没有任何构建相关的骨架或者约束。在运行阶段自动通过getter/setter,将你的“模块化组件”的数据和方法的...

    基于Vue的模块化组件化工程化编码应用例子

    总结,基于Vue的模块化、组件化和工程化编码应用例子展示了如何利用Vue.js构建高效、可维护的前端应用。通过模块化组织代码,组件化构建UI,以及Vue CLI带来的工程化实践,开发者能够更好地应对复杂项目的需求。

    digo是一个轻量实用的流程化自动构建工具

    **digo:轻量级流程化自动构建工具详解** 在现代JavaScript开发中,构建工具扮演着至关重要的角色,它们能够自动化处理项目的各种预处理任务,提高开发效率并优化代码。"digo"就是这样一款轻量且实用的流程化自动...

    校企合作下电子信息工程技术专业模块化课程体系的构建.docx

    【摘要】:本文探讨了在校企合作背景下,如何构建电子信息工程技术专业的模块化课程体系,以适应社会和企业发展的需求。作者提出,构建这样的课程体系需要一个适应社会和企业发展需求的教师团队,一个科学合理的模块...

    机械工程专业模块化创新型实验室构建模式实践探析.docx

    【标题】和【描述】都提到了“机械工程专业模块化创新型实验室构建模式实践探析”,这表明文章探讨的主题是关于如何改革和创新机械工程专业的实验室,以适应现代教育和工业发展的需求。【标签】“解决方案”暗示了...

    maven多模块项目工程-已搭建好

    8. **持续集成/持续部署(CI/CD)**:多模块项目通常配合Jenkins、GitLab CI/CD等工具实现自动化构建和部署,确保每次代码提交后都能快速验证代码的正确性和部署到测试或生产环境。 总之,"maven多模块项目工程-已...

    易模块反编译工具-能把EC模块反编辑源代码

    标题提到的"易模块反编译工具"显然是一款专用于对EC(可能是Electron Component或者某种特定的软件模块)模块进行反编译的工具。这种工具在软件开发、安全分析和代码学习等领域有着广泛的应用。 首先,我们来了解...

    dotnet-Psake基于NET的构建自动化工具采用PowerShell开发

    **Psake:基于.NET的构建自动化工具** Psake是一款强大的构建自动化工具,它利用PowerShell脚本语言进行构建过程的管理。在.NET开发环境中,构建自动化对于提高开发效率、确保代码质量和简化部署流程至关重要。...

    Node.js-browserify-handbook-如何利用browserify构建模块化应用程序

    **Node.js浏览器化手册——利用Browserify构建模块化应用程序** 在现代前端开发中,...在实际开发中,结合各种插件和工具,可以构建出高效、模块化的前端应用。不断学习和探索,是适应快速发展的前端技术的关键。

    构建html一键自动化压缩cssjsimages支持ES6模块化

    在现代前端开发中,自动化构建工具是不可或缺的一部分。它们能够帮助开发者提高效率,减少手动处理文件的繁琐工作,比如压缩CSS、JS和图片资源,以及处理ES6等新特性的模块化。本项目名为"html-simple-build-tools"...

    SCons:软件构建工具-开源

    SCons是一种软件构建工具,它是我们大家都知道并喜欢的经典“ Make”构建工具的替代品。 SCons是作为Python脚本和一组模块实现的,而SCons“配置文件”实际上是作为Python脚本执行的。 这为SCons提供了许多其他软件...

Global site tag (gtag.js) - Google Analytics