[Version]
The build guide is Copyright © 2023 by Torben Bruchhaus. Version history:
- 1.0: 7th of January 2017
- 1.1: 23rd of February 2019
- 1.2: 15th of June 2023
- 1.3: 12th of July 2023

[General]
All make commands uses the argument "-j?" which is invalid. You must replace the "?"
with the number of threads supported by your CPU, eg. for 4 threads use "-j4" in order
to optimize the build process. Using multi-threaded make may cause problems and if it
does use "-j1" or omit the switch completely.

$BASE is used as a synonym for the base folder in where all work is done. You can make
this folder wherever you like.


[Prerequisities]
In order to build FFQueue you need the G++ compiler, wxWidgets version 3.0.* (or newer)
development files and FFQueue source code.

  {G++ - Windows}
  Download and install MinGW or MinGW-w64. FFQueue has been build using MinGW-w64 32bit,
  other compilers may cause issues or require other steps than the ones covered in this
  guide. Make sure that the "\bin" folder of the compiler is part of the "PATH" environment
  variable.

  {wxWidgets - Windows}
  Download wxWidgets as an archive from https://www.wxwidgets.org/downloads/ and
  extract it to $BASE\wxWidgets. Change working directory to $BASE\wxWidgets\build\msw\
  and execute the command: "mingw32-make -f makefile.gcc BUILD=release SHARED=0 setup_h"
  to setup wxWidgets for build and then run the command: "mingw32-make -j? -f makefile.gcc
  BUILD=release SHARED=0" in order to actually bild wxWidgets.

  {G++ - Linux}
  Install package "g++" and/or "gcc".

  {wxWidgets - Linux}
  Install package "libwxgtk*-dev" (* may vary, on my current system it is "3.0-gtk3") -
  this will only allow dynamically linked executables to be generated. If you want a
  statically linked (stand-alone) executable you will need to download wxWidgets source
  code, extract it to "$BASE/wxWidgets" and build wxWidgets with the commands:

  > cd $BASE/wxWidgets
  > mkdir gtk-build
  > cd gtk-build
  > ../configure --enable-unicode --disable-shared --with-libpng
  > make -j? SHARED=0 BUILD=release

  {FFQueue source}
  If you have GIT, the easiest way to get the FFQueue source code is to run the commands:

  > cd $BASE
  > git clone https://github.com/bswebdk/FFQueue

  Please note that GIT may put the source code into a directory named "FFQueue-master"
  instead of "FFQueue". You can also download the source code as an archive from
  http://ffqueue.bruchhaus.dk/ - you must extract the archive to "$BASE/FFQueue/*".


[AutoMake]
This section is only useful for Linux users. You need to make sure that "wx-config" can
be found by the shell. You can test it by executing the command "wx-config --version",
this should give you a version number like "3.0.4". After this is done, execute the
following commands in a terminal:

> cd $BASE/FFQueue
> re-automake.sh
> mkdir build
> cd build
> ../configure
> make -j?
> sudo make install

NOTE: Step 2 is only required if the make files bundled with FFQueue are not compatible
with the target system. The shell script will delete any pre-generated make files
before re-generating them for the target system. This step requires the package "automake"
to be installed, if not present the script will not do anything.


[Makefile]
FFQueue has two makefiles which are both generated by the FFQueue debug build. Both
makefiles are based on the build config in the Code::Blocks project file:

Makefile.win : Based on the Release_Win build target and used for Windows.
Makefile.lin : Based on the Release_Lin build target and used for Linux.

You may need to modify the makefiles in order to make sure that the paths to the
comiler (CXX:=???), linker (LINKER:=???), windres (WINDRES:=???) and wxWidgets (WX:=???)
are valid.

The following commands expects the current working directory to be "$BASE/FFQueue" in
which the makefiles are located. When this is done you must execute:

Linux    > make -f Makefile.lin -j?
Windows  > mingw32-make -f Makefile.win -j?

The windows build requires the path to the MinGW(-w64) binaries to be added to the global
search path. If it is not, then you must modify the line with "CXX:=" in Makefile.win
to the full path to (mingw32-)g++.exe and you must specify the full path to mingw32-make
in the command above.

Makefiles uses $BASE/FFQueue/build/ as output folder for binaries.


[Code::Blocks]
If you have a working Code::Blocks development environment with GCC/MinGW compiler and
wxWidgets, the easiest sollution is to simply open the FFQueue.cbp project file, select
a build target, and click the build button. Selecting the right build target should be
obvious, but:

Release_Win : Release build for Windows.
Debug_Win   : Debug build for Windows (*).
Release_Lin : Release build for Linux.
Debug_Lin   : Debug build for Linux (*).

The project file depends on a global variable (C::B menu Settings->Global variables...)
named "wx" which must point to the root of wxWidgets (not the build folder). Depending
on your system you may need to tweak some compiler/linker settings: Have a blast! :-)

Code::Blocks uses $BASE/FFQueue/bin/Release/ as output folder for release binaries.

(*): Debug builds contains extra functions for creating makefiles, binary resources,
testing etc. These functions are available through a dropdown menu triggered by the
About button. You are hereby encouraged not to release debug builds to the end user,
since it would make no sense.
