Generated Makefile

The -genmake option causes a makefile to be generated to assist in the C or C++ compilation of all of the generated source files. This makefile contains a rule to invoke XBinder to regenerate the .c and .h files if the XSD source file changes. It also contains rules to compile all of the C or C++ source files. Header file dependencies are generated for all the source files.

Two basic types of makefiles are generated:

  1. A GNU compatible makefile. This makefile is compatible with the GNU make utility which is suitable for compiling code on Linux and many UNIX operating systems, and

  2. A Microsoft Visual Studio compatible makefile. This makefile is compatible with the Microsoft Visual Studio nmake utility.

A GNU compatible makefile is produced by default, the Microsoft compatible file is produced when the -w32 command line option is specified in addition to -genmake .

Both of these makefile types rely on definitions in the platform.mk make include file. This file contains parameters specific to different compiler and linker utilities available on different platforms. Typically, all the needs to be done to port to a different platform is to adjust the parameters in this file.

Related to -genmake are the -genMakeLib and - genMakeDLL command-line options. -genmake causes a makefile to be generated that will contain statements to compile the generated code into object files. -genMakeLib adds additional statements to store the object files in a static library file. -genMakeDLL adds additional statements to link the resulting objects into a Windows DLL or UNIX shared object file.

When -use-qt is used, the generated makefile will link in Qt libraries. As of this writing, the library names that are used correspond to Qt 5. If you are using a different version of Qt, you will likely need to adjust the library names in the makefile.