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]
分享到:
相关推荐
加载内核模块后,调用dmesg命令以确保正确构建了列表。在模块出口点,从链接列表中删除元素,然后将可用内存返回给内核。同样,一旦内核模块被卸载,则调用dmesg命令以检查该列表是否已被删除。
Uni-App模块化开发的组件封装
maven-3.5.0多工程构建(spring4mvc分子项目) 使用maven构建多模块项目。在一个项目中使用多个模块的一个方法是将模块... maven maven3.5.0 多工程构建 spring4mvc 子项目 maven构建项目 多模块项目 maven构建WEB项目
通过别名等配置,配合构建工具,可以比较轻松地实现模块的版本管理。 提高可维护性。模块化可以让每个文件的职责单一,非常有利于代码的维护。Sea.js 还提供了 nocache、debug 等插件,拥有在线调试等功能,能比较...
Express请求处理-构建模块化路由示例代码.;Express请求处理-构建模块化路由示例代码.;Express请求处理-构建模块化路由示例代码.
Linux运维-运维构架师-day21-基础模块-7.运维-基础模块-YUM仓库构建.mp3
开源大数据ETL工具的模块化组件构建技术研究
开源大数据ETL工具的模块化组件构建技术研究.pdf
CastleCSS是一个移动优先的SCSS框架拥有模块化的构建块
原版的nf-hipac需要为内核打patch,且只支持较低版本的内核,构建起来相对比较...模块化后的nf-hipac可以直接作为内核可加载模块编译,且适配了高版本的Linux内核。为了移植工作简化,去掉了和iptables模块的联动支持!
iOS模块化构建方案,模块间解耦,路由中心设计方案
一个Eclipse插件,用于监视Java源代码中的软件模块化并采取相应的措施。 正在进行开发,并提供原型。
微信小程序模块化组件开发“框架” 更新日志:Changelog 简介 使小程序开发可以采用模块化的开发方式。没有任何构建相关的骨架或者约束。在运行阶段自动通过getter/setter,将你的“模块化组件”的数据和方法的...
教育科研-学习工具-PIS系统的互动点播方法及互动平台.zip
关于对前端的模块化的理解,主要包含css、js、html片段的...采用requirejs、require-text、require-css实现模块化加载。同时,css代码采用模块化概念编写。以上的内容通过一个小例子体现。 建议使用webstorm打开运行。
实现了Anti-rootkit部分功能模块,作为ARK工具尚欠完善,但可作学习参考研究,高手请飘过。为了发扬开源精神,广交好友,作品工程项目面对所有网友开源! 希望能够帮助到像作者一样热衷于windows内核安全的刚起步的...
精品软件工具-- 基于Qt实现的组态软件运行时系统原型:1. 具有模块化的图元代码设计,及基于该设计实现的组态编辑器动
node-gyp-Node.js本机插件构建工具node-gyp是用Node.js编写的跨平台命令行工具,用于为Node.js编译本机插件模块。 它包含gyp项目的一个分叉,以前由node-gyp使用-Node.js本机插件构建工具node-gyp是用Node.js编写的...
react-calendar - 模块化工具包用于在React中构建日历相关的东西