The qconfig.mk include file
Since the common makefiles have a lot of defaults based on the names of various directories, you can simplify the common.mk include file if you choose your directory names to match what the common makefiles want.
For example, if the name of the project directory is the same as the name of the image, you don't have to set the NAME macro in common.mk.
ifndef QCONFIG
QCONFIG=qconfig.mk
endif
include $(QCONFIG)
# Preset make macros go here
include $(MKFILES_ROOT)/qtargets.mk
# Postset make macros go here
The qconfig.mk include file provides the root paths to various install and usage trees on the system, along with macros that define the compilers and some utility commands that the makefiles use. The purpose of the qconfig.mk include file is to let you tailor the root directories, compilers, and commands used at your site, if they differ from the standard ones that QNX ships. Therefore, nothing in a project's makefiles should refer to a compiler name, absolute path, or command name directly. Always use the qconfig.mk macros.
- QCONF_OVERRIDE — a file that gets loaded into the framework and defines other variables.
- INSTALL_ROOT_$(OS) — the directory where make install copies content for a given OS (e.g., INSTALL_ROOT_nto is the directory where make install copies QNX OS content). The variable only takes effect when USE_INSTALL_ROOT is set to true (e.g., 1).
- USE_INSTALL_ROOT — if non-empty, the INSTALL_ROOT_$(OS) path is used for setting library and include paths, followed by the USE_ROOT_$(OS) path.
By default, USE_ROOT_nto and INSTALL_ROOT_nto are set to $(QNX_TARGET).
The qconfig.mk file resides in $QNX_TARGET/usr/include/mk
as qconf-os.mk (where os is the host OS,
such as linux
or win32
).
This file is a symbolic link from the place
where make
wants to find the actual include file (namely $QNX_TARGET/usr/include/qconfig.mk).
You can override the location of the include file by specifying a value for the QCONFIG macro.
If you wish to override the values of some of the macros defined in qconfig.mk without modifying the contents of the file, set the QCONF_OVERRIDE environment variable to be the name of a file to include at the end of the main qconfig.mk file.
- CPUDIR
- Refers to the $(CPU) plus the le or be (little- or
big- endian) variant, which applies only to ARM processors (e.g.,
aarch64le
). For x86 processors, no endianness variant needs to be specified, so this variable is set tox86_64
. - CPUVARDIR
- Refers to $(CPUDIR) plus a variant suffix (e.g.,
aarch64le
,x86_64
). It's generally used to form paths to QNX OS files inside an SDP installation.