IMPORTANT NOTE: SDL and Freetype libs are not shipped with Teeworlds 0.7.x. You must download them separately and place them in the other/ folder.
Also: Teeworlds 0.5.2 and earlier requires python 2.x to compile. Python 3.x will not work. Python 3.x support is introduced with Teeworlds 0.6.0.
Also: If you are using bam 0.2.0 (needed for Teeworlds 0.5.2 and earlier) the bam binary will not be in the bam directory, but in bam/src. You will need to change the paths accordingly to that or copy/move the bam executable to the bam directory.
Q: How do I get rid of these errors?
undefined reference to `__stack_chk_guard'
Remove -fstack-protector -fstack-protector-all
from bam.lua (in 0.5.2 and earlier default.bam) in Teeworlds root directory and then run
../bam/bam -c all
Q: What is BAM?
Bam is the build system made by matricks used in Teeworlds.
- Download and unzip bam
- Download and install Python (for Teeworlds 0.5.2 and earlier the 2.x version, not 3.x).
- Download and unzip Teeworlds.
- Download and install MinGW. Select 'mingw32-gcc-g++' package inside MinGW installer.
- Download and install ZLib.
-
Update 'PATH' windows environment variable including MinGW and zlib bin folders.
- Run in cmd (start>run>cmd):
setx PATH "%PATH%;C:\MinGW\bin;C:\Program Files (x86)\GnuWin32\bin;"
-
Launch
make_win32_mingw.bat
script to compile bam.- Run in cmd (start>run>cmd):
cd <folder_where_unzipped_bam_package> make_win32_mingw.bat
Run in cmd (start->run->cmd):
cd teeworlds-version-src
..\bam\bam
This will build the client and server.
Bam parameters are described in a later section.
- Download and install Visual C/C++ Express.
- Launch
make_win32_msvc.bat
script to compile bam.- Run in cmd (start>run>cmd):
cd <folder_where_unzipped_bam_package> make_win32_msvc.bat
Run the x86 Native Tools Command Prompt
(32Bit) or the x64 Native Tools Command Prompt
(64Bit) from the start menu.
Or
Run in cmd (start->run->cmd):
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86
cd teeworlds-version-src
..\bam\bam
For 64-bit, use amd64
instead:
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" amd64
This will build the client and server.
Bam parameters are described in a later section.
Use your package manager (apt-get, emerge or whatever is used on your distribution) to install the following (you will need the header files):
- python
- alsa (asound)
- gl
- glu
- x11
- libsdl
- freetype
(python is the only one which is required to build server)
Install the XCode tools from apple. Download libsdl from the http://libsdl.org and put SDL.framework in /Library/Frameworks
Run the following commands to download and unzip bam and teeworlds: Replace VERSION in teeworlds-VERSION-src.zip with the version you want (probably the latest, 0.7.0)
Using wget
:
$ wget -qO- https://github.com/matricks/bam/archive/v0.5.0.tar.gz | tar xj
$ wget -qO- https://downloads.teeworlds.com/teeworlds/teeworlds-VERSION-src.zip | tar xj
Alternatively, using fetch
:
$ fetch https://github.com/matricks/bam/archive/v0.5.0.tar.gz
$ unzip bam.zip
$ rm bam.zip
$ fetch https://downloads.teeworlds.com/teeworlds/teeworlds-VERSION-src.zip
$ unzip teeworlds-VERSION-src.zip
$ rm teeworlds-VERSION-src.zip
$ cd bam
$ ./make_unix.sh
$ cd ..
This will build the client and server.
$ cd teeworlds-VERSION-src
$ ../bam/bam
For 0.7.0 and later, you will find the binaries in the build
folder.
For more advanced options check the bam documentation.
By default, Teeworlds compiles in debug mode. To compile in release mode, add conf=release
to the bam arguments. E.g.:
$ ../bam/bam conf=release
By default, Teeworlds compiles the game
target, i.e. the client and server. Available targets are:
- game (client and server)
- client
- server
- tools
- masterserver
E.g. to build the tools and master server in release mode use the following arguments:
$ ../bam/bam conf=release tools masterserver
You may specify the architecture using arch
, e.g. arch=X86
or arch=x64
.
Available targets are:
- release (for all in release mode)
- debug (for all in debug mode)
- server_release
- server_debug
- client_release
- client_debug
E.g. to build server debug use the following arguments:
$ ../bam/bam server_debug