The MakeXS Build System Explained

by Gianni Mariani

V1.5

9-May-2004



Introduction

MakeXS is a build system that enables a set of functions/targets consistently across an entire source tree using a base Makefile named MakeXS. Each of these functions/targets can be tweaked locally by setting various values in the local folder's Makefile minimizing the need to build complex Makefiles in each folder of the source tree.

MakeXS makes extensive use of GNU make and GNU m4 and some other system utilities. All systems that work with these tools and have a compliant Bourne shell and system utilities should work with MakeXS. Other build tools that may provide similar functionality, MakeXS uses the philosophy that the most common tools are sufficient and builds upon them. Other potential tools include:

In some ways MakeXS is similar to Autoconf however, MakeXS does not require to perform an initial configure to create all the requireed Makefiles which reduces the time to maintain the build environment. Autoconf has many more features than MakeXS but the goal for MakeXS is strictly confined to the build system. Automatic configuration can and should be performed as part of the build step.

A list of other similar tools may be found at the Open Directory web site: http://dmoz.org/Computers/Software/Build_Management/Make_Tools/ .

MakeXS Basics

The provenance of MakeXS is the simplification of the build process. Simplistically, one should simply change directory to the root of the tree and type 'make'. If configuration is required it should be performed automaticaly or a special configuration file should be provided.

The MakeXS Design Goals

MakeXS is the result of attempting to optimize the following set of features.

GNU make Basics

There are many make tools available but one that is available everywhere and is consistent is the GNU make tool. More information about GNU make can be found using the "info" utility (info make). GNU make is robust and performs well, including on windows systems using cygwin.

The "make" system consists of a rule processor and a sophisticated macro language that enables the manipulation of the rule sets. These rule sets are located in a file called "Makefile" and referred to as a Makefile. A rule is invoked if the requested target can be created with that rule. The make tool will traverse a set of rules and discover the set of rules that can be invoked to build a target and then perform the commands at each step. The make tool will also detect if a target is stale by looking at all the components of a target and verifying that the time stamp of the target is newer than all the components. The make system will also remove any components built by intermediate rules if not specifically requested.

GNU make is also capable of performing builds in parallel by attempting to discover multiple rules that may be executed in parallel.

A Reference Point or MXI_ROOT

A source tree consists of various folders containing sources. During the build process, the locations of various folders are important as different components of the source tree refer to one another. MakeXS defines an environment variable named BUILD_ROOT for creating paths to various source tree components.

To minimize chances of error with incorrectly set environment variables, the MakeXS system will automatically locate the build tree's root directory. Because one may choose to build in any folder, the tree root location algorithm must be placed within every folder containing a Makefile. This locator script is itself a make(1) source file called "Makefile.xsi". Makefile.xsi locates the tree root, sets the "MXI_ROOT" environment variable and includes a base Makefile named "MakeXS" located in a folder named "make" off the tree root.

To summarize, the environment variable MXI_ROOT is computed by "Makefile.xsi". Makefile.xsi also includes $(MXI_ROOT)/make/MakeXS is expected to be included in all Makefiles in the source tree except for the file "make/Makefile" which is used to generate MakeXS.

Standard Rules

The file MakeXS contains a set of basic build rules and macro definitions that can be modified in each folder by the local Makefile. The aim is to have each local Makefile specify modifications to the MakeXS rules through various macros that are specific for that folder. The MakeXS file contains a comment describing all the available parameters.

The file MakeXS contains rules for recursive execution of Makefiles in subdirectories. Since each folder may be interdependent, it important to provide a mechanism for a local Makefile to specify those dependencies. To achieve this, MakeXS provides targets for each well-known target in all subdirectories containing a Makefile.

The example below indicates that the target all in the src subdirectory is dependant on the all targets in the subdirectories tools, external, and libs. This will force make to descend into tools, external and libs folders for the 'all' target before attempting to build the 'all' target in the src folder.

src/all : tools/all external/all libs/all


The next example indicates that the target "distclean" in the make folder is dependant on all other distclean folders. This would force make to execute the distclean target in the 'make' folder only after all other folder's distclean target's are done.


    make/distclean : $(subst make/distclean,,$(MXS_MAKEDIRS:%=%/distclean))


Note the use of the variable MXS_MAKEDIRS that is a list of subdirectories containing a file named 'Makefile'.

The standard rules currently defined in MakeXS are:


For development builds.

all perform regular build - create all build files

setup on a top level make it will build a directory structure

test run unit test

clean remove intermediate build files

mostlyclean like clean

distclean revert to checked out state

docs build whatever docs need building

install targets that remove from installation

cvsadd_all add all files to CVS - do this after a distclean


For release builds.

r_all perform regular build - create all build files

r_setup on a top level make it will build a directory structure

r_test run unit test

r_clean remove intermediate build files

r_mostlyclean like clean

r_distclean revert to checked out state

r_docs build whatever docs need building

r_install targets that remove from installation

r_cvsadd_all add all files to CVS - do this after a distclean


Build Architecture and Build Folders

It is often desirable to place intermediate within their own folders to eliminate pollution of the source folders and to enable cross-compiles within the same tree. MakeXS attempts to discover the architecture if not specified. The environment variable BUILD_ARCH can be set to the desired build architecture.

