
            Compiling and installing Glyph Keeper
            -------------------------------------

There are two ways of compiling and installing GK:
   1. Makefile-based installation.
   2. Manual installation.
Makefile installation is easier, but supports only few platforms.
Manual installation will work on larger number of platforms, but requires
you to do things by hand.



------------------------------
1. Makefile-based installation
------------------------------

Supported platforms: MinGW, MSVC.

Requirements: FreeType and target library (usually Allegro or SDL) installed
and ready to use. Some platforms may have additional requirements.

All makefiles have same set of targets:

    lib       - makes static GK library.
                   .lib file will be created in "obj/" directory.
                   .dll file will be created in "examples/" directory.

    examples  - compiles GK examples in "examples" and "benchmark"
                   directories.

    all       - lib & examples.

    clean     - deletes all GK object files and example executables for
                   specified TARGET.

    veryclean - deletes all generated GK files, for all targets.

    install   - installs GK library and header to compiler standard locations.

    uninstall - removes GK library and header from compiler directories.

    <no targets> = all

All makefiles have a mandatory parameter TARGET, that must be set to
either "TEXT", "ALLEGRO", or "SDL". You can set it in environment,
or pass as a parameter to 'make':   make TARGET=TEXT all

Optional make parameters (you can pass them to make in the command line,
or set as environment variables):

    GLYPH_DLL=1          - make a Glyph Keeper DLL. Without this option
                           a static library will be made.

    ALLEGRO_STATICLINK=1 - Use static Allegro. This macro can't be combined
                           with GLYPH_DLL=1.

    FT_LIB=<libfile>  - Specify FreeType library file. Use this option if
                        you have FreeType 2.1.10 or newer installed in your
                        system and want to use it instead of FreeType
                        bundled with GK.

When you execute "make install" it will show you the list of libraries you
should link your program to.




1.1 MSVC
--------

Installation is done by running Microsoft nmake, without any GNU tools.
MSVC 7.1 and 8.0 are supported, with Makefile.MSVC71 and Makefile.MSVC80,
respectively. Installation with MSVC 7.1:

Compiling Glyph Keeper:   nmake /f Makefile.MSVC71 TARGET=TEXT
Installing:               nmake /f Makefile.MSVC71 TARGET=TEXT install
Cleaning up:              nmake /f Makefile.MSVC71 TARGET=TEXT clean

Here I used "TEXT" target, for Allegro or SDL targets use "ALLEGRO" or "SDL"
instead. For MSVC 8.0 use 'Makefile.MSVC80'.

If you don't have MSVC environment set up, you can create and run
a batch-file, containing:

    call "C:\Program Files\MS Visual Studio .NET 2003\Common7\Tools\vsvars32.bat"
    nmake /f Makefile.MSVC71 TARGET=TEXT lib install

(change the path to "vsvars32.bat" according to your installation of MSVC)
"Makefile.MSVC71" may work for MSVC 6.0 also, but I don't have 6.0 so I can't
test it now.

"Makefile.MSVC80" makefile was tested with Visual C++ 2005 Express Edition
Beta 2, which is available as a free download from Microsoft. If you use it,
you will also have to separately download and install two more things:
Platform SDK and DirectX SDK. (Search MS site, they are free too).
Now it gets a bit messy - those SDK also need their environment set. If you,
like all normal people, don't have that environment set up all the time, you
will have to make a batch file, containing:

    call "C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat"
    call "C:\Program Files\Microsoft Platform SDK\SetEnv.Cmd" /XP32 /RETAIL
    call "C:\Program Files\Microsoft DirectX 9.0 SDK (June 2005)\Utilities\Bin\dx_setenv.cmd" X86
    nmake /f Makefile.MSVC80 TARGET=TEXT lib install

(Fix the dirs according to your install)

Actually, I already included those .bat files with Glyph Keeper distribution:
"make.msvc71.bat" and "make.msvc80.bat". Be sure to review their content and
fix the directories before using them! You must also uncomment one of the
lines calling 'nmake', according to your target library. You can then run
them, specifying makefile targets in the command line, like this:

     make.msvc71.bat lib install
or
     make.msvc71.bat clean uninstall

Note: File "dx_setenv.cmd" of DirectX SDK of June 2005 is broken.
To fix it open it in plain text editor (Notepad is OK, but not Word):
C:\Program Files\Microsoft DirectX 9.0 SDK (June 2005)\Utilities\Bin\dx_setenv.cmd
(or wherever it is on your system) and add this line at the begining:
@set DXSDK_DIR="C:\Program Files\Microsoft DirectX 9.0 SDK (June 2005)\"
(change path according to your installation)

Using GK: After 'install' step you can simply include <glyph.h> in your
program and link to libs it will tell you to link to.



1.2 MinGW
---------

Requirements: MinGW with reasonably recent GCC and binutils, GNU make.

If your MINGDIR environment variable points to MinGW location, and PATH
variable contains msys\bin and mingw\bin (wherever they are installed),
you can simply copy "Makefile.MinGW" to "Makefile" and run:

Compiling Glyph Keeper:   make TARGET=TEXT
Installing:               make TARGET=TEXT install
Cleaning up:              make TARGET=TEXT clean

Here I used "TEXT" target, for Allegro or SDL targets use "ALLEGRO" or "SDL"
instead.

If you, like me, don't have MinGW environment set up, you'll have to create
and run a batch file, containing:

    set MINGDIR=C:\MinGW
    set PATH=C:\msys\1.0\bin;C:\MinGW\bin;%PATH%
    make -f Makefile.MinGW TARGET=TEXT

(Fix directories according to your MinGW and MSYS install)

This batch file is already included in Glyph Keeper distribution under the
name "make.mingw.bat". You have to check it before running - you may need
to change the paths, and also you have to uncomment one of the lines calling
'make', depending on your target library. You then run it:

    make.mingw.bat lib install
or
    make.mingw.bat clean uninstall

Using GK: After 'install' step you can simply include <glyph.h> in your
program and link to libs it will tell you to link to.





----------------------
2. Manual installation
----------------------

See docs/compiling.html
