We're getting closer to state: 'useable' :-)
[supertux.git] / SConstruct
1 #
2 # A simple SConstruct file.
3 # See http://www.scons.org/ for more information about what SCons is and how it
4 # may help you... :-)
5 # I've never done anything with SCons before. Quite obviously this script is in
6 # a non-working state!! Maybe someone with more knowledge of the materia who
7 # thinks that SCons might be better suited than make can take over....
8 #                                              - Benjamin P. 'litespeed' Jung -
9 #
10
11 # TODO: such static entries are obviously not what we want.
12 #       Using e.g. 'sdl-config' to obtain parameters would be muuuuuch
13 #       better.
14
15
16 DATA_PREFIX = '\\\"/usr/local/share/supertux\\\"'
17 LOCALEDIR = '\\\"/usr/local/share/locale\\\"'
18
19 SDL_DYNAMIC_CCFLAGS = ['-D_REENTRANT', '-lSDL -lpthread']
20 SDL_STATIC_CCFLAGS = ['-lSDL -lpthread -lm -ldl -lasound -L/usr/X11R6/lib -lX11 -lXext -lvga -laa']
21
22 CCFLAGS = ['-DHAVE_CONFIG_H', '-O2', '-DDATA_PREFIX=' + DATA_PREFIX, '-DLOCALEDIR=' + LOCALEDIR]
23
24 LIBSUPERTUX_DYNAMIC_CCFLAGS = SDL_DYNAMIC_CCFLAGS + CCFLAGS
25 LIBSUPERTUX_STATIC_CCFLAGS = SDL_STATIC_CCFLAGS + CCFLAGS
26
27 CPPPATH = ['/usr/include/SDL', 'src', 'lib', 'intl', '.']
28
29 libsupertux_src = [
30   'lib/app/globals.cpp',
31   'lib/app/setup.cpp',
32   'lib/audio/musicref.cpp',
33   'lib/audio/sound_manager.cpp',
34   'lib/gui/button.cpp',
35   'lib/gui/menu.cpp',
36   'lib/gui/mousecursor.cpp',
37   'lib/math/physic.cpp',
38   'lib/math/vector.cpp',
39   'lib/special/game_object.cpp',
40   'lib/special/moving_object.cpp',
41   'lib/special/sprite.cpp',
42   'lib/special/sprite_manager.cpp',
43   'lib/special/timer.cpp',
44   'lib/special/frame_rate.cpp',
45   'lib/utils/configfile.cpp',
46   'lib/utils/lispreader.cpp',
47   'lib/utils/lispwriter.cpp',
48   'lib/video/drawing_context.cpp',
49   'lib/video/font.cpp',
50   'lib/video/screen.cpp',
51   'lib/video/surface.cpp'
52 ]
53
54 supertux_src = [
55   'src/background.cpp',
56   'src/badguy.cpp',
57   'src/badguy_specs.cpp',
58   'src/bitmask.cpp',
59   'src/camera.cpp',
60   'src/collision.cpp',
61   'src/door.cpp',
62   'src/gameloop.cpp',
63   'src/gameobjs.cpp',
64   'src/high_scores.cpp',
65   'src/interactive_object.cpp',
66   'src/intro.cpp',
67   'src/level.cpp',
68   'src/level_subset.cpp',
69   'src/leveleditor.cpp',
70   'src/misc.cpp',
71   'src/particlesystem.cpp',
72   'src/player.cpp',
73   'src/resources.cpp',
74   'src/scene.cpp',
75   'src/sector.cpp',
76   'src/special.cpp',
77   'src/statistics.cpp',
78   'src/supertux.cpp',
79   'src/tile.cpp',
80   'src/tile_manager.cpp',
81   'src/tilemap.cpp',
82   'src/title.cpp',
83   'src/worldmap.cpp'
84 ]
85                         
86
87
88 StaticLibrary(
89   target='lib/supertux',
90   source=libsupertux_src,
91   CPPPATH=CPPPATH,
92   CCFLAGS=LIBSUPERTUX_STATIC_CCFLAGS
93 )
94
95 Program(
96   target='src/supertux',
97   source=supertux_src,
98   CPPPATH=CPPPATH,
99   CCFLAGS=LIBSUPERTUX_STATIC_CCFLAGS,
100   LIBPATH='lib',
101   LIBS='supertux'
102 )
103
104
105
106 #
107 # The following lines _should_ (hehe!) build a shared SuperTux library (hey! At
108 # least that part works pretty fine...) and then create a supertux exceutable
109 # which links dynamically against that lib.
110 #
111 #SharedLibrary(
112 #  target='lib/supertux',
113 #  source=libsupertux_src,
114 #  CPPPATH=CPPPATH,
115 #  CCFLAGS=CCFLAGS
116 #)
117 #Program(
118 #  target='src/supertux',
119 #  source=supertux_src,
120 #  CPPPATH=CPPPATH,
121 #  CCFLAGS=LIBSUPERTUX_DYNAMIC_CCFLAGS
122 #)