Include files

MakeXS will automatically discover the directories in the tree that contain ".h" files and will create compiler include parameters for compilers.

MakeXS also provides a helper rule to help locate a header file given the generated list. Simply issue the 'make' command with a whereis/ followed by the name of the header file. e.g.


$ make whereis/stdio.h

/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/include/stdio.h

Note that whenever header files are added in new directories in the tree, the header file list needs to be re-evaluated. This is simply done by removing the MakeXS file. Upon the next invocation of a Makefile, the MakeXS file is re-created and the include list is re-evaluated.



Helper rules

$ make env/MXI_ARCH

gx86

$ make whereis/stdio.h
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.0/include/stdio.h

MakeXS Explained

There are 6 files and 2 folders in a minimal MakeXS build system. These include the root level Makefile and Makefile.xsi which create the basic Makefile.


root

|

+ Makefile > Root level Makefile

+ Makefile.xsi > The common Makefile.xsi

|

+ make

|

+ Makefile > Special root/make/Makefile for building MakeXS

+ MakeXS.m4 > MakeXS source file

+ MakeXSConf.m4 > Application defiles

+ doxyscript > Script to create doxygen config file


Below is an example of a simple MakeXS Makefile. This Makefile will enable basic recursion.


#

# Basic MakeXS Makefile

include Makefile.xsi

A root level Makefile should implement the distclean rule shown below and discard the MXI_ROOT variable. This distclean rule is required because all directories require the MakeXS file and if it is cleaned, it will be automatically re-created and hence the make directory will be unclean. To enable multiple source trees to be built within a larger source tree, it is important to isolate the meaning of MXI_ROOT, this is done by defining MXI_ROOT as the empty string. Below is an example of a top level Makefile.


#

# This is the top level Makefile

#

#

# MXI_ROOT is different for different places. This forces the

# MXI_ROOT to be re-evaluated at the top level in case this tree

# is used within other trees.

#

MXI_ROOT=


include Makefile.xsi


make/distclean : $(subst make/distclean,,$(MXS_MAKEDIRS:%=%/distclean))

The structure of MakeXS Makefiles is in three components. The first component are the local folder's defines, the second is simply the inclusion of the Makefile.xsi the third is for any folder specific make rules. The order of these three components is important.


#

# Makefile based on MakeXS.

#


<place your build specific options here>


include Makefile.xsi


<place your folder specific make rules here>

MakeXS will also include any files named Makefile.defs and Makefile.<MXI_ARCH>.defs. These allow architecture dependant Makefiles.

Architecture Dependant Make Files

Some system architectures may require vastly different rules. Many of these rules may be difficult to alter for a different architecture. MakeXS provides two facilities for this case. The first is substitution of a Makefile based on MXI_ARCH and the other is the inclusion of a build specific architecture defs file.

Files named Makefile.<MXI_ARCH>.defs and Makefile.<MXI_ARCH> can change the behaviour of MakeXS in an architecture dependant way. If Makefile.<MXI_ARCH> exists, it is used instead of the file named Makefile. This is only done if executed from the parent folder because 'make' by default executes the Makefile hence, it is an undesirable option. Makefile.<MXI_ARCH>.defs is included by MakeXS after the build architecture is determined and so can make various changes to make variables that can't be made in the base Makefile itself.

To override default rules in a file, you may override the target that is being referenced. The environment variable MXS_BASE_TARGET_ALL defaults to all_default. If this is changed then the dependency that links to the all target is removed and those targets are no longer built.

Below is an example of a Makefile.<MXI_ARCH>.defs file that disables the default actions of the all as far as the targets described by targets in the variable MXS_TARGETS_ALL.


#

# This defs file should avoid any default "all"

# targets in this directory

#

#


.PHONY: all_dont_build

IN_BASE_TARGET_ALL=all_dont_build

MSDEV (Visual C++ 6.0 builds)

MSDEV projects can be easily built using MakeXS by using the MakeXS built-in MSDEV rules. By simply adding 'IN_TARGETS_ALL=msdev32_build' within an architecture dependant Makefile, a build of the tree may be performed. It is important that the MSDEV project file (".dsp" file) follow a set of conventions.

  1. The output target directory for all targets within the project file must be the same as $(MXS_BUILDDIR).

  2. The target base name must be the same name as the project file base name. (e.g. name.dsp -> name.exe)

  3. The extension of the target must be specified like - IN_MSDEV32_RESULT_EXTENSION=exe . (lib is the default)


DEVENV (Visual C++ .NET builds)

Visual Studio has adopted an XML format for project (.vcproj) files. The MakeXS system is capable of creating .vcproj files in order to make it easier to create consistent project files across the entire tree. A number of rules and environment variable will tweak how MakeXS generates .vcproj files.


The assumed source tree organization for the vcproj build rules is as below. (this may not be visible in the rtf version of this document)


Illustration 1 - Tree Hierarchy



The following environment variables are available for creating .vcproj files given a project hierarchy.


IN?_MSVS_BUILD_TYPE Oprtion – CONSOLE or LIBRARY


The following rules are available from a MakeXS system.


%.vcproj This will create a Visual C++ project file with source files from the following directories. The "%" is matched to the project name.
. the current directory
../../../code the main source directory
../../code the win32 specific code directory


