1 (edited by catpaw 2008-07-29 15:29:01)

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 smile)

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 smile)
* 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 smile.

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.

2

Re: Easy Building on Windows for Minimalists

<3 smile thanks a lot!

Antoine de Saint Exupéry: It seems that perfection is reached not when there is nothing left to add, but when there is nothing left to take away.
Besides -  I am the gfx guy!

3

Re: Easy Building on Windows for Minimalists

very very nice smile thank you, i will try this linux way in some days smile

4

Re: Easy Building on Windows for Minimalists

make slows the process down very much compared to bam, afaik. Also, I don't understand why you'd rather want make.. bam doesn't need anything more than python or a compiler? Or am I wrong asu usual, lol?

Official Teeworlds map developer and community moderator
Administrator for the Teeworlds community Teesites

5 (edited by catpaw 2008-07-29 18:12:19)

Re: Easy Building on Windows for Minimalists

Chi11y wrote:

make slows the process down very much compared to bam, afaik. Also, I don't understand why you'd rather want make.. bam doesn't need anything more than python or a compiler? Or am I wrong asu usual, lol?

About the speed, this is definetly wrong! Make is very fast and effective, I daresay even faster than bam, if this is comparable at all. Maybe you mismatch this to other "procedual" build systems bam has been compared to, like jam or so.

Honestly why I rather like make, I don't wanted to hack into the bam source itself to be able to use mingw (which would have been needed to do so). I just wanted a simple Makefile. Make is a standard tool, make is fast, and make is definitely good enough to build a project of the size of teeworlds, it is used (and I used it) for projects several times the size of teeworlds, being able to build on hugh variety of targets.

I don't want to force anybody not to use bam, but I have the same freedom rather to use plain/old/simple/tried make myself.

6

Re: Easy Building on Windows for Minimalists

the newest version of bam is indeed, faster than jam, according to matricks himself...

