
-----------------------------------------------------------------------------
1. INSTALL (SHORT STORY)
-----------------------------------------------------------------------------

First make sure you have gcc, g++, make and cmake installed. To generate
the makefiles, go to the wla-dx main folder, and write

  cmake -G "Unix Makefiles" .  ; under Unix / OS X / Cygwin / MSYS2
  cmake -G "MSYS Makefiles" .  ; under MSYS / MinGW
  cmake -G "MinGW Makefiles" . ; under (plain) MinGW
  cmake -G "NMake Makefiles" . ; if you wish to use NMake

After CMake has done its job, just run

  make

You will get all the executables in the "binaries" folder. Or with

  make install

all the executables will be copied to /usr/local/bin

PS. If you are running Windows, and want to create Windows executables,
you can find "WLA DX.sln" Visual Studio solution under windows folder.


-----------------------------------------------------------------------------
2. INSTALL (LONG STORY)
-----------------------------------------------------------------------------

As of commit 1bc0c6a, WLA now uses the CMake Build System. As WLA is written
in ANSI C and only depends on the C Standard Library, any hosted C89 compiler
with an 8-bit character should be able to compile and run WLA. However, for
ease of compiling on platforms where WLA will primarily be used, CMake is a
good abstraction for Makefile platform differences.

In the future, perhaps cross-platform Makefiles can be generated by CMake, so
all targets can use CMake to generate Makefiles, and the source tree plus
Makefiles can be transferred to the target machine to be compiled natively.

Assuming $WLA_ROOT is the top level of WLA source, Makefiles can be generated
using the following commands:

  mkdir build-wla
  cd build-wla
  cmake -G $MAKE_TYPE $WLA_ROOT

$MAKE_TYPE can be any Makefile type that CMake supports.


-----------------------------------------------------------------------------
3. INSTALL (THE OLD SCRIPTS)
-----------------------------------------------------------------------------

For compatibility purposes, legacy Makefiles are kept in the legacy_mk branch.
To get to these, do:

  git checkout -b legacy_mk
  git pull origin master

This will bring the source up to date with master and allow using the old style
makefiles for older (and current) systems that do not have CMake, such as
Amiga and MSDOS.

To compile all the binaries, write

  ./unix.sh {JOBS} ;under un*x / OS X. replace {JOBS} with 8 if you have a quad core,
                    4 if you have a dual core CPU.
  msdos.bat        ;under msdos and djgpp.
  execute amiga    ;under amigaos 1-3. you'll need SAS/C compiler for these to work.
  execute amigaos4 ;under amigaos 4.
  win32.bat        ;under win32 and cygwin (www.cygwin.com) or mingw (www.mingw.org).

You can find the executables under the binaries directory.

If the system tries to link/compile with cc you might run into trouble.
Try to redefine shell enviroment variables CC and LD to gcc, e.g., in bash:

  export CC='gcc'
  export LD='gcc'

Gcc should compile WLA DX just fine.

PS. Some legacy makefiles (like for Amiga and MSDOS) can also be found in the
"historical" folder. To use those you'll need to copy them to where they
need to be (e.g., "/historical/wlalink/*" to "/wlalink/", "historical/makefiles/*"
to "/", "/historical/msdos.bat" to "/"...)


-----------------------------------------------------------------------------
4. HOW TO MAKE E.G. DEBUGGABLE EXECUTABLES
-----------------------------------------------------------------------------

Using CMake:

  cmake -DGDB_DEBUGGING=ON -DCMAKE_BUILD_TYPE=Debug -G "[your platform]"
  make


-----------------------------------------------------------------------------
5. HOW TO MAKE E.G. GPROF EXECUTABLES
-----------------------------------------------------------------------------

Using CMake:

  cmake -DCMAKE_C_FLAGS="-g -pg" -G "[your platform]"
  make