win32/projects/%/vcproj_exe This will create the directory hierarchy as shown above including MakeXS files as needed. The make variable IN_MSVS_BUILD_TYPE will be set to "CONSOLE".


win32/projects/%/vcproj_lib This will create the directory hierarchy as shown above including MakeXS files as needed. The make variable IN_MSVS_BUILD_TYPE will be set to "LIBRARY".


win32/projects/%/vcproj_test This will create the directory hierarchy as shown above including MakeXS files as needed. The make variable IN_MSVS_BUILD_TYPE will be set to "CONSOLE" and the sources in both test directories will be placed in the project.


make_Libdirs This will recreate the cached list of directories that contain libraries. This is used in vcproj files as the list of directories to search. This would need to be made for both release and non release builds.


make_Libfiles This will recreate the cached list of .lib files. This is used in vcproj files for linking options. This would need to be made for both release and non release builds.


make_all_cache_files This will recreate cached lista of all .h, .lib files and lib directories for both release and debug builds.


Note that when creating .vcproj files ( ...vcproj_exe, ...vcproj_lib, ...vcproj_test ) the cached directories files for both release and debug paths are used so library builds for both types will be needed to create the correct lib and libpath caches.

The rules to actually build a VC++ project are not supported yet. It is assumned that a Developer Studio "solution" (*.sln) will be used to manage the final build. In essance, this could also be generated by MakeXS at some future point in time.

Doxygen

Doxygen is and advanced javadoc like tool. It requires creating a configuration file. MakeXS supports the "dox", "dox_here" and "dox_gui" targets.


MakeXS target:

dox will automatically create doxygen configuration files and run doxygen

dox_config will create the doxygen configuration file (also run by dox target)

dox_gui will run the file brower over the dox/html directory

A number of environment variables will change the Doxygen configuration file. These are


IN?_DOX_PROJECT_NAME Option - Doxygen configuration PROJECT_NAME

IN?_DOX_PROJECT_NUMBER Option - Doxygen configuration PROJECT_NUMBER

IN?_DOX_OUTPUT_DIRECTORY Option - Doxygen configuration OUTPUT_DIRECTORY

IN?_DOX_BIN_ABSPATH Option - Doxygen configuration BIN_ABSPATH

IN?_DOX_EXT_DOC_PATHS Option - Doxygen configuration EXT_DOC_PATHS

IN?_DOX_INPUT Option - Doxygen configuration INPUT

IN?_DOX_INCLUDE_PATH Option - Doxygen configuration INCLUDE_PATH

IN?_DOX_HAVE_DOT Option - Doxygen configuration HAVE_DOT

IN?_DOX_BASE_CONFIG_SCRIPT Option - This script takes creates a doxygen config file from environment vars

IN?_DOX_SUBDIR Option - The subdirectory that is selected for doxygen scanning.


Dox rules for running doxygen on a subdirectory also exist, these are dox_here, dox_here_config and dox_here_gui. These can be used to create a doxygen subset.


By default, "make dox" will run doxygen over all directories under the directory "src". This may be changed by IN?_DOX_SUBDIR.


Packaging

MakeXS provides an “install” mechanism for creating release distributions. To do this, one needs to define an m4 macro, build_directories, that describes the list of directories. These directories are the targets for the build. Below is an example of the hello_world product install hierarchy.

