Topic: Easy Building on Windows for Minimalists
Intro
You know the situation, building teeworlds on windows is a complicated process that requires some huge downloads. People provide various patches for additions to the system, but people are hardly able to get the executables. Now there is help!
"teebuilder" will build teeworlds for you on windows system with minimal downloads (I didn't messure it, but it shouldn't be more than a few dozend MB, thats very small compared to the 2G or more the SDKs required in the traditional build process)
What do you NOT need to download with teebuilder?
* Visual C/C++ Express (teebuilder uses MinGW, the minimalist GNU C compiler for windows)
* Windows Server 2003 Platform SDK (I don't even fully understand why traditional teeworld build needs that)
* DirectX SDK (Teebuilder provides a precompiled archive for port_audio, which would require the headers from the SDK)
* BAM. (Oh my gosh, yes bam is not required for teebuilder. It uses gmake (oh what blasphemy )
What do you still need?
* Python (because teeworld builds some source files with python scripts)
* MinGW (Thats the GNU compiler for windows, you need *some* compiler after all )
* Teebuilder the new build "script"
Build instructions:
* Download and install Python (same place as ever, http://www.python.org/download/)
* Download and run the MinGW autoinstaller (http://sourceforge.net/project/showfile … up_id=2435)
** Be sure to select to install "g++" and "gnu make" from the installer, as they aren't selected by default.
* Download "teebuilder" (http://teecode.googlecode.com/files/tee … 4.2-t1.zip) and copy its contents over a teeworlds source tree. It will overwrite one file e_system.c
* If you did not install Python and MinGW to the default paths you have to edit build.bat with notepad or so to reflect the places you installed Python/MinGW to. If you did use default places, skip this step.
* Double click build.bat, it should compile the client, the server and the tools.
The resulting .exe files are a bit larger than the one compiler with the microsoft compiler, because AFAIK the gnu linker does not do "aggressive" dead-code elimination. Otherwise they should be fairly compareable.
-----
MinGW Crosscompiling from Linux
Now, it also gets even better for linux coders! Ever tired of people asking you for exe files of your stuff? But you don't want to even boot and get angry about this crap of a system (if you have installed it after all)? Now you can create windows .exe files right out of Linux (I assume Ubuntu in the further instructions)!
* On your system you should have the stuff installed you normally build teeworlds with. (I presume I speak to a normal "computer expert" here)
* Fire up ubuntus dselect or aptitude and install the "mingw" packages (c, c++, binutils)
* Now there is some bug with the current mingw distribution on ubuntu/hardy execute this to workaround it:
sudo cp /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libstdc++.a /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libstdc++.a.org
sudo i586-mingw32msvc-ar d /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libstdc++.a stubs.o
* Unzip the teebuilder into a teeworlds sourcepath, you should not use a sourcepath that is already used by another build process like bam, I have no idea how far the intermediate files might conflict with each other.
* run "export TARGET=crossmingw && make" and Ta Da you have the windows .exe you can upload somewhere for the "windowzer" to run it .
Out of some reason this exe files are yet a tad larger, than mingw compiled natively on windows, I have no idea why, but this isn't a real big problem, or?
---
Some reflective words
Why have I chosen make over bam? I don't know, I like to use standard tools when easily available. I have parsed the default.bam troughly to be able to construct a matching Makefile and I see what one can see into it. Bam is more procedual like while make is a mostly functional language. I think we are most times used to procedual thinking, so it might be easier to get into, however I think you greatly underestimate make, its still a very powerfull tool. Just replace "old" with "tried". I don't know when you look at both, "default.bam" and "Makefile" from teebuilder which is really easier to read? I don't know it, now when I presume I forget my experiences already knowing make, I think they might be pretty equal. I don't request this to be integrated in the default distro (but I wouldn't mind if also), just keep on using bam. I will gladly service the Makefile, since in the speed of project wide build changes, I don't expect it to be a big workload also.
TODOs:
* use an obj path for the interim files
* compile natively on linux (but I don't know why this would be needed)
* Create a one-download fits all file which includes already the needed python and mingw binaries for the extra lazy people. Luckly the open licenses of using open tools would allow one to create such.