About Bakefile

See http://bakefile.sourceforge.net for more info about Bakefile project.
In short, bakefiles are template files from which makefiles for a lot of compilers can be generated (both for win32 compilers and unix ones). They are written in a subset of XML and thus you can modify them using any text editor (also, being in XML it means that you don't have to learn a new syntax when writing them!).

Bakefile documentation is quite complete and you can find a nice introduction to it and to the usage of the wxpresets (some standard templates for building wx-based applications/libraries) in the wxWidgets distribution at wx/build/bakefiles/wxpresets/bakefile_quickstart.txt.

Further documentation is available as comments inside the wx/build/bakefiles/wxpresets/presets/wx.bkl file.

Bakefilize your wxCode component


To create a bakefile-based build system for your wxCode component, just follow these steps:

  1. if you already don't have it, install Bakefile on your system. You'll need it as you're going to use it to generate the makefiles. The users of your components however won't need it as they'll just use the makefiles you've generated for them.
  2. add the lib and build folder to your component's main folder; 'lib' is where by default goes the library files generated by the makefiles; to avoid that CVS prunes it as empty folder you should copy the wxCode/template/lib/Readme.txt file inside it.
  3. copy these files from wxCode/template/build
    into your component's build folder.
  4. edit with any plain text editor the Bakefiles.bkgen file to suit your needs; it's a template which tells to the utility bakefile_gen which formats of makefiles you want to regenerate when you run it; it's commented so that you should be able to edit it without many problems.
  5. edit with any plain text editor the mycomp.bkl to suit your component's requirements (renaming it to something more interesting like "your_component_name.bkl"!) This is the most important step since it requires that you know how to use Bakefile; however, for a standard component with a single sample program you should not have any problem in editing empty.bkl even if you have never used Bakefile before (just follow the comments)
  6. run the bakefile_gen command in your component's build folder
  7. edit the configure.ac file to add your Unix checks set the program name and version. That file will be used by the autoconf utility to create a configure script which will be used by Unix users to create the final makefile from Makefile.in (which is a makefile template generated by Bakefile).
    Since it's a Unix standard to have Makefile.in & configure script directly in the root of the project to compile, the standard "Bakefiles.bkgen" file will tell bakefile_gen to put the "Makefile.in" file not in your "build" folder but one level up.

    To create the "configure" script you must edit the "configure.ac" with a simple text editor (typically, if your component does not use any external library, you don't have to change anything into configure.ac except for the component name, version, and the list of wxWidgets libraries it needs to link to, in the WXCODE_CHECKS macro) and then use the acregen.sh script. See wxCode autoconf guide for more info.
  8. run the makefiles to test them.
    The following are the files you should have in your component's packages to support all major compilers:

    build\makefile.vc      for MSVC (nmake)
    build\makefile.gcc    for Mingw (mingw32-make)
    build\makefile.wat    for Watcom (wmake)
    build\makefile.bcc    for Borland (make)

    Makefile.in    used by configure script to provide the "Makefile", under Unix
    configure        configures the Makefile.in doing the right substitutions and creates "Makefile", under Unix

    additionally wxCode default settings will tell to bakefile_gen to generate also the DSW/DSP project files for MSVC6 and the SLN/VCPROJ project files for MSVS2005... you can adjust the formats you want to be generated editing yours Bakefiles.bkgen.

Learn more about wxCode and wxWidgets Bakefile presets


To make sure all components use the same wxWidgets presets for generating their build systems, the wxCode repository also contains the very latest version of the wxWidgets presets. That is, all bakefile magic for building your wx-based applications/libs is contained in the wxCode/build/bakefiles/preset folder.

Besides, all wxCode bakefiles are heavily commented thus my suggestion is, if you're already experienced with Bakefile, to open with any plain text editor the wxCode/build/bakefiles/presets/templates.bkl file and look at it to understand how wxCode presets work. It's rather simple and wxCode presets are a good set of files you can use to learn more in details the Bakefile build system.

Getting support for bakefile


If you need further info on the usage of wxCode bakefiles, you should write a message describing your problem/doubt on the wxCode mailing list or you can contact directly the bakefile maintainer for wxCode at frm@nospam@ users.sourceforge.net (remove the nospam part).