define(`install_directories',`(`hello_world',`hello_world/docs',`hello_world/testing')')

This will make MakeXS sensitive to the following macros.

# IN?_INSTABLE_HELLO_WORLD Installable files for hello_world
# IN?_INSTABLE_HELLO_WORLD_DOCS Installable files for hello_world/docs
# IN?_INSTABLE_HELLO_WORLD_TESTING Installable files for hello_world/testing

The ‘INSTABLE’ macros allow the declaration of files that can be installed for those target directories. For example:


IN_INSTABLE_HELLO_WORLD_DOCS=$(wildcard *.rtf)


This will target for make install to install all the .rtf files into hello_world/docs.

MakeXS Environment

MakeXS provides a large number of environment variables that can be changed to enable different behaviour. These variables are all described in the generated MakeXS file. The following is a snap of the relevant comments in the MakeXS file. Check out the generated MakeXS file for the latest documentation.

Variable prefix conventions

IN_

defined in the host Makefile

INL_

defined in the user's environment

INS_

defined for subsystem

ING_

defined globally - usually defined in MakeXSConf.m4

MXS_

Makefile variables in MakeXS

M4X_

M4 macros defined in MakeXS.m4 (private ones)

MIN_

M4 macros defined in MakeXS.m4 (public ones)

IN4_

M4 macros defined in MakeXSConf.m4



The following targets are defined by MakeXS. To perform an operation on a target you will need to define IN_TARGETS_* - e.g.:

                        IN_TARGETS_ALL=XFile

Similarly if you want XFile removed on when you run 'make clean' do this e.g.:

                        IN_FILES_CLEAN=XFile

Or if you have your own clean target "myclean", you can have the default clean target depend on it - e.g.:

                        IN_TARGETS_CLEAN=myclean

Defining IN?_SUBMAKEFILES with a list of Makfiles that also need to be executed will cause a list of targets to be generated that can be used. For example :

                        IN_SUBMAKEFILES=foo/Makefile bar/Makefile

Will cause targets "foo/all foo/setup ... bar/all etc" to also be defined - these will also have default actions that will cause the sub-directories to be built. ING_SUBMAKEFILES by default is defined like:

                        ING_SUBMAKEFILES=$(wildcard */Makefile)

IN?_SUBMAKEDIRS operates in much the same way as ING_SUBMAKEFILES except that it is a list of directories.

The target "mxs_version" will echo the MakeXS version number.

List of all MakeXS common targets.

all

Perform regular build - create all build files

setup

On build a directory structure or whatever pre-build setup is required.

test

Build and run unit test

clean

Remove intermediate build files

mostlyclean

Like clean

distclean

Revert to checked out state.

docs

Build documents

install

Targets that install files previously built by all

uninstall

Targets that remove from installation

cvsadd_all

Add all files to CVS - do this after a distclean

rebuild_vcproj

Recreate visual studio project files

Environment variables

The list of environment variables below change the behaviour of this Makefile. The '?' in the "IN?_" can be one of these:


*empty*

Define these in the input Makefile for the directory

G

These are global defines - usually defined in this file.

L

Defined in the user's environment

S

Defined in the subsystem



For option like variables there is a priority order for these defines (INL_*, IN_*, INS_*, ING_*).




INPUT

Description

OUTPUT

IN?_TARGETS_ALL

dependantcies for "all" base target

MXS_TARGETS_ALL

IN?_PARALLEL_JOBS_ALL

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_ALL

IN?_BASE_TARGET_ALL

Base target for all MSB_TARGETS_ALL targets - defaults to "all"

MXS_BASE_TARGET_ALL

IN?_TARGETS_SETUP

dependantcies for "setup" base target

MXS_TARGETS_SETUP

IN?_PARALLEL_JOBS_SETUP

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_SETUP

IN?_BASE_TARGET_SETUP

Base target for all MSB_TARGETS_SETUP targets - defaults to "setup"

MXS_BASE_TARGET_SETUP

IN?_TARGETS_TEST

dependantcies for "test" base target

MXS_TARGETS_TEST

IN?_PARALLEL_JOBS_TEST

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_TEST

IN?_BASE_TARGET_TEST

Base target for all MSB_TARGETS_TEST targets - defaults to "test"

MXS_BASE_TARGET_TEST

IN?_TARGETS_CLEAN

dependantcies for "clean" base target

MXS_TARGETS_CLEAN

IN?_PARALLEL_JOBS_CLEAN

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_CLEAN

IN?_BASE_TARGET_CLEAN

Base target for all MSB_TARGETS_CLEAN targets - defaults to "clean"

MXS_BASE_TARGET_CLEAN

IN?_TARGETS_MOSTLYCLEAN

dependantcies for "mostlyclean" base target

MXS_TARGETS_MOSTLYCLEAN

IN?_PARALLEL_JOBS_MOSTLYCLEAN

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_MOSTLYCLEAN

IN?_BASE_TARGET_MOSTLYCLEAN

Base target for all MSB_TARGETS_MOSTLYCLEAN targets - defaults to "mostlyclean"

MXS_BASE_TARGET_MOSTLYCLEAN

IN?_TARGETS_DISTCLEAN

dependantcies for "distclean" base target

MXS_TARGETS_DISTCLEAN

IN?_PARALLEL_JOBS_DISTCLEAN

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_DISTCLEAN

IN?_BASE_TARGET_DISTCLEAN

Base target for all MSB_TARGETS_DISTCLEAN targets - defaults to "distclean"

MXS_BASE_TARGET_DISTCLEAN

IN?_TARGETS_DOCS

dependantcies for "docs" base target

MXS_TARGETS_DOCS

IN?_PARALLEL_JOBS_DOCS

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_DOCS

IN?_BASE_TARGET_DOCS

Base target for all MSB_TARGETS_DOCS targets - defaults to "docs"

MXS_BASE_TARGET_DOCS

IN?_TARGETS_INSTALL

dependantcies for "install" base target

MXS_TARGETS_INSTALL

IN?_PARALLEL_JOBS_INSTALL

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_INSTALL

IN?_BASE_TARGET_INSTALL

Base target for all MSB_TARGETS_INSTALL targets - defaults to "install"

MXS_BASE_TARGET_INSTALL

IN?_TARGETS_UNINSTALL

dependantcies for "uninstall" base target

MXS_TARGETS_UNINSTALL

IN?_PARALLEL_JOBS_UNINSTALL

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_UNINSTALL

IN?_BASE_TARGET_UNINSTALL

Base target for all MSB_TARGETS_UNINSTALL targets - defaults to "uninstall"

MXS_BASE_TARGET_UNINSTALL

IN?_TARGETS_CVSADD_ALL

dependantcies for "cvsadd_all" base target

MXS_TARGETS_CVSADD_ALL

IN?_PARALLEL_JOBS_CVSADD_ALL

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_CVSADD_ALL

IN?_BASE_TARGET_CVSADD_ALL

Base target for all MSB_TARGETS_CVSADD_ALL targets - defaults to "cvsadd_all"

MXS_BASE_TARGET_CVSADD_ALL

IN?_TARGETS_REBUILD_VCPROJ

dependantcies for "rebuild_vcproj" base target

MXS_TARGETS_REBUILD_VCPROJ

IN?_PARALLEL_JOBS_REBUILD_VCPROJ

Number of jobs to execute in parallel

MXS_PARALLEL_JOBS_REBUILD_VCPROJ

IN?_BASE_TARGET_REBUILD_VCPROJ

Base target for all MSB_TARGETS_REBUILD_VCPROJ targets - defaults to "rebuild_vcproj"

MXS_BASE_TARGET_REBUILD_VCPROJ

IN?_BUILDDIR

Option - Directory where all built files are placed

MXS_BUILDDIR

 

Build file prefix dervied +MXS_BUILDDIR+/ only when MXS_BUILDDIR is set

MXS_BUILDPREFIX

IN?_CXX_EXECUTABLE

Option - The final executable being produced using C++

MXS_CXX_EXECUTABLE

IN?_C_EXECUTABLE

Option - The final executable being produced using C++

MXS_C_EXECUTABLE

IN?_STATIC_RELOCATABLE

Option - This defines the name of the .o to be produced

MXS_STATIC_RELOCATABLE

 

Name of actual relocatable object file

MXS_STATIC_RELOCATABLE_NAME

IN?_STATIC_LIBRARY

Option - This defines the name of the .a to be produced

MXS_STATIC_LIBRARY

 

Name of actual archive

MXS_STATIC_LIBRARY_NAME

IN?_CXX_DSO

Option - This defines the name of a c++ Dynamic Shared Object

MXS_CXX_DSO

 

Name of actual DSO

MXS_CXX_DSO_NAME

IN?_C_DSO

Option - This defines the name of a c++ Dynamic Shared Object

MXS_C_DSO

 

Name of actual DSO

MXS_C_DSO_NAME

IN?_CPP_EXTENSION

Option - C++ file extension

MXS_CPP_EXTENSION

IN?_WHEREIS_ALL

Option - Determines the operation of the whereis command

MXS_WHEREIS_ALL

IN?_LIBS

libraries for linking

MXS_LIBS

IN?_INCL_EXCLUDE_PATTERNS

Include directories not to be added to MXS_GEN_INCLUDEDIRS

MXS_INCL_EXCLUDE_PATTERNS

 

-l options for linking CLIBS

MXS_LIBS_OPTS

IN?_SUBMAKEFILES

List of Makefiles in directories to be built

MXS_SUBMAKEFILES

MXS_SUBMAKEFILES

MXS_SUBMAKEFILES with extensions /Makefile changed to

MXS_SUBMAKEFDIRS

IN?_SUBMAKEDIRS

List of directories to be built

MXS_SUBMAKEDIRS

 

List of Visual C++ project files

MXS_WIN32_PROJECTS

IN?_CXXFILES

Files with $(MXS_CPP_EXTENSION) extension - creates MXS_CXXOBJS

MXS_CXXFILES

MXS_CXXFILES

MXS_CXXFILES with extensions $(MXS_CPP_EXTENSION) changed to .o

MXS_CXXOBJS

IN?_CFILES

Files with .c - creates MXS_COBJS

MXS_CFILES

MXS_CFILES

MXS_CFILES with extensions .c changed to .o

MXS_COBJS

IN?_PREBUILD_SUFFIX

Option - Suffix for pre-built bundles

MXS_PREBUILD_SUFFIX

IN?_USE_PREBUILT_BUNDLES

Option - This will force the use of pre-built bundles

MXS_USE_PREBUILT_BUNDLES

IN?_EX_PACKAGE_NAME

Option - The name of the package e.g. libxml2

MXS_EX_PACKAGE_NAME

IN?_EX_VERS_STR

Option - The version string e.g. 2.6.8

MXS_EX_VERS_STR

IN?_EX_URL_SRC

Option - The source URL that is prefixed to the DIST_NAME e.g. ftp://xmlsoft.org/

MXS_EX_URL_SRC

IN?_EX_RELEASE_TYPE

Option - Usually an appendix to the version string e.g. rc1

MXS_EX_RELEASE_TYPE

IN?_EX_MODULE_VERS_SEPARATOR

Option - A separator in the module (directory) name between package and version

MXS_EX_MODULE_VERS_SEPARATOR

IN?_EX_DIST_VERS_SEPARATOR

Option - A separator in the distribution name between package and version

MXS_EX_DIST_VERS_SEPARATOR

IN?_EX_EXTRACT_METHOD

Option - The distribution file type (TGZ, TBZ2, ZIP)

MXS_EX_EXTRACT_METHOD

IN?_EX_MODULE_NAME

Option - The module name (directory) default is comprised of name+separator+version

MXS_EX_MODULE_NAME

IN?_EX_DISTRO_NAME

Option - The distributed file name (excluding suffix) e.g. libxml2-2.6.8

MXS_EX_DISTRO_NAME

IN?_EX_TGZ_NAME

Option - The full name of the distributed file for TGZ files - including the suffix e.g. libxml2-2.6.8.tar.tgz

MXS_EX_TGZ_NAME

IN?_EX_TGZ_EXTRACT_CMD

Option - The command to extract for a TGZ file default "gunzip < ../$^ | tar xf -"

MXS_EX_TGZ_EXTRACT_CMD

IN?_EX_TBZ2_NAME

Option - The full name of the distributed file for TBZ2 files - including the suffix e.g. libxml2-2.6.8.tar.bz2

MXS_EX_TBZ2_NAME

IN?_EX_TBZ2_EXTRACT_CMD

Option - The command to extract for a TBZ2 file default "bunzip2 < ../$^ | tar xf -"

MXS_EX_TBZ2_EXTRACT_CMD

IN?_EX_ZIP_NAME

Option - The full name of the distributed file for TBZ2 files - including the suffix e.g. libxml2-2.6.8.zip

MXS_EX_ZIP_NAME

IN?_EX_ZIP_EXTRACT_CMD

Option - The command to extract for a ZIP file default "unzip -x ../$^"

MXS_EX_ZIP_EXTRACT_CMD

IN?_EX_DIST_NAME

Option - The actual distribution name for the EXTRACT_METHOD e.g. EXTRACT_METHOD=TGZ then DIST_NAME=libxml2-2.6.8.tar.tgz

MXS_EX_DIST_NAME

IN?_EX_EXTRACTS

Option - Directory where to extract distribution - usually MXS_BUILDDIR

MXS_EX_EXTRACTS

IN?_EX_EXTRACTS_BUILD_DIR

Option - Directory where to build inside extracted directory - usually EX_MODULE_NAME

MXS_EX_EXTRACTS_BUILD_DIR

IN?_EX_PREBUILT_FILE

Option - The filename of prebuilt files - e.g. prebuilt-libxml2-2.6.8-release-win32.tbz

MXS_EX_PREBUILT_FILE

IN?_EX_BUILD_START

Option - Built start commands - usually a CD into the appropriate directory - default cd work.gx86; PACKAGE_ROOT=pwd; export PACKAGE_ROOT; cd extracts

MXS_EX_BUILD_START

IN?_MOZ_TOOLS

Option - MOZ_TOOLS will set the environment variable MOZ_TOOLS for use by mozilla builds - MUST USE "\" e.g. c:\stuff NOT c:/stuff

MXS_MOZ_TOOLS

IN?_USE_CYGWIN_GCC

Option - If this is set, the default will be changed target list will be changed

MXS_USE_CYGWIN_GCC

IN?_SQLM4FILES

Files with .Ix.m4 - creates MXS_IXFILES

MXS_SQLM4FILES

MXS_SQLM4FILES

MXS_SQLM4FILES with extensions .sql.m4 changed to .sql

MXS_SQLFILES

IN?_SQLM4FILES_LOCAL

Files with .Ix.m4 - creates MXS_IXFILES

MXS_SQLM4FILES_LOCAL

MXS_SQLM4FILES_LOCAL

MXS_SQLM4FILES_LOCAL with extensions .sql.m4 changed to .sql

MXS_SQLFILES_LOCAL

IN?_HTMM4FILES

Files with .Ix.m4 - creates MXS_IXFILES

MXS_HTMM4FILES

MXS_HTMM4FILES

MXS_HTMM4FILES with extensions .htm.m4 changed to .htm

MXS_HTMFILES

IN?_HTMM4FILES_LOCAL

Files with .Ix.m4 - creates MXS_IXFILES

MXS_HTMM4FILES_LOCAL

MXS_HTMM4FILES_LOCAL

MXS_HTMM4FILES_LOCAL with extensions .htm.m4 changed to .htm

MXS_HTMFILES_LOCAL

IN?_HTMLM4FILES

Files with .Ix.m4 - creates MXS_IXFILES

MXS_HTMLM4FILES

MXS_HTMLM4FILES

MXS_HTMLM4FILES with extensions .html.m4 changed to .html

MXS_HTMLFILES

IN?_HTMLM4FILES_LOCAL

Files with .Ix.m4 - creates MXS_IXFILES

MXS_HTMLM4FILES_LOCAL

MXS_HTMLM4FILES_LOCAL

MXS_HTMLM4FILES_LOCAL with extensions .html.m4 changed to .html

MXS_HTMLFILES_LOCAL

IN?_PLM4FILES

Files with .Ix.m4 - creates MXS_IXFILES

MXS_PLM4FILES

MXS_PLM4FILES

MXS_PLM4FILES with extensions .pl.m4 changed to .pl

MXS_PLFILES

IN?_PLM4FILES_LOCAL

Files with .Ix.m4 - creates MXS_IXFILES

MXS_PLM4FILES_LOCAL

MXS_PLM4FILES_LOCAL

MXS_PLM4FILES_LOCAL with extensions .pl.m4 changed to .pl

MXS_PLFILES_LOCAL

IN?_PMM4FILES

Files with .Ix.m4 - creates MXS_IXFILES

MXS_PMM4FILES

MXS_PMM4FILES

MXS_PMM4FILES with extensions .pm.m4 changed to .pm

MXS_PMFILES

IN?_PMM4FILES_LOCAL

Files with .Ix.m4 - creates MXS_IXFILES

MXS_PMM4FILES_LOCAL

MXS_PMM4FILES_LOCAL

MXS_PMM4FILES_LOCAL with extensions .pm.m4 changed to .pm

MXS_PMFILES_LOCAL

IN?_HTTPD_CONFM4FILES

Files with .Ix.m4 - creates MXS_IXFILES

MXS_HTTPD_CONFM4FILES

MXS_HTTPD_CONFM4FILES

MXS_HTTPD_CONFM4FILES with extensions .httpd_conf.m4 changed to .httpd_conf

MXS_HTTPD_CONFFILES

IN?_HTTPD_CONFM4FILES_LOCAL

Files with .Ix.m4 - creates MXS_IXFILES

MXS_HTTPD_CONFM4FILES_LOCAL

MXS_HTTPD_CONFM4FILES_LOCAL

MXS_HTTPD_CONFM4FILES_LOCAL with extensions .httpd_conf.m4 changed to .httpd_conf

MXS_HTTPD_CONFFILES_LOCAL

IN?_YYACC_FILES

Files with .yy - creates MXS_YYACCCXX_FILES

MXS_YYACC_FILES

MXS_YYACC_FILES

MXS_YYACC_FILES with extensions .yy changed to .tab$(MXS_CPP_EXTENSION)

MXS_YYACCCXX_FILES

MXS_YYACC_FILES

MXS_YYACC_FILES with extensions .yy changed to .tab.hh

MXS_YYACCHXX_FILES

MXS_YYACC_FILES

MXS_YYACC_FILES with extensions .yy changed to .tab.o

MXS_YYACCOBJ_FILES

IN?_TEST_CXXFILES

Test files with $(MXS_CPP_EXTENSION) extension - creates TEST_CXXOBJS

MXS_TEST_CXXFILES

MXS_TEST_CXXFILES

MXS_TEST_CXXFILES with extensions $(MXS_CPP_EXTENSION) changed to .o

MXS_TEST_CXXOBJS

IN?_TEST_CFILES

Test files with .c - creates MXS_COBJS

MXS_TEST_CFILES

MXS_TEST_CFILES

MXS_TEST_CFILES with extensions .c changed to .o

MXS_TEST_COBJS

IN?_INSTALL_HOME

Option - Where all files to be installed go

MXS_INSTALL_HOME

IN?_INSTALL_HOME_DIRS

The list of directories in install home

MXS_INSTALL_HOME_DIRS

 

List of actual build directories

MXS_BUILD_NAMES

IN?_IDIRS

A list of directories to create -I flags

MXS_IDIRS

 

-I options for pre processor

MXS_ICFLAGS

IN?_LDIRS

A list of directories to create -L flags

MXS_LDIRS

 

-L options for linker

MXS_LCFLAGS

IN?_LINKOBJS

A list of objects to link by default

MXS_LINKOBJS

IN?_LDFLAGS

Options to the linker

MXS_LDFLAGS

IN?_CXXLIBS

A list of library names to be included as -l flags

MXS_CXXLIBS

 

-l options for linking CXXLIBS

MXS_CXXLIBS_OPTS

IN?_OCFLAGS

Optimizer or debugging flags

MXS_OCFLAGS

IN?_CFLAGS

Other flags for the compiler

MXS_CFLAGS

IN?_CXXFLAGS

Other flags for the c++ compiler

MXS_CXXFLAGS

IN?_ASFLAGS

flags for the assembler

MXS_ASFLAGS

IN?_CPPFLAGS

Other flags for the c/c++ pre processor

MXS_CPPFLAGS

IN?_YFLAGS

Yacc (or bison) flags

MXS_YFLAGS

IN?_LFLAGS

Lex (or flex) flags

MXS_LFLAGS

IN?_SQLM4FLAGS

M4 flags used on %.Ix : %.Ix.m4 rule

MXS_SQLM4FLAGS

IN?_HTMM4FLAGS

M4 flags used on %.Ix : %.Ix.m4 rule

MXS_HTMM4FLAGS

IN?_HTMLM4FLAGS

M4 flags used on %.Ix : %.Ix.m4 rule

MXS_HTMLM4FLAGS

IN?_PLM4FLAGS

M4 flags used on %.Ix : %.Ix.m4 rule

MXS_PLM4FLAGS

IN?_PMM4FLAGS

M4 flags used on %.Ix : %.Ix.m4 rule

MXS_PMM4FLAGS

IN?_HTTPD_CONFM4FLAGS

M4 flags used on %.Ix : %.Ix.m4 rule

MXS_HTTPD_CONFM4FLAGS

IN?_FILES_CLEAN

Files to remove when running target clean

MXS_FILES_CLEAN

IN?_FILES_MOSTLYCLEAN

Files (not including CLEAN list) to remove for mostlyclean

MXS_FILES_MOSTLYCLEAN

IN?_FILES_DISTCLEAN

Files (not including CLEAN and MOSTLYCLEAN) to remove for distclean

MXS_FILES_DISTCLEAN

IN?_MSDEV_ARG

Option - MSDEV option - e.g. /REBUILD

MXS_MSDEV_ARG

IN?_MSDEV32_RESULT_EXTENSION

Option - MSDEV result extension - e.g. .lib

MXS_MSDEV32_RESULT_EXTENSION

IN?_MSDEV32_BUILD_TYPE

Option - MSDEV build type - e.g. "Win32 Debug"

MXS_MSDEV32_BUILD_TYPE

IN?_DEVENV_BUILD_TYPE

Option - Build type for developer studio (devenv) e.g. "Debug" or "Release"

MXS_DEVENV_BUILD_TYPE

IN?_MSDEV32_BUILD_OPTION

Option - Defaults to "module - Win32 Debug" - can be over-ridden

MXS_MSDEV32_BUILD_OPTION

IN?_MSDEV32_BUILD_COMMAND

Option - The full win32 dsp build command - can be over-ridden

MXS_MSDEV32_BUILD_COMMAND

MXS_MSDEV32_DSPFILE

MXS_MSDEV32_DSPFILE with extensions .dsp changed to .$(MXS_MSDEV32_RESULT_EXTENSION)

MXS_MSDEV32_RESULT

IN?_MSDEV_ARG

Option - MSDEV option - e.g. /REBUILD

MXS_MSDEV_ARG

IN?_MSVS_BUILD_TYPE

Option - set to one of LIBRARY, CONSOLE, WINDOWS

MXS_MSVS_BUILD_TYPE

IN?_MSVS_PROJECT_NAME

Option - This is the name of the %.vcproj name - e.g MSVS_PROJECT_NAME=sys for sys.vcproj

MXS_MSVS_PROJECT_NAME

IN?_MSVS_TEST_PROJECT

Option - when test to TRUE forces the creation of a test .vcproj file.

MXS_MSVS_TEST_PROJECT

IN?_OFFICIAL_BUILD

Option - Official build flag

MXS_OFFICIAL_BUILD

IN?_RELEASE_BUILD

Option - Release build

MXS_RELEASE_BUILD

IN?_OFFICIAL_BUILD_VERS

Option - Version of the official build

MXS_OFFICIAL_BUILD_VERS

IN?_SKIP_INCLUDE_DIR_BUILD

Option - Set this to skip the build of the include directories

MXS_SKIP_INCLUDE_DIR_BUILD

IN?_MIDL_INCLUDE_PATH

Option - The default include path for midl include files

MXS_MIDL_INCLUDE_PATH

IN?_DOX_PROJECT_NAME

Option - Doxygen configuration PROJECT_NAME

MXS_DOX_PROJECT_NAME

IN?_DOX_PROJECT_NUMBER

Option - Doxygen configuration PROJECT_NUMBER

MXS_DOX_PROJECT_NUMBER

IN?_DOX_OUTPUT_DIRECTORY

Option - Doxygen configuration OUTPUT_DIRECTORY

MXS_DOX_OUTPUT_DIRECTORY

IN?_DOX_BIN_ABSPATH

Option - Doxygen configuration BIN_ABSPATH

MXS_DOX_BIN_ABSPATH

IN?_DOX_EXT_DOC_PATHS

Option - Doxygen configuration EXT_DOC_PATHS

MXS_DOX_EXT_DOC_PATHS

IN?_DOX_INPUT

Option - Doxygen configuration INPUT

MXS_DOX_INPUT

IN?_DOX_INCLUDE_PATH

Option - Doxygen configuration INCLUDE_PATH

MXS_DOX_INCLUDE_PATH

IN?_DOX_HAVE_DOT

Option - Doxygen configuration HAVE_DOT

MXS_DOX_HAVE_DOT

IN?_DOX_BASE_CONFIG_SCRIPT

Option - This script takes creates a doxygen config file from environment vars

MXS_DOX_BASE_CONFIG_SCRIPT

IN?_DOX_SUBDIR

Option - The subdirectory that is selected for doxygen scanning.

MXS_DOX_SUBDIR

IN?_FILE_BROWSER

Option - The command line tool to launch a browser.

MXS_FILE_BROWSER

IN?_INSTABLE_HELLO_WORLD

Installable files for hello_world

MXS_INSTABLE_HELLO_WORLD

IN?_INSTABLE_HELLO_WORLD_DOCS

Installable files for hello_world/docs

MXS_INSTABLE_HELLO_WORLD_DOCS

IN?_INSTABLE_HELLO_WORLD_TESTING

Installable files for hello_world/testing

MXS_INSTABLE_HELLO_WORLD_TESTING

IN?_GUID_HELLO_WORLD_GUID

Option - GUID for hello_world_guid

MXS_GUID_HELLO_WORLD_GUID

IN?_GUID_FILE_HELLO_WORLD_GUID

Option - GUID for hello_world_guid

MXS_GUID_FILE_HELLO_WORLD_GUID

IN?_FILEVERSION_HELLO_WORLD_GUID

Option - GUID for hello_world_guid

MXS_FILEVERSION_HELLO_WORLD_GUID

IN?_SIGNCODE_PARAMS

Option - Paramaters for signcode

MXS_SIGNCODE_PARAMS



As mentioned earlier, the file MakeXS is generated and the variables supported may be different to the ones described here. Refer to the MakeXS for the variables supported by your version of MakeXS.

Derivation and License

MakeXS is similar to other make based systems however there are a number of original ideas, including root auto discovery and automatic include specifications. MakeXS is based an original work the author developed to create a number of open source initiatives and is covered by the LPGL.

Bugs

1) GNU make aggressively caches directory entries and the non-existence of various directories. This can cause problems with the auto-creation of the work directory. It may be necessary to create that directory for invoking make. make can be easily patched to remove this cache behaviour and result in expected behaviour. This is not an issue if requested targets are placed in the work directory.