﻿// This file is in AsciiDoc format. It is converted to README.html.

Compilation instructions
------------------------


Required tools
~~~~~~~~~~~~~~

FAIL is written in the Ć programming language.
Official releases include translation of FAIL to C,
so you only need a C compiler and Make utility.
For other cases (Git or JavaScript)
you'll need http://cito.sourceforge.net[cito].


Required libraries
~~~~~~~~~~~~~~~~~~

For all builds you will need development files for libpng >=1.2.5
and zlib >=1.2.3.
In some systems they are installed by default or included in software
repositories.
For other systems, including Windows, you will need to build
and install these libraries from sources. See
http://www.libpng.org/pub/png/libpng.html[libpng website] for downloads
and build instructions.


Getting officially released source code
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to compile an official release of FAIL, download source distribution
(`fail-*.tar.gz`) and uncompress it to a directory of your choice.

On Unix-like systems:
--------------------------------------------------------------------------------
tar zxf fail-*.tar.gz
--------------------------------------------------------------------------------

On Windows you may use http://7-zip.org[7-Zip].


Getting latest source code
~~~~~~~~~~~~~~~~~~~~~~~~~~

Alternatively you may get the latest version from the Git repository.
To do this using a command-line Git client:
--------------------------------------------------------------------------------
git clone git://git.code.sf.net/p/fail/code fail-code
--------------------------------------------------------------------------------

This will fetch the latest code to a new directory called `fail-code`.


Building fail2png, GNOME thumbnailer and ImageMagick coder on Unix-like systems
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From your shell prompt navigate to the directory which contains `fail.ci`.

Review the contents of `Makefile` and run:
--------------------------------------------------------------------------------
make
--------------------------------------------------------------------------------

To install fail2png under `PREFIX`, run:
--------------------------------------------------------------------------------
make install-fail2png
--------------------------------------------------------------------------------

To install GNOME thumbnailer and fail2png, run:
--------------------------------------------------------------------------------
make install-thumbnailer
--------------------------------------------------------------------------------

After you restart your system, Nautilus windows should display thumbnails
of Atari images.

Installation of the ImageMagick coder requires that you have complete source
distribution of ImageMagick. Current version of the ImageMagick coder has been
tested with version 6.7.4-0 of ImageMagick.

Run +make+ specifying path to the sources:
--------------------------------------------------------------------------------
make install-magick MAGICK_INCLUDE_PATH=/path/to/im/sources
--------------------------------------------------------------------------------

To verify the installation, try to open some
http://fail.sourceforge.net/examples.zip[example files]:
--------------------------------------------------------------------------------
display COYOTE.RIP
--------------------------------------------------------------------------------

You can also install all components at the same time, for example:
--------------------------------------------------------------------------------
make install PREFIX=/opt/fail MAGICK_INCLUDE_PATH=/src/ImageMagick-6.7.4-0
--------------------------------------------------------------------------------


Using fail2png
~~~~~~~~~~~~~~

Run the program from command line to see the syntax.
Unless you specify the `-o`/`--output` option, the output filename will be
constructed from the input filename with the extension changed to `png`.


Building fail2png, XnView/ImageMagick/Imagine/Windows Explorer plugins and FAILWin on Windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Download http://www.mingw.org/[MinGW] and install binutils, core compiler,
w32api and MinGW Make.

From the command prompt navigate to the `win32` directory and run:
--------------------------------------------------------------------------------
mingw32-make
--------------------------------------------------------------------------------


Building HTML 5 based viewer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Make sure http://cito.sourceforge.net[cito] is on your PATH.

From the command prompt navigate to the `html5` directory and run:
--------------------------------------------------------------------------------
make
--------------------------------------------------------------------------------
