Update bakefile-related information in the docs
Mention that we use the legacy 0.2 bakefile branch. Also use https://www.bakefile.org/ as Bakefile home page location. Finally, use backticks around more files names, especially those containing asterisks, that break Markdown syntax highlighting in Vim otherwise.
This commit is contained in:
@@ -5,26 +5,26 @@ How to add new files and libraries to wxWidgets build system
|
|||||||
Regenerating makefiles
|
Regenerating makefiles
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
wxWidgets now uses [Bakefile](http://bakefile.sourceforge.net) to generate
|
wxWidgets uses the legacy 0.2 branch [Bakefile](https://www.bakefile.org) to
|
||||||
native makefiles. You must have bakefile installed if you want to regenerate
|
generate native makefiles.
|
||||||
the makefiles. Bakefile currently runs on Unix and Windows systems. You will
|
|
||||||
need Python 2.x installed on Unix and either use Bakefile installer or have
|
Currently the latest version from legacy-0.2-branch must be used, so you need
|
||||||
Python on Windows.
|
to compile it from source, which requires Python 2 headers and libraries.
|
||||||
|
|
||||||
Once you have installed Bakefile, you can easily regenerate the makefiles using
|
Once you have installed Bakefile, you can easily regenerate the makefiles using
|
||||||
the bakefile_gen tool. Run it from $(wx)/build/bakefiles directory and it will
|
the `bakefile_gen` tool. Run it from `$(wx)/build/bakefiles` directory and it will
|
||||||
regenerate all outdated makefiles. See $(wx)/build/bakefiles/README for more
|
regenerate all outdated makefiles. See `$(wx)/build/bakefiles/README` for more
|
||||||
details.
|
details.
|
||||||
|
|
||||||
Note that it generates makefiles for samples, too.
|
Note that it generates makefiles for samples, too.
|
||||||
|
|
||||||
IMPORTANT NOTE: Don't forget to run autoconf in wxWidgets root directory
|
IMPORTANT NOTE: Don't forget to run autoconf in wxWidgets root directory
|
||||||
(after running Bakefile) if you changed any conditional
|
(after running Bakefile) if you changed any conditional
|
||||||
variable or target condition in .bkl files! You will know that
|
variable or target condition in .bkl files! You will know that
|
||||||
this happened if $(wx)/autoconf_inc.m4 content changed.
|
this happened if `$(wx)/autoconf_inc.m4` content changed.
|
||||||
|
|
||||||
You can use Bakefile to generate makefiles or projects customized to your
|
You can use Bakefile to generate makefiles or projects customized to your
|
||||||
needs, too. See Bakefiles.bkgen for details on bakefile commands used to
|
needs, too. See `Bakefiles.bkgen` for details on bakefile commands used to
|
||||||
generate makefiles. For example, you can use this command to generate
|
generate makefiles. For example, you can use this command to generate
|
||||||
VC++ project files without wxUniversal configurations:
|
VC++ project files without wxUniversal configurations:
|
||||||
|
|
||||||
@@ -47,9 +47,9 @@ Or monolithic wxBase:
|
|||||||
-DOFFICIAL_BUILD=0 -DUSE_HTML=0 -DUSE_OPENGL=0
|
-DOFFICIAL_BUILD=0 -DUSE_HTML=0 -DUSE_OPENGL=0
|
||||||
-DMONOLITHIC=1 -DUSE_GUI=0 wx.bkl
|
-DMONOLITHIC=1 -DUSE_GUI=0 wx.bkl
|
||||||
|
|
||||||
It is, however, recommended to modify Bakefiles.bkgen (or
|
It is, however, recommended to modify `Bakefiles.bkgen` (or
|
||||||
Bakefiles.local.bkgen) by means of `<add-flags>` and `<del-flags>` directives
|
`Bakefiles.local.bkgen)` by means of `<add-flags>` and `<del-flags>` directives
|
||||||
and use bakefile_gen instead of running bakefile directly.
|
and use `bakefile_gen` instead of running bakefile directly.
|
||||||
|
|
||||||
|
|
||||||
Bakefile files organization
|
Bakefile files organization
|
||||||
@@ -57,42 +57,42 @@ Bakefile files organization
|
|||||||
|
|
||||||
Makefile are generated from .bkl files ("bakefiles") from two places:
|
Makefile are generated from .bkl files ("bakefiles") from two places:
|
||||||
|
|
||||||
- $(wx)/build/bakefiles directory
|
- `$(wx)/build/bakefiles` directory
|
||||||
- samples directories
|
- samples directories
|
||||||
|
|
||||||
$(wx)/build/bakefiles contains bakefiles for main library and support files
|
`$(wx)/build/bakefiles` contains bakefiles for main library and support files
|
||||||
that simplify writing bakefiles for samples.
|
that simplify writing bakefiles for samples.
|
||||||
|
|
||||||
Support files are:
|
Support files are:
|
||||||
|
|
||||||
- wxwin.py - helper functions
|
- `wxwin.py` - helper functions
|
||||||
- common.bkl
|
- `common.bkl`
|
||||||
- common_samples.bkl
|
- `common_samples.bkl`
|
||||||
- config.bkl - user-configurable build options
|
- `config.bkl` - user-configurable build options
|
||||||
- make_dist.mk - implementation of "make dist" on Unix
|
- `make_dist.mk` - implementation of "make dist" on Unix
|
||||||
|
|
||||||
Files used to build the library are:
|
Files used to build the library are:
|
||||||
|
|
||||||
- wx.bkl - main file
|
- `wx.bkl` - main file
|
||||||
- files.bkl - lists of source files
|
- `files.bkl` - lists of source files
|
||||||
- monolithic.bkl - targets for wxWin built as single big library
|
- `monolithic.bkl` - targets for wxWin built as single big library
|
||||||
- multilib.bkl - targets for multilib build
|
- `multilib.bkl` - targets for multilib build
|
||||||
- opengl.bkl - GL library with wxGLCanvas (this one is not
|
- `opengl.bkl` - GL library with wxGLCanvas (this one is not
|
||||||
included in monolithic library for historical
|
included in monolithic library for historical reasons, so "monolithic" really
|
||||||
reasons, so "monolithic" really means "two libs")
|
means "two libs")
|
||||||
- {expat,jpeg,png,tiff, regex,zlib,odbc}.bkl - 3rd party libraries makefiles
|
- `{expat,jpeg,png,tiff, regex,zlib,odbc}.bkl` - 3rd party libraries makefiles
|
||||||
|
|
||||||
|
|
||||||
Adding files to existing library
|
Adding files to existing library
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
**UPDATE:** files.bkl is now itself partially generated from the master file
|
**UPDATE:** `files.bkl` is now itself partially generated from the master file
|
||||||
build/files. If the variable which you need to modify, according to the
|
`build/files`. If the variable which you need to modify, according to the
|
||||||
instructions below, is already defined in build/files, update it there
|
instructions below, is already defined in `build/files`, update it there and run
|
||||||
and run build/upmake to update files.bkl.
|
`build/upmake` to update `files.bkl`.
|
||||||
|
|
||||||
|
|
||||||
All files used by main libraries are listed in files.bkl. The file is
|
All files used by main libraries are listed in `files.bkl`. The file is
|
||||||
organized into variables for toolkits, platforms and libraries. The variables
|
organized into variables for toolkits, platforms and libraries. The variables
|
||||||
come in pairs: there's always `FOO_SRC` for source files and `FOO_HDR` for header
|
come in pairs: there's always `FOO_SRC` for source files and `FOO_HDR` for header
|
||||||
files. Platform or toolkit specific files are grouped together in variable
|
files. Platform or toolkit specific files are grouped together in variable
|
||||||
@@ -100,7 +100,7 @@ with platform or toolkit name in them, e.g. `BASE_WIN32_SRC`, `BASE_UNIX_SRC`,
|
|||||||
`GTK_SRC`, `MOTIF_SRC`.
|
`GTK_SRC`, `MOTIF_SRC`.
|
||||||
|
|
||||||
Note: A side effect of this toolkit-centric organization is that one file may
|
Note: A side effect of this toolkit-centric organization is that one file may
|
||||||
be present several times in files.bkl in different contexts.
|
be present several times in `files.bkl` in different contexts.
|
||||||
|
|
||||||
When you are adding a file, you must put it into appropriate variable. This is
|
When you are adding a file, you must put it into appropriate variable. This is
|
||||||
easy if you are adding the file to library that is always built from same
|
easy if you are adding the file to library that is always built from same
|
||||||
@@ -125,7 +125,7 @@ Adding sample
|
|||||||
|
|
||||||
Copy the bakefile from another sample, change the ID and files accordingly.
|
Copy the bakefile from another sample, change the ID and files accordingly.
|
||||||
If the sample uses some data files, make sure to have `<wx-data>` node
|
If the sample uses some data files, make sure to have `<wx-data>` node
|
||||||
in the sample's bakefile (see e.g. samples/image/image.bkl for an example).
|
in the sample's bakefile (see e.g. `samples/image/image.bkl` for an example).
|
||||||
Make sure to add `<wx-lib>` statements for all libraries from multilib build
|
Make sure to add `<wx-lib>` statements for all libraries from multilib build
|
||||||
that are required by the sample.
|
that are required by the sample.
|
||||||
|
|
||||||
@@ -133,11 +133,11 @@ The Windows resource specification should use the central .rc file:
|
|||||||
|
|
||||||
<win32-res>../sample.rc</win32-res>
|
<win32-res>../sample.rc</win32-res>
|
||||||
|
|
||||||
Run bakefile_gen in $(wx)/build/bakefiles to regenerate the bakefiles.
|
Run `bakefile_gen` in `$(wx)/build/bakefiles` to regenerate the bakefiles.
|
||||||
|
|
||||||
Finally commit $(wx)/build/bakefiles/make_dist.mk and all the other modified files.
|
Finally commit `$(wx)/build/bakefiles/make_dist.mk` and all the other modified files.
|
||||||
|
|
||||||
Currently we commit the generated makefiles except .dms, .vcp.
|
Currently we commit all the generated makefiles.
|
||||||
|
|
||||||
|
|
||||||
Adding new core library
|
Adding new core library
|
||||||
@@ -150,21 +150,21 @@ called wxFoo.
|
|||||||
|
|
||||||
a) Add files to files.bkl:
|
a) Add files to files.bkl:
|
||||||
* If wxFoo builds from same files on all platforms (e.g. wxNet),
|
* If wxFoo builds from same files on all platforms (e.g. wxNet),
|
||||||
add `FOO_SRC` and `FOO_HDR` variables with lists of sources and headers.
|
add `FOO_SRC` and `FOO_HDR` variables with lists of sources and headers.
|
||||||
* If wxFoo have no files in common (e.g. wxGL), add `FOO_SRC` and `FOO_HDR`
|
* If wxFoo have no files in common (e.g. wxGL), add `FOO_SRC` and `FOO_HDR`
|
||||||
with toolkit or platform conditions. Have a look at `OPENGL_SRC` for an
|
with toolkit or platform conditions. Have a look at `OPENGL_SRC` for an
|
||||||
example.
|
example.
|
||||||
* Otherwise add `FOO_CMN_SRC` and `FOO_CMN_HDR` for common files and
|
* Otherwise add `FOO_CMN_SRC` and `FOO_CMN_HDR` for common files and
|
||||||
`FOO_{platform}_{SRC,HDR}` or `FOO_{toolkit}_{SRC,HDR}` as appropriate. Add
|
`FOO_{platform}_{SRC,HDR}` or `FOO_{toolkit}_{SRC,HDR}` as appropriate. Add
|
||||||
`FOO_PLATFORM_{SRC,HDR}` into "Define sources for specific libraries"
|
`FOO_PLATFORM_{SRC,HDR}` into "Define sources for specific libraries"
|
||||||
section that is conditionally set to one of `FOO_xxx_{SRC,HDR}` based on
|
section that is conditionally set to one of `FOO_xxx_{SRC,HDR}` based on
|
||||||
target platform/toolkit (see `NET_PLATFORM_SRC` definition for an example).
|
target platform/toolkit (see `NET_PLATFORM_SRC` definition for an example).
|
||||||
Finally, define `FOO_SRC` and `FOO_HDR` to contain both
|
Finally, define `FOO_SRC` and `FOO_HDR` to contain both
|
||||||
`FOO_PLATFORM_{SRC,HDR}` and `FOO_{SRC,HDR}` (see `NET_SRC` definition for an
|
`FOO_PLATFORM_{SRC,HDR}` and `FOO_{SRC,HDR}` (see `NET_SRC` definition for an
|
||||||
example).
|
example).
|
||||||
* Add `FOO_HDR` to `ALL_GUI_HEADERS` or `ALL_BASE_HEADERS`.
|
* Add `FOO_HDR` to `ALL_GUI_HEADERS` or `ALL_BASE_HEADERS`.
|
||||||
* If wxFoo is wxBase library (doesn't use GUI), add `FOO_SRC` to
|
* If wxFoo is wxBase library (doesn't use GUI), add `FOO_SRC` to
|
||||||
`ALL_BASE_SOURCES`.
|
`ALL_BASE_SOURCES`.
|
||||||
|
|
||||||
(You can apply different approaches to HDR and SRC variables, if e.g.
|
(You can apply different approaches to HDR and SRC variables, if e.g.
|
||||||
headers are all common but sources are not.)
|
headers are all common but sources are not.)
|
||||||
@@ -174,10 +174,10 @@ a) Add files to files.bkl:
|
|||||||
|
|
||||||
b) Modify bakefile system in build/bakefiles/ to recognize wxFoo:
|
b) Modify bakefile system in build/bakefiles/ to recognize wxFoo:
|
||||||
* Add 'foo' to `MAIN_LIBS` and `LIBS_NOGUI` or `LIBS_GUI` (depending on whether
|
* Add 'foo' to `MAIN_LIBS` and `LIBS_NOGUI` or `LIBS_GUI` (depending on whether
|
||||||
the library depends on wxCore or not) to wxwin.py file.
|
the library depends on wxCore or not) to wxwin.py file.
|
||||||
* Add extra libraries needed by wxFoo (if any) to EXTRALIBS in wxwin.py
|
* Add extra libraries needed by wxFoo (if any) to EXTRALIBS in wxwin.py
|
||||||
* Add `WXLIB_FOO` definition to common.bkl (into the "Names of component
|
* Add `WXLIB_FOO` definition to common.bkl (into the "Names of component
|
||||||
libraries" section). It looks like this:
|
libraries" section). It looks like this:
|
||||||
|
|
||||||
<set var="WXLIB_FOO">
|
<set var="WXLIB_FOO">
|
||||||
<if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('foo')))</if>
|
<if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('foo')))</if>
|
||||||
@@ -228,10 +228,10 @@ h) Add this code to one of wxFoo's files (the more often used, the better):
|
|||||||
WX_CHECK_BUILD_OPTIONS("wxFoo")
|
WX_CHECK_BUILD_OPTIONS("wxFoo")
|
||||||
|
|
||||||
i) Add information about wxFoo to the manual ("Libraries list" section
|
i) Add information about wxFoo to the manual ("Libraries list" section
|
||||||
in libs.tex) and update docs/latex/wx/libs.dia (you need Dia for this)
|
in libs.tex) and update `docs/latex/wx/libs.dia` (you need Dia for this)
|
||||||
to show the dependencies of the new library.
|
to show the dependencies of the new library.
|
||||||
|
|
||||||
j) Also please add `#pragma comment(lib, "foo")` (for all build configuration
|
j) Also please add `#pragma comment(lib, "foo")` (for all build configuration
|
||||||
combinations) to the file include/msvc/wx/setup.h and
|
combinations) to the file include/msvc/wx/setup.h and
|
||||||
add a check for `WXMAKINGDLL_FOO` to the test whether we're building a DLL at
|
add a check for `WXMAKINGDLL_FOO` to the test whether we're building a DLL at
|
||||||
the end of include/wx/msw/chkconf.h.
|
the end of `include/wx/msw/chkconf.h`.
|
||||||
|
@@ -10,17 +10,17 @@ samples/ with demos/ where needed).
|
|||||||
2. "git add" the sample sources (usually based on minimal.cpp) as well.
|
2. "git add" the sample sources (usually based on minimal.cpp) as well.
|
||||||
|
|
||||||
Note that unless your sample requires something special you shouldn't
|
Note that unless your sample requires something special you shouldn't
|
||||||
add foo.rc, foo.ico, ... any more, please just reuse the generic sample.*
|
add foo.rc, foo.ico, ... any more, please just reuse the generic `sample.*`
|
||||||
files in the samples subdirectory.
|
files in the samples subdirectory.
|
||||||
|
|
||||||
3. Create the makefiles:
|
3. Create the makefiles:
|
||||||
- modify samples/samples.bkl (just copy an existing line)
|
- modify samples/samples.bkl (just copy an existing line)
|
||||||
- create foo.bkl (`sed 's/minimal/foo/g' minimal.bkl > foo.bkl` is usually
|
- create foo.bkl (`sed 's/minimal/foo/g' minimal.bkl > foo.bkl` is usually
|
||||||
enough, but you may need to add more `<wx-lib>` lines if your sample uses
|
enough, but you may need to add more `<wx-lib>` lines if your sample uses
|
||||||
anything not in the core lib)
|
anything not in the core lib)
|
||||||
- generate the makefiles for your sample using bakefile. For this you
|
- generate the makefiles for your sample using bakefile. For this you
|
||||||
need to:
|
need to:
|
||||||
- install bakefile (see http://bakefile.sf.net/)
|
- install bakefile (see docs/contributing/how-to-add-files-to-build-system.md)
|
||||||
- run bakefile_gen in build/bakefiles which will regenerate all
|
- run bakefile_gen in build/bakefiles which will regenerate all
|
||||||
makefiles which are not up to date
|
makefiles which are not up to date
|
||||||
|
|
||||||
@@ -29,8 +29,6 @@ samples/ with demos/ where needed).
|
|||||||
or even add a `-f<compiler>` to generate just the makefiles for the given
|
or even add a `-f<compiler>` to generate just the makefiles for the given
|
||||||
compiler (run `bakefile --help` to get the list of possible values).
|
compiler (run `bakefile --help` to get the list of possible values).
|
||||||
See how-to-add-files-to-build-system.md for more information.
|
See how-to-add-files-to-build-system.md for more information.
|
||||||
- currently samples/samples.dsw needs to be updated manually as it's not
|
|
||||||
generated by bakefile.
|
|
||||||
|
|
||||||
4. Modify configure.in Unix compilation:
|
4. Modify configure.in Unix compilation:
|
||||||
- if the sample should only be built if `wxUSE_FOO` is enabled, locate
|
- if the sample should only be built if `wxUSE_FOO` is enabled, locate
|
||||||
@@ -56,8 +54,7 @@ samples/ with demos/ where needed).
|
|||||||
lives in docs/doxygen/mainpages/samples.h; look at the descriptions for
|
lives in docs/doxygen/mainpages/samples.h; look at the descriptions for
|
||||||
other samples, if you are not familiar with Doxygen.
|
other samples, if you are not familiar with Doxygen.
|
||||||
|
|
||||||
7. Add any non-standard sample's files to build/bakefiles/make_dist.mk (the
|
7. Add any non-standard sample's files to `build/bakefiles/make_dist.mk` (the
|
||||||
makefiles copies all bmp, cpp, h, ico, png, rc, xpm and makefiles by
|
makefiles copies all bmp, cpp, h, ico, png, rc, xpm and makefiles by
|
||||||
default, you only need to update it if the sample uses some other files)
|
default, you only need to update it if the sample uses some other files)
|
||||||
and run the ./update-manifests.sh script in distrib/scripts (don't forget
|
and run the ./update-manifests.sh script in distrib/scripts.
|
||||||
to check the changes to manifests/*.rsp files in).
|
|
||||||
|
@@ -136,7 +136,7 @@ For details on using makefiles, configure, and project files, please see
|
|||||||
@c "docs/xxx/install.txt" in your distribution, where @c "xxx" is the platform
|
@c "docs/xxx/install.txt" in your distribution, where @c "xxx" is the platform
|
||||||
of interest, such as @c msw, @c gtk, @c x11, @c mac.
|
of interest, such as @c msw, @c gtk, @c x11, @c mac.
|
||||||
|
|
||||||
All wxWidgets makefiles are generated using Bakefile <http://www.bakefile.org/>.
|
All wxWidgets makefiles are generated using Bakefile <https://www.bakefile.org/>.
|
||||||
wxWidgets also provides (in the @c "build/bakefiles/wxpresets" folder) the
|
wxWidgets also provides (in the @c "build/bakefiles/wxpresets" folder) the
|
||||||
wxWidgets bakefile presets. These files allow you to create bakefiles for your
|
wxWidgets bakefile presets. These files allow you to create bakefiles for your
|
||||||
own wxWidgets-based applications very easily.
|
own wxWidgets-based applications very easily.
|
||||||
|
Reference in New Issue
Block a user