Mechanized Assault & eXploration Reloaded

Howto: Create a kdevelop project for maxr

This tutorial is meant for people who'd like to create a kdevelop project of maxr for debugging or hacking purposes. I'll go through the process of setting up a project file and how to bring the sources from SVN into the project. For this we need kdevelop and the build-essentials (autotools, gcc, ...) of course. Since maxr is a SDL project we need the SDL libraries including SDL_mixer and SDL_net as well. Make sure everything is installed (including the proper header or devel packages).

First step is done on a terminal (konsole e.g.). Create a directory where we'll save everything related to maxr:

beko@morpheus:~ # mkdir -p maxr/dev

Now start kdevelop. Go for the menu entry "Project -> New project". A wizard appears and asks for the type of project. Choose "C++ application" and "Simple SDL Program". Enter the new directory we just created and give the project the name maxr (or whatever you prefer).

When done click on "Next". You'll get asked for what kind of version control system you want to use. We use subversion. Select it from the drop down dialog and flag "Do not do anything".

Skip the next steps using "Next" until you reach "Finish". After the project is set up an example file maxr.cpp has been created. Close the file and locate the "Automake Manager" in the lower right corner. Remove the file from the project and select "Also remove from disct".

Now it's time for some terminal work again. Fire up "konsole" or whatever you prefer and enter the project folder. Now it's time to check out the maxr source from SVN.

DownloadSource code (Text):
  1. beko@morpheus:~ # cd maxr/dev/maxr/src/
  2. beko@morpheus:~/maxr/dev/maxr/src # svn co svn:// ./
  3. A    serverevents.h
  4. A    vehicles.cpp
  5. A  
  6. ....
  7. A    savegame.h
  8.  U   .
  9. Checked out, Revision 1654.
  10. beko@morpheus:~/maxr/dev/maxr/src #

When the checkout is complete turn back to kdevelop. Remember where we removed this unneeded file main.cpp? Now we "Add existing file" to the project at the same place.

You may use the following filters in order to simplify this task a lot. For each filter hit the button "Add all".


When all c and cpp files are attached to the project do the same for "header in noinst" but this time for header files:


Now we have to set the LDFLAGS for the project. For this select the menu "Project -> Project Options". Here we choose the "configure options". Locate the field LDFLAGS and enter "-lSDL -lSDL_net -lSDL_mixer".

Kdevelop will ask you whether to "Re-run configure for debug now?". Say no since this will fail anyway at this point. Instead back on the main window go through the following menu points in order::

Build -> Run automake and friends -> ***Success***

Build -> Run configure -> ***Success***

If something goes wrong in the last two steps you probably have a typo in the LDFLAGS or no SDL headers installed or something like that. Check every step again and make sure everything needed for building c++ is installed on your system. When done you can finally build the project with F8.

Build project F8 -> ***Success***/

Hopefully you'll get a success at this point as well. Please keep in mind that SVN is unstable and changes sometimes within minutes.

Now we have to set up the game data or maxr won't start. The needed files are separated from the source. Open a terminal and go into your project directory. Enter debug/src here:

DownloadSource code (Text):
  1. beko@morpheus:~ # cd maxr/dev/maxr/debug/src/
  2. beko@morpheus:~/maxr/dev/maxr/debug/src # svn co svn:// ./
  3. A    music
  4. A    music/music.xml
  5. ...get a coffee - this will take some minutes
  6. A    MANUAL
  7.  U   .
  8. Checked out, Revision 1654.

That s it. Now all the game data is in place and you can launch maxr by using Shift+F9 in kdevelop or by typing ./maxr in the terminal:

beko@morpheus:~/maxr/dev/maxr/debug/src # ./maxr

If you want to update your data or source tree simply enter the folders again and issue a "svn up" and rebuild maxr:

DownloadSource code (Text):
  1. cd maxr/dev/maxr/src/
  2. svn up
  3. cd ../debug/src/
  4. svn up

All times are GMT +01:00. Current time: 9:00 pm.