Build
2 minute read
Build Process Overview
XWOS uses its own Build System for building.
The build starts from the board directory by executing the make command. This directory is represented as $(XWOS_BRD_DIR).
In short, the build process compiles each module into a static library .a, which are then linked into an ELF file.
arch.a: compiled as described byarch.mk;cpu.a: compiled as described bycpu.mk;soc.a: compiled as described bysoc.mk;brd.a: compiled as described bybrd.mk;xwos.a: compiled as described byxwos.mk;- Other modules are compiled as described by
xwmo.mk, referred to as the Build System, including:xwcd: Driver modulexwmd: Middleware modulexwem: Third-party software modulexwam: Example and application module$(XWOS_BRD_DIR)/bm: Board module$(XWOS_BRD_DIR)is the board directory.
$(XWOS_OEM_DIR): OEM moduleXWOS_OEM_DIRis configured byXWCFG_OEMPATHin the configuration file$(XWOS_BRD_DIR)/cfg/project.mk.
Output File Path
All build output is located in the $(WKSPC) directory. The default value is defined in $(XWOS_BRD_DIR)/makefile as wkspc.
This variable can be set by the user before building, for example:
export WKSPC=../../../Debug
After building, the directory $(XWOS_BRD_DIR)/../../../Debug will be automatically created, and all intermediate build files will be placed there.
Viewing the Build Process
Users can view the complete build process by using make V=1.
An environment variable can also be used:
export V=1
make
Setting Optimization Level
Users can set the optimization level to 1 during compilation by using make O=1.
An environment variable can also be used:
export O=0 # No optimization, best for debugging
make
By default, the optimization level is g.