Conscript-client 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. # full client build script
  2. Import qw( BASE_CFLAGS BASE_LDFLAGS INSTALL_DIR BUILD_DIR TARGETNAME CC CXX LINK );
  3. # splines
  4. $env_splines = new cons(
  5. CC => $CC,
  6. CXX => $CXX,
  7. LINK => $LINK,
  8. ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} }
  9. );
  10. @SPLINES_FILES = qw(
  11. ../splines/math_angles.cpp
  12. ../splines/math_matrix.cpp
  13. ../splines/math_quaternion.cpp
  14. ../splines/math_vector.cpp
  15. ../splines/q_parse.cpp
  16. ../splines/q_shared.cpp
  17. ../splines/splines.cpp
  18. ../splines/util_str.cpp
  19. );
  20. $SPLINES_FILESREF = \@SPLINES_FILES;
  21. Library $env_splines 'splines', @$SPLINES_FILESREF;
  22. # botlib
  23. # FIXME TTimo
  24. # we already deal with botlib on dedicated target
  25. # the compilation options are a bit different but we could certainly rely on
  26. # the same Conscript and make things cleaner
  27. $env_botlib = new cons(
  28. CC => $CC,
  29. CXX => $CXX,
  30. LINK => $LINK,
  31. ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} },
  32. CFLAGS => $BASE_CFLAGS . '-DBOTLIB '
  33. );
  34. @BOTLIB_FILES = qw(
  35. ../botlib/be_aas_bspq3.c
  36. ../botlib/be_aas_cluster.c
  37. ../botlib/be_aas_debug.c
  38. ../botlib/be_aas_entity.c
  39. ../botlib/be_aas_file.c
  40. ../botlib/be_aas_main.c
  41. ../botlib/be_aas_move.c
  42. ../botlib/be_aas_optimize.c
  43. ../botlib/be_aas_reach.c
  44. ../botlib/be_aas_route.c
  45. ../botlib/be_aas_routealt.c
  46. ../botlib/be_aas_sample.c
  47. ../botlib/be_ai_char.c
  48. ../botlib/be_ai_chat.c
  49. ../botlib/be_ai_gen.c
  50. ../botlib/be_ai_goal.c
  51. ../botlib/be_ai_move.c
  52. ../botlib/be_ai_weap.c
  53. ../botlib/be_ai_weight.c
  54. ../botlib/be_ea.c
  55. ../botlib/be_interface.c
  56. ../botlib/l_crc.c
  57. ../botlib/l_libvar.c
  58. ../botlib/l_log.c
  59. ../botlib/l_memory.c
  60. ../botlib/l_precomp.c
  61. ../botlib/l_script.c
  62. ../botlib/l_struct.c
  63. );
  64. $BOTLIB_REF = \@BOTLIB_FILES;
  65. Library $env_botlib 'botlib', @$BOTLIB_REF;
  66. # jpeg
  67. # NOTE TTimo we might need this one on other targets
  68. $env_jpeglib = new cons(
  69. CC => $CC,
  70. CXX => $CXX,
  71. LINK => $LINK,
  72. ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} },
  73. CFLAGS => $BASE_CFLAGS
  74. );
  75. @JPEGLIB_FILES = qw(
  76. ../jpeg-6/jcapimin.c
  77. ../jpeg-6/jchuff.c
  78. ../jpeg-6/jcinit.c
  79. ../jpeg-6/jccoefct.c
  80. ../jpeg-6/jccolor.c
  81. ../jpeg-6/jfdctflt.c
  82. ../jpeg-6/jcdctmgr.c
  83. ../jpeg-6/jcphuff.c
  84. ../jpeg-6/jcmainct.c
  85. ../jpeg-6/jcmarker.c
  86. ../jpeg-6/jcmaster.c
  87. ../jpeg-6/jcomapi.c
  88. ../jpeg-6/jcparam.c
  89. ../jpeg-6/jcprepct.c
  90. ../jpeg-6/jcsample.c
  91. ../jpeg-6/jdapimin.c
  92. ../jpeg-6/jdapistd.c
  93. ../jpeg-6/jdatasrc.c
  94. ../jpeg-6/jdcoefct.c
  95. ../jpeg-6/jdcolor.c
  96. ../jpeg-6/jddctmgr.c
  97. ../jpeg-6/jdhuff.c
  98. ../jpeg-6/jdinput.c
  99. ../jpeg-6/jdmainct.c
  100. ../jpeg-6/jdmarker.c
  101. ../jpeg-6/jdmaster.c
  102. ../jpeg-6/jdpostct.c
  103. ../jpeg-6/jdsample.c
  104. ../jpeg-6/jdtrans.c
  105. ../jpeg-6/jerror.c
  106. ../jpeg-6/jidctflt.c
  107. ../jpeg-6/jmemmgr.c
  108. ../jpeg-6/jmemnobs.c
  109. ../jpeg-6/jutils.c
  110. );
  111. $JPEGLIB_REF = \@JPEGLIB_FILES;
  112. Library $env_jpeglib 'jpeglib', @$JPEGLIB_REF;
  113. # NOTE TTimo this requires patched cons version to work (see unix/cons)
  114. %nasm_hash = new cons()->copy(
  115. CC => 'nasm',
  116. CCCOM => '%CC -f elf -o %> %<'
  117. );
  118. $nasm_hash{SUFMAP}{'.nasm'} = 'build::command::cc';
  119. $nasm_env = new cons(%nasm_hash);
  120. Library $nasm_env 'asmlib', 'ftol.nasm', 'snapvector.nasm';
  121. # compiling files with inlined assembly
  122. $env_inlined = new cons(
  123. CFLAGS => '-DELF -x assembler-with-cpp'
  124. );
  125. Library $env_inlined 'inlinelib', '../unix/matha.s', '../unix/snd_mixa.s';
  126. # putting it all together
  127. $env = new cons(
  128. CC => $CC,
  129. CXX => $CXX,
  130. LINK => $LINK,
  131. ENV => { PATH => $ENV{PATH}, HOME => $ENV{HOME} },
  132. CFLAGS => $BASE_CFLAGS,
  133. LIBS => ' ' . $BUILD_DIR . '/unix/splines.a '
  134. . $BUILD_DIR . '/unix/botlib.a '
  135. . $BUILD_DIR . '/unix/jpeglib.a '
  136. . $BUILD_DIR . '/unix/asmlib.a '
  137. . $BUILD_DIR . '/unix/inlinelib.a '
  138. . $BASE_LDFLAGS
  139. . '-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm -ldl -lm'
  140. );
  141. @RENDERER_FILES = qw(
  142. ../renderer/tr_animation.c
  143. ../renderer/tr_backend.c
  144. ../renderer/tr_bsp.c
  145. ../renderer/tr_cmds.c
  146. ../renderer/tr_curve.c
  147. ../renderer/tr_flares.c
  148. ../renderer/tr_font.c
  149. ../renderer/tr_image.c
  150. ../renderer/tr_init.c
  151. ../renderer/tr_light.c
  152. ../renderer/tr_main.c
  153. ../renderer/tr_marks.c
  154. ../renderer/tr_mesh.c
  155. ../renderer/tr_model.c
  156. ../renderer/tr_noise.c
  157. ../renderer/tr_scene.c
  158. ../renderer/tr_shade.c
  159. ../renderer/tr_shade_calc.c
  160. ../renderer/tr_shader.c
  161. ../renderer/tr_shadows.c
  162. ../renderer/tr_sky.c
  163. ../renderer/tr_surface.c
  164. ../renderer/tr_world.c
  165. );
  166. $RENDERER_REF = \@RENDERER_FILES;
  167. @CLIENT_FILES = qw(
  168. ../client/cl_cgame.c
  169. ../client/cl_cin.c
  170. ../client/cl_console.c
  171. ../client/cl_input.c
  172. ../client/cl_keys.c
  173. ../client/cl_main.c
  174. ../client/cl_net_chan.c
  175. ../client/cl_parse.c
  176. ../client/cl_scrn.c
  177. ../client/cl_ui.c
  178. );
  179. $CLIENT_REF = \@CLIENT_FILES;
  180. @COMMON_FILES = qw(
  181. ../qcommon/cm_load.c
  182. ../qcommon/cm_patch.c
  183. ../qcommon/cm_polylib.c
  184. ../qcommon/cm_test.c
  185. ../qcommon/cm_trace.c
  186. ../qcommon/cmd.c
  187. ../qcommon/common.c
  188. ../qcommon/cvar.c
  189. ../qcommon/files.c
  190. ../qcommon/md4.c
  191. ../qcommon/msg.c
  192. ../qcommon/net_chan.c
  193. ../qcommon/huffman.c
  194. ../qcommon/unzip.c
  195. );
  196. $COMMON_REF = \@COMMON_FILES;
  197. @SOUND_FILES = qw(
  198. ../client/snd_adpcm.c
  199. ../client/snd_dma.c
  200. ../client/snd_mem.c
  201. ../client/snd_mix.c
  202. ../client/snd_wavelet.c
  203. );
  204. $SOUND_REF = \@SOUND_FILES;
  205. @UNIX_FILES = qw(
  206. ../unix/unix_main.c
  207. ../unix/unix_net.c
  208. ../unix/unix_shared.c
  209. ../unix/linux_common.c
  210. ../unix/linux_qgl.c
  211. ../unix/linux_glimp.c
  212. ../unix/linux_joystick.c
  213. ../unix/linux_snd.c
  214. ../unix/linux_signals.c
  215. );
  216. $UNIX_REF = \@UNIX_FILES;
  217. @SERVER_FILES = qw(
  218. ../server/sv_bot.c
  219. ../server/sv_ccmds.c
  220. ../server/sv_client.c
  221. ../server/sv_game.c
  222. ../server/sv_init.c
  223. ../server/sv_main.c
  224. ../server/sv_net_chan.c
  225. ../server/sv_snapshot.c
  226. ../server/sv_world.c
  227. );
  228. $SERVER_REF = \@SERVER_FILES;
  229. # FIXME TTimo vm_<cpu>.c
  230. @VM_FILES = qw(
  231. ../qcommon/vm.c
  232. ../qcommon/vm_x86.c
  233. ../qcommon/vm_interpreted.c
  234. );
  235. $VM_REF = \@VM_FILES;
  236. # FIXME: import the CPU string to build the name of the target
  237. Program $env $TARGETNAME, '../game/q_shared.c', '../game/q_math.c',
  238. @$RENDERER_REF, @$CLIENT_REF, @$COMMON_REF, @$SOUND_REF,
  239. @$UNIX_REF, @$SERVER_REF, @$VM_REF;
  240. Install $env $INSTALL_DIR, $TARGETNAME;