TRAM 2 - Testing Release Archive Maker

This tool can build fbc/rtlib/gfxlib, copy in binaries & libraries from
MinGW/DJGPP or the previous FB release, package everything into archives,
build the Windows installer, and more. Everything automated, so it doesn't have
to be done manually.

tram2 host:         can build these FB releases:
    win32               win32, dos
    linux               linux, linux-standalone

The binaries-<target>.ini files contain the lists of what binaries/libraries to
copy. manifest-pattern.ini contains regexp patterns that will be passed to
"grep -E" to generate manifests.

Notes:
* tram isn't smart, it just executes a bunch of steps.
* Wrong files in the code base won't stop tram.
* Only one tram can work in a code base at once, otherwise they would overwrite
  each-other's fbc executables and/or other things in the code base.
* You may want to avoid running tram in your main stable FreeBASIC installation,
  because tram may mess it up.
* No SPACE's in paths please, makefiles don't handle it, so tram doesn't either.
* All files for/in the DOS package should probably use the 8.3 filename format.
  Anyways, not all do.

Usage:
    cd src/contrib/tram2
    make
    ./tram2 [options]

tram will work in the FreeBASIC tree it is located in.

Options:
    dos     (win32 only)
        Switch to target dos, instead of the default win32.

    standalone
        Needed to build linux-standalone instead of linux.
        win32/dos: standalone is enabled by default already.

    build
        Configure & compile everything.

    clean
        Perform the clean-up versions of each step.

    manifest
        Generate manifest/<target>.lst, based on the include/exclude patterns
        in src/contrib/tram2/manifest-pattern.ini.

    archive
        Put everything in an archive ready for uploading.

    installer   (win32 only)
        Build the Windows installer.

    deb         (linux only, ignored if standalone is given)
        Create the .deb package containing the linux fbc with /usr prefix.

    source
        Create a source code archive (uses svn export).

    If no options are specified, tram will do nothing.

--------------------------------------------------------------------------------

All-in-one, from zero to release archive:

    The resulting archives (.tar.lzma) are placed in the parent directory of
    the FreeBASIC/ tree. You can easily see differences between the generated
    manifest and your SVN working base.

    linux -> linux:
        $ ./tram2 build manifest archive deb
        $ ./tram2 build clean

    linux -> linux standalone:
        $ ./tram2 standalone build manifest archive
        $ ./tram2 standalone build clean

    win32 -> dos:
        $ tram2 dos build manifest archive
        $ tram2 dos build clean

    win32 -> win32:
        $ tram2 build manifest archive installer
        $ tram2 build clean

--------------------------------------------------------------------------------

Needed stuff (paths can be changed in the source code) & how to setup:

all <target>'s
--------------

    * Working <target> FreeBASIC, defaults:
        dos:    C:/FreeBASIC-dos
        linux:  ~/FreeBASIC
        win32:  C:/FreeBASIC

    * Previous <target> FreeBASIC release, defaults:
      (only needed for standalone)
        dos:    C:/FreeBASIC-dos-0.20
        linux:  ~/FreeBASIC-0.20-standalone
        win32:  C:/FreeBASIC-0.20

dos
---

    * DJGPP 2.03/current packages with djdev204.zip from DJGPP 204/beta, default: C:/DJGPP
        Download:

            http://www.delorie.com/pub/djgpp/beta/v2/djdev204.zip          (core)
            http://www.delorie.com/pub/djgpp/current/v2gnu/bnu219b.zip     (binutils 2.19 binaries)
            http://www.delorie.com/pub/djgpp/current/v2gnu/bnu219a.zip     (binutils additional stuff: libiberty, BFD headers, ..)
            http://www.delorie.com/pub/djgpp/current/v2gnu/gcc442b.zip     (gcc 4.4.2 binaries)
            http://www.delorie.com/pub/djgpp/current/v2gnu/gdb611b.zip     (gdb 6.1.1 binaries)
            http://www.delorie.com/pub/djgpp/current/v2gnu/gpp442b.zip     (g++ 4.4.2 binaries)

        Add environment variable:
            DJGPP   =   C:\DJGPP\djgpp.env

        Copy/rename
            C:\DJGPP\lib\gcc\djgpp\4.42\libsupcxx.a
        to
            C:\DJGPP\lib\gcc\djgpp\4.42\libsupcx.a
        (fbc expects that, probably some 8.3 filename issue)

    tram2 uses C:\DJGPP\bin\gcc.exe etc directly, so DJGPP does not need to be
    in the PATH. However, the (win32) MSYS is needed in the PATH.


linux
-----

    * Download binutils 2.20.51 sources:
            ftp://sourceware.org/pub/binutils/snapshots/binutils-2.20.51.tar.bz2
      Build & install it.

        $ cd ~/binutils-2.20.51-build
        $ ../binutils-2.20.51/configure --disable-shared --disable-nls
        $ make
        $ cd bfd      ; sudo make install-strip; cd ..
        $ cd binutils ; sudo make install-strip; cd ..
        $ cd gas      ; sudo make install-strip; cd ..
        $ cd gprof    ; sudo make install-strip; cd ..
        $ cd ld       ; sudo make install-strip; cd ..
        $ cd libiberty; sudo make install      ; cd ..

win32
-----

    * With TDM-GCC 4.4.1, binutils 2.19

        Download from http://sourceforge.net/downloads/mingw/

            binutils-2.19.1-mingw32-bin.tar.gz
            mingwrt-3.17-mingw32-dev.tar.gz
            mingwrt-3.17-mingw32-dll.tar.gz
            w32api-3.14-mingw32-dev.tar.gz
            make-3.81-20090914-mingw32-bin.tar.gz
            gdb-6.8-mingw-3.tar.bz2                 (for gdb.exe)
            gettext-0.17-1-mingw32-dev.tar.lzma     (for libintl.a)

        And from http://sourceforge.net/downloads/tdm-gcc/

            gcc-4.4.1-tdm-2-core.tar.gz
            gcc-4.4.1-tdm-2-g++.tar.gz


    * Download libgdsl sources & compile it, put it into C:/MinGW/lib.
        (Replacement for the libgdsl from FreeBASIC-0.20, which was apparently broken)

    * NSIS (for the win32 installer), default: C:/NSIS
        Download from http://nsis.sourceforge.net/Download

    * ddraw.h & dinput.h in C:/MinGW/include
      (win32 DirectX headers needed to compile gfxlib2)

    tram2 will use the gcc/binutils/shell tools from PATH, so MinGW & MSYS must
    be in your PATH.
