﻿Compilation instructions
========================


Required tools
--------------

RECOIL is written in the Ć programming language.
Official releases include translation of RECOIL to C,
so you only need a C compiler and Make utility.
In other cases (Git, Paint.NET, HTML 5, Android, UWP)
you'll need cito (http://cito.sourceforge.net).


Getting officially released source code
---------------------------------------

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

On Unix-like systems:

    tar zxf recoil-*.tar.gz

On Windows you may use 7-Zip (http://7-zip.org).


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/recoil/code recoil-code

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


Building recoil2png, GNOME thumbnailer, XnView MP
and ImageMagick plugins on Unix-like systems
-------------------------------------------------

Install development files for libpng.

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

Review the contents of Makefile and run:

    make

To install recoil2png under PREFIX, run:

    make install-recoil2png

To install the XnViewMP plugin, run:

    make install-xnview

To install the GNOME 3 thumbnailer and recoil2png, run:

    make install-thumbnailer

Or, if you are still on GNOME 2:

    make install-gnome2-thumbnailer

After you restart your system, Nautilus windows should display thumbnails
of retro computer 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
example files (http://recoil.sourceforge.net/examples.zip):

    display COYOTE.RIP

You can also install all components at the same time, for example:

    make install PREFIX=/opt/recoil MAGICK_INCLUDE_PATH=/src/ImageMagick-6.7.4-0


Using recoil2png
----------------

Run recoil2png without arguments to learn 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 recoil2png, XnView/XnView MP/ImageMagick/Imagine/Windows Explorer
plugins and RECOILWin on Windows
--------------------------------------------------------------------------

In Cygwin setup (https://www.cygwin.com/) select
bash, coreutils, dos2unix, git, libxslt, make, tar,
mingw64-{i686,x86_64}-{gcc-core,gcc-g++,headers,libpng,runtime,zlib}.

Unfortunately mingw64-libpng is DLL-only, so get libpng source
(http://libpng.org/pub/png/libpng.html) and compile it yourself:

    bash ./configure --host=i686-w64-mingw32 && make && mv .libs/libpng16.a /usr/i686-w64-mingw32/sys-root/mingw/lib/
    bash ./configure --host=x86_64-w64-mingw32 && make && mv .libs/libpng16.a /usr/x86_64-w64-mingw32/sys-root/mingw/lib/

Install ImageMagick (http://www.imagemagick.org/) and edit its directories
in RECOIL's win32/Makefile.

To build RECOIL, from the command prompt navigate to the win32 directory and run:

    make


Building Paint.NET plugin on Windows
------------------------------------

Install Paint.NET and GNU Make (e.g. Cygwin's, https://www.cygwin.com/).

Make sure cito is on your PATH.

From the command prompt navigate to the win32 directory and run:

    make RecoilPaintDotNet.dll


Building HTML 5 based viewer
----------------------------

Make sure cito is on your PATH.

From the command prompt navigate to the www directory and run:

    make


Building Android application
----------------------------

Install Android Studio (https://developer.android.com/studio/index.html)
or the command-line SDK.

Make sure cito and ImageMagick 7 (http://imagemagick.org/) are on your PATH.

Build the project as any other Android project.


Building recoil2png and Quick Look / XnView MP plugins on macOS
---------------------------------------------------------------

Install Xcode Command Line Tools.
For recoil2png, install libpng with homebrew.

From the command prompt navigate to the osx directory and run:

    make


Building Windows 10 application
-------------------------------

Install Visual Studio 2017 and ImageMagick 7.

Make sure cito and magick are on your PATH.

Build uwp/RECOIL.sln in Visual Studio.
