Components Makefile.builder file
QubesBuilder expects that each component have Makefile.builder file in its root directory. This file specifies what should be done to build the package. As name suggests, this is normal makefile, which is included by builder as its configuration. Its main purpose is to set some variables. Generally all available variables/settings are described as comments at the beginning of Makefile.* in QubesBuilder.
Variables for Linux build:
RPM_SPEC_FILESList (space separated) of spec files for RPM package build. Path should be relative to component root directory. QubesBuilder will install all BuildRequires (in chroot environment) before the build. In most Qubes components all spec files are kept in rpm_spec directory. This is mainly used for Fedora packages build.
ARCH_BUILD_DIRSList (space separated) of directories with PKGBUILD files for Archlinux package build. Similar to RPM build, QubesBuilder will install all makedepends, then build the package.
Most components uses archlinux directory for this purpose, so its good to keep this style.
Variables for Windows build:
WIN_COMPILERChoose which compiler should be used for this component, thus which build scripts. Currently two options available:
WDK- Windows Driver Kit (default). Command used to build: build -cZg.
mingw- MinGW (Windows gcc port). Command used to build: make all
WIN_SOURCE_SUBDIRSList of directories in which above command should be run. In most cases it will be only one entry: current directory (.).
WIN_PREBUILD_CMDCommand to run before build, mostly useful for WDK build (in mingw case, you can use makefile for this purpose). Can be used to set some variables, preprocess some files etc.
WIN_SIGN_CMDCommand used to sign resulting binaries. Note that default value is sign.bat. If you don’t want to sign binaries, specify some placeholder here (eg. true). Check existing components (eg. vmm-xen-windows-pvdrivers) for example scripts. This command will be run with certain environment variables:
CERT_FILENAMEPath to key file (pfx format)
CERT_PUBLIC_FILENAMECertificate path in the case of self-signed cert
CERT_CROSS_CERT_FILENAMECertificate path in the case of correct autheticode cert
SIGNTOOLPath to signtool
WIN_PACKAGE_CMDCommand used to produce installation package (msi or msm). Default value is wix.bat, similar to above - use true if you don’t want this command.
WIN_OUTPUT_HEADERSDirectory (relative to
WIN_SOURCE_SUBDIRSelement) with public headers of the package - for use in other components.
WIN_OUTPUT_LIBSDirectory (relative to
WIN_SOURCE_SUBDIRSelement) with libraries (both DLL and implib) of the package - for use in other components. Note that QubesBuilder will copy files specified as $(WIN_OUTPUT_LIBS)/*/* to match WDK directory layout (<specified directory>/<arch directory>/<actual libraries>), so you in mingw build you need to place libraries in some additional subdirectory.
WIN_BUILD_DEPSList of components required to build this one. QubesBuilder will copy files specified with
WIN_OUTPUT_LIBSof those components to some directory and provide its path with
QUBES_LIBSvariables. Use those variables in your build scripts (sources or Makefile - depending on selected compiler). You can assume that the variables are always set and directories always exists, even if empty.
Most settings are documented in builder.conf.default file, which can be used as template the actual configuration.