"It's now much faster (even faster then jam!)" ( http://www.teeworlds.com/?page=journal&id=1318 )

I'm not forcing you to use bam, just curious wink

Official Teeworlds map developer and community moderator
Administrator for the Teeworlds community Teesites

7 (edited by catpaw 2008-07-29 18:15:52)

Re: Easy Building on Windows for Minimalists

Chi11y wrote:

the newest version of bam is indeed, faster than jam, according to matricks himself...

"It's now much faster (even faster then jam!)" ( http://www.teeworlds.com/?page=journal&id=1318 )

I'm not forcing you to use bam, just curious wink

Nobody talks here about jam. Its good old gmake which is pretty, pretty fast also.

But in the speed range both operate this useless to compare them. I mean how much time do both need of the compilcation time, 0.1%? On my computer teeworlds compiles from clean in aprox. 10 seconds in total. in which aprox. 90% takes the compiler. 5% the teeworld generation scripts. 5% the linker. And 0% the build tool smile

8

Re: Easy Building on Windows for Minimalists

perhaps make is slower on your pc because you have a dual/quadcore and forgot to add the option j3 or j4 or j5. or is it already standard? don't know that exactly. Btw: It took for me more time to set up bam than make because make is in most package trees already prebuilt.

9 (edited by catpaw 2008-07-29 21:12:02)

Re: Easy Building on Windows for Minimalists

scosu wrote:

perhaps make is slower on your pc because you have a dual/quadcore and forgot to add the option j3 or j4 or j5. or is it already standard? don't know that exactly. Btw: It took for me more time to set up bam than make because make is in most package trees already prebuilt.

Nobody who ever really tried it ever said make is slower than bam. It was just some hearsay getting mixed up.

10 (edited by Marik 2008-07-30 08:01:37)

Re: Easy Building on Windows for Minimalists

http://img503.imageshack.us/img503/3418/snag1lb3.jpg

i just tried this at my desktop i can only see that there is some problem with the src but my experience in such thingys are very low so i hope u can help me

11

Re: Easy Building on Windows for Minimalists

Marik16. You need to unzip the teebuilder into a directory containing the teeworlds source

12

Re: Easy Building on Windows for Minimalists

i noticed it already big_smile and it works great only thing i need now is how do i apply patch files to this src ??

13

Re: Easy Building on Windows for Minimalists

How about using this?
http://sourceforge.net/project/download … ror=switch

Its from "gnuwin32" http://gnuwin32.sourceforge.net/

Otherwise when you need a GUI "Eclipse" is said to have also a patch utility. But it be a hugh download, and IMHO for Eclipse projects are complicated to setup.

14

Re: Easy Building on Windows for Minimalists

I think bam builds with mingw. We would appreciate if someone makes a bam-patch to support mingw (if matricks has not hacked it in already smile

About speed: yes makefiles is fast, but they are not as flexible as some other build systems. The new bam has autodetect of libraries and other autotool-like features.

Languages shapes the way we think, or don't.

15 (edited by catpaw 2008-07-30 18:15:31)

Re: Easy Building on Windows for Minimalists

void wrote:

The new bam has autodetect of libraries and other autotool-like features.

Alternatively one can use autotool to get autotool-like features smile (and with MSYS autoconf works also on windows)

16 (edited by Slinack 2008-07-30 18:41:59)

Re: Easy Building on Windows for Minimalists

hey cat, I already downloaded (and installed) the Python, MinGW and the Teebuilder.

I've extracted the files -from zip- to my tw folder...

But and now? What I have to do? (I don't understand.)

Do you have msn? hmm


Ty. =]

check out these maps: infiltrate - choco - dustycloud

17 (edited by datag 2008-07-30 18:49:41)

Re: Easy Building on Windows for Minimalists

catpaw, that's really great stuff (TM)!

.

"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." - Terry Pratchett -

18 (edited by catpaw 2008-07-30 18:47:04)

Re: Easy Building on Windows for Minimalists

Slinack wrote:

hey cat, I already downloaded (and installed) the Python, MinGW and the Teebuilder.

I've extracted the files -from zip- to my tw folder...

But and now? What I have to do? (I don't understand.)

Do you have msn? hmm


Ty. =]

You need the tw source (downloadable here under the downloads), not the "normal" tw folder you use to play.

Then after unpacking teebuilder into that, you should just need to doubleclick build.bat

19

Re: Easy Building on Windows for Minimalists

catpaw wrote:

Alternatively one can use autotool to get autotool-like features smile (and with MSYS autoconf works also on windows)

Well, autotools is just plain horror to maintain (personal opinion). I prefer something like SCons that's easier. Or bam, since it's fast smile

Great work anyway.

Languages shapes the way we think, or don't.

20 (edited by Darki 2008-08-08 10:10:04)

Re: Easy Building on Windows for Minimalists

http://nikitalol.ni.funpic.de/pichelp.bmp
it doesnt work >.<
i've installed Python and mingw but it says that it cant find mingw32-make

pls help

http://dj-nevox.de.gg/ also known as NevoX!

21 (edited by catpaw 2008-08-08 10:54:17)

Re: Easy Building on Windows for Minimalists

Darki, mingw32-make is part of the mingw installtion, just be sure to check that field while installing its not checked by default.

22

Re: Easy Building on Windows for Minimalists

i checked it^^ i checked all fields^^

http://dj-nevox.de.gg/ also known as NevoX!

23

Re: Easy Building on Windows for Minimalists

Darki wrote:

i checked it^^ i checked all fields^^

And did you install it to C:\MinGW or elsewhere?

24

Re: Easy Building on Windows for Minimalists

ah i fixed the problem^^ i had to change the C: to D: because my hard disk is D: not C:^^

http://dj-nevox.de.gg/ also known as NevoX!

25

Re: Easy Building on Windows for Minimalists

Nice one catpaw!

It's so easy to setup and compile.

I'm too much of a noob to follow the original instructions to compile Teeworlds.

Thanks!