Makefile.OLD 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  1. #
  2. # Quake2 Makefile for Solaris
  3. #
  4. # Jan '98 by Zoid <zoid@idsoftware.com>
  5. #
  6. ifneq (,$(findstring i86pc,$(shell uname -m)))
  7. ARCH=i386
  8. else
  9. ARCH=sparc
  10. endif
  11. MOUNT_DIR=/chest/Quake2/code
  12. BUILD_DEBUG_DIR=debug$(ARCH)
  13. BUILD_RELEASE_DIR=release$(ARCH)
  14. CLIENT_DIR=$(MOUNT_DIR)/client
  15. SERVER_DIR=$(MOUNT_DIR)/server
  16. COMMON_DIR=$(MOUNT_DIR)/qcommon
  17. SOLARIS_DIR=$(MOUNT_DIR)/solaris
  18. GAME_DIR=$(MOUNT_DIR)/game
  19. XATRIX_DIR=$(MOUNT_DIR)/xatrix
  20. CTF_DIR=$(MOUNT_DIR)/game
  21. NULL_DIR=$(MOUNT_DIR)/null
  22. ARCH=i386
  23. CC=gcc
  24. BASE_CFLAGS=-Dstricmp=strcasecmp
  25. RELEASE_CFLAGS=$(BASE_CFLAGS) -O6 -fomit-frame-pointer -fno-strength-reduce -funroll-loops -fexpensive-optimizations
  26. DEBUG_CFLAGS=$(BASE_CFLAGS) -g
  27. LDFLAGS=-ldl -lm -lnsl -lsocket
  28. SHLIBEXT=so
  29. SHLIBCFLAGS=-fPIC
  30. SHLIBLDFLAGS=-G
  31. DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
  32. DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
  33. #############################################################################
  34. # SETUP AND BUILD
  35. #############################################################################
  36. TARGETS=$(BUILDDIR)/quake2 $(BUILDDIR)/game$(ARCH).$(SHLIBEXT)
  37. build_debug:
  38. @-mkdir $(BUILD_DEBUG_DIR) \
  39. $(BUILD_DEBUG_DIR)/client \
  40. $(BUILD_DEBUG_DIR)/game
  41. $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  42. build_release:
  43. @-mkdir $(BUILD_RELEASE_DIR) \
  44. $(BUILD_RELEASE_DIR)/client \
  45. $(BUILD_RELEASE_DIR)/game
  46. $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)"
  47. all: build_debug build_release
  48. targets: $(TARGETS)
  49. #############################################################################
  50. # CLIENT/SERVER
  51. #############################################################################
  52. QUAKE2_OBJS = \
  53. $(BUILDDIR)/client/cl_cin.o \
  54. $(BUILDDIR)/client/cl_ents.o \
  55. $(BUILDDIR)/client/cl_fx.o \
  56. $(BUILDDIR)/client/cl_input.o \
  57. $(BUILDDIR)/client/cl_inv.o \
  58. $(BUILDDIR)/client/cl_main.o \
  59. $(BUILDDIR)/client/cl_parse.o \
  60. $(BUILDDIR)/client/cl_pred.o \
  61. $(BUILDDIR)/client/cl_tent.o \
  62. $(BUILDDIR)/client/cl_scrn.o \
  63. $(BUILDDIR)/client/cl_view.o \
  64. $(BUILDDIR)/client/console.o \
  65. $(BUILDDIR)/client/keys.o \
  66. $(BUILDDIR)/client/menu.o \
  67. $(BUILDDIR)/client/qmenu.o \
  68. $(BUILDDIR)/client/m_flash.o \
  69. \
  70. $(BUILDDIR)/client/cmd.o \
  71. $(BUILDDIR)/client/cmodel.o \
  72. $(BUILDDIR)/client/common.o \
  73. $(BUILDDIR)/client/cvar.o \
  74. $(BUILDDIR)/client/files.o \
  75. $(BUILDDIR)/client/md4.o \
  76. $(BUILDDIR)/client/net_chan.o \
  77. \
  78. $(BUILDDIR)/client/sv_ccmds.o \
  79. $(BUILDDIR)/client/sv_ents.o \
  80. $(BUILDDIR)/client/sv_game.o \
  81. $(BUILDDIR)/client/sv_init.o \
  82. $(BUILDDIR)/client/sv_main.o \
  83. $(BUILDDIR)/client/sv_send.o \
  84. $(BUILDDIR)/client/sv_user.o \
  85. $(BUILDDIR)/client/sv_world.o \
  86. \
  87. $(BUILDDIR)/client/snd_dma.o \
  88. $(BUILDDIR)/client/snd_mem.o \
  89. $(BUILDDIR)/client/snd_mix.o \
  90. \
  91. $(BUILDDIR)/client/cd_null.o \
  92. $(BUILDDIR)/client/q_shsolaris.o \
  93. $(BUILDDIR)/client/vid_null.o \
  94. $(BUILDDIR)/client/ref_null.o \
  95. $(BUILDDIR)/client/in_null.o \
  96. $(BUILDDIR)/client/snddma_null.o \
  97. $(BUILDDIR)/client/sys_solaris.o \
  98. $(BUILDDIR)/client/glob.o \
  99. $(BUILDDIR)/client/net_udp.o \
  100. \
  101. $(BUILDDIR)/client/q_shared.o \
  102. $(BUILDDIR)/client/pmove.o
  103. $(BUILDDIR)/quake2 : $(QUAKE2_OBJS)
  104. $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(LDFLAGS)
  105. $(BUILDDIR)/client/cl_cin.o : $(CLIENT_DIR)/cl_cin.c
  106. $(DO_CC)
  107. $(BUILDDIR)/client/cl_ents.o : $(CLIENT_DIR)/cl_ents.c
  108. $(DO_CC)
  109. $(BUILDDIR)/client/cl_fx.o : $(CLIENT_DIR)/cl_fx.c
  110. $(DO_CC)
  111. $(BUILDDIR)/client/cl_input.o : $(CLIENT_DIR)/cl_input.c
  112. $(DO_CC)
  113. $(BUILDDIR)/client/cl_inv.o : $(CLIENT_DIR)/cl_inv.c
  114. $(DO_CC)
  115. $(BUILDDIR)/client/cl_main.o : $(CLIENT_DIR)/cl_main.c
  116. $(DO_CC)
  117. $(BUILDDIR)/client/cl_parse.o : $(CLIENT_DIR)/cl_parse.c
  118. $(DO_CC)
  119. $(BUILDDIR)/client/cl_pred.o : $(CLIENT_DIR)/cl_pred.c
  120. $(DO_CC)
  121. $(BUILDDIR)/client/cl_tent.o : $(CLIENT_DIR)/cl_tent.c
  122. $(DO_CC)
  123. $(BUILDDIR)/client/cl_scrn.o : $(CLIENT_DIR)/cl_scrn.c
  124. $(DO_CC)
  125. $(BUILDDIR)/client/cl_view.o : $(CLIENT_DIR)/cl_view.c
  126. $(DO_CC)
  127. $(BUILDDIR)/client/console.o : $(CLIENT_DIR)/console.c
  128. $(DO_CC)
  129. $(BUILDDIR)/client/keys.o : $(CLIENT_DIR)/keys.c
  130. $(DO_CC)
  131. $(BUILDDIR)/client/menu.o : $(CLIENT_DIR)/menu.c
  132. $(DO_CC)
  133. $(BUILDDIR)/client/qmenu.o : $(CLIENT_DIR)/qmenu.c
  134. $(DO_CC)
  135. $(BUILDDIR)/client/m_flash.o : $(GAME_DIR)/m_flash.c
  136. $(DO_CC)
  137. $(BUILDDIR)/client/cmd.o : $(COMMON_DIR)/cmd.c
  138. $(DO_CC)
  139. $(BUILDDIR)/client/cmodel.o : $(COMMON_DIR)/cmodel.c
  140. $(DO_CC)
  141. $(BUILDDIR)/client/common.o : $(COMMON_DIR)/common.c
  142. $(DO_CC)
  143. $(BUILDDIR)/client/cvar.o : $(COMMON_DIR)/cvar.c
  144. $(DO_CC)
  145. $(BUILDDIR)/client/files.o : $(COMMON_DIR)/files.c
  146. $(DO_CC)
  147. $(BUILDDIR)/client/md4.o : $(COMMON_DIR)/md4.c
  148. $(DO_CC)
  149. $(BUILDDIR)/client/net_chan.o : $(COMMON_DIR)/net_chan.c
  150. $(DO_CC)
  151. $(BUILDDIR)/client/q_shared.o : $(GAME_DIR)/q_shared.c
  152. $(DO_CC)
  153. $(BUILDDIR)/client/pmove.o : $(COMMON_DIR)/pmove.c
  154. $(DO_CC)
  155. $(BUILDDIR)/client/sv_ccmds.o : $(SERVER_DIR)/sv_ccmds.c
  156. $(DO_CC)
  157. $(BUILDDIR)/client/sv_ents.o : $(SERVER_DIR)/sv_ents.c
  158. $(DO_CC)
  159. $(BUILDDIR)/client/sv_game.o : $(SERVER_DIR)/sv_game.c
  160. $(DO_CC)
  161. $(BUILDDIR)/client/sv_init.o : $(SERVER_DIR)/sv_init.c
  162. $(DO_CC)
  163. $(BUILDDIR)/client/sv_main.o : $(SERVER_DIR)/sv_main.c
  164. $(DO_CC)
  165. $(BUILDDIR)/client/sv_send.o : $(SERVER_DIR)/sv_send.c
  166. $(DO_CC)
  167. $(BUILDDIR)/client/sv_user.o : $(SERVER_DIR)/sv_user.c
  168. $(DO_CC)
  169. $(BUILDDIR)/client/sv_world.o : $(SERVER_DIR)/sv_world.c
  170. $(DO_CC)
  171. $(BUILDDIR)/client/cd_null.o : $(NULL_DIR)/cd_null.c
  172. $(DO_CC)
  173. $(BUILDDIR)/client/q_shsolaris.o : $(SOLARIS_DIR)/q_shsolaris.c
  174. $(DO_CC)
  175. $(BUILDDIR)/client/vid_null.o : $(NULL_DIR)/vid_null.c
  176. $(DO_CC)
  177. $(BUILDDIR)/client/ref_null.o : $(NULL_DIR)/ref_null.c
  178. $(DO_CC)
  179. $(BUILDDIR)/client/snddma_null.o : $(NULL_DIR)/snddma_null.c
  180. $(DO_CC)
  181. $(BUILDDIR)/client/snd_dma.o : $(CLIENT_DIR)/snd_dma.c
  182. $(DO_CC)
  183. $(BUILDDIR)/client/snd_mem.o : $(CLIENT_DIR)/snd_mem.c
  184. $(DO_CC)
  185. $(BUILDDIR)/client/snd_mix.o : $(CLIENT_DIR)/snd_mix.c
  186. $(DO_CC)
  187. $(BUILDDIR)/client/in_null.o : $(NULL_DIR)/in_null.c
  188. $(DO_CC)
  189. $(BUILDDIR)/client/sys_solaris.o : $(SOLARIS_DIR)/sys_solaris.c
  190. $(DO_CC)
  191. $(BUILDDIR)/client/glob.o : $(SOLARIS_DIR)/glob.c
  192. $(DO_CC)
  193. $(BUILDDIR)/client/net_udp.o : $(SOLARIS_DIR)/net_udp.c
  194. $(DO_CC)
  195. #############################################################################
  196. # GAME
  197. #############################################################################
  198. GAME_OBJS = \
  199. $(BUILDDIR)/game/g_ai.o \
  200. $(BUILDDIR)/game/p_client.o \
  201. $(BUILDDIR)/game/g_cmds.o \
  202. $(BUILDDIR)/game/g_svcmds.o \
  203. $(BUILDDIR)/game/g_combat.o \
  204. $(BUILDDIR)/game/g_func.o \
  205. $(BUILDDIR)/game/g_items.o \
  206. $(BUILDDIR)/game/g_main.o \
  207. $(BUILDDIR)/game/g_misc.o \
  208. $(BUILDDIR)/game/g_monster.o \
  209. $(BUILDDIR)/game/g_phys.o \
  210. $(BUILDDIR)/game/g_save.o \
  211. $(BUILDDIR)/game/g_spawn.o \
  212. $(BUILDDIR)/game/g_target.o \
  213. $(BUILDDIR)/game/g_trigger.o \
  214. $(BUILDDIR)/game/g_turret.o \
  215. $(BUILDDIR)/game/g_utils.o \
  216. $(BUILDDIR)/game/g_weapon.o \
  217. $(BUILDDIR)/game/m_actor.o \
  218. $(BUILDDIR)/game/m_berserk.o \
  219. $(BUILDDIR)/game/m_boss2.o \
  220. $(BUILDDIR)/game/m_boss3.o \
  221. $(BUILDDIR)/game/m_boss31.o \
  222. $(BUILDDIR)/game/m_boss32.o \
  223. $(BUILDDIR)/game/m_brain.o \
  224. $(BUILDDIR)/game/m_chick.o \
  225. $(BUILDDIR)/game/m_flipper.o \
  226. $(BUILDDIR)/game/m_float.o \
  227. $(BUILDDIR)/game/m_flyer.o \
  228. $(BUILDDIR)/game/m_gladiator.o \
  229. $(BUILDDIR)/game/m_gunner.o \
  230. $(BUILDDIR)/game/m_hover.o \
  231. $(BUILDDIR)/game/m_infantry.o \
  232. $(BUILDDIR)/game/m_insane.o \
  233. $(BUILDDIR)/game/m_medic.o \
  234. $(BUILDDIR)/game/m_move.o \
  235. $(BUILDDIR)/game/m_mutant.o \
  236. $(BUILDDIR)/game/m_parasite.o \
  237. $(BUILDDIR)/game/m_soldier.o \
  238. $(BUILDDIR)/game/m_supertank.o \
  239. $(BUILDDIR)/game/m_tank.o \
  240. $(BUILDDIR)/game/p_hud.o \
  241. $(BUILDDIR)/game/p_trail.o \
  242. $(BUILDDIR)/game/p_view.o \
  243. $(BUILDDIR)/game/p_weapon.o \
  244. $(BUILDDIR)/game/q_shared.o \
  245. $(BUILDDIR)/game/m_flash.o \
  246. $(BUILDDIR)/game/g_so.o
  247. $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) : $(GAME_OBJS)
  248. $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS)
  249. $(BUILDDIR)/game/g_ai.o : $(GAME_DIR)/g_ai.c
  250. $(DO_SHLIB_CC)
  251. $(BUILDDIR)/game/p_client.o : $(GAME_DIR)/p_client.c
  252. $(DO_SHLIB_CC)
  253. $(BUILDDIR)/game/g_cmds.o : $(GAME_DIR)/g_cmds.c
  254. $(DO_SHLIB_CC)
  255. $(BUILDDIR)/game/g_svcmds.o : $(GAME_DIR)/g_svcmds.c
  256. $(DO_SHLIB_CC)
  257. $(BUILDDIR)/game/g_combat.o : $(GAME_DIR)/g_combat.c
  258. $(DO_SHLIB_CC)
  259. $(BUILDDIR)/game/g_func.o : $(GAME_DIR)/g_func.c
  260. $(DO_SHLIB_CC)
  261. $(BUILDDIR)/game/g_items.o : $(GAME_DIR)/g_items.c
  262. $(DO_SHLIB_CC)
  263. $(BUILDDIR)/game/g_main.o : $(GAME_DIR)/g_main.c
  264. $(DO_SHLIB_CC)
  265. $(BUILDDIR)/game/g_misc.o : $(GAME_DIR)/g_misc.c
  266. $(DO_SHLIB_CC)
  267. $(BUILDDIR)/game/g_monster.o : $(GAME_DIR)/g_monster.c
  268. $(DO_SHLIB_CC)
  269. $(BUILDDIR)/game/g_phys.o : $(GAME_DIR)/g_phys.c
  270. $(DO_SHLIB_CC)
  271. $(BUILDDIR)/game/g_save.o : $(GAME_DIR)/g_save.c
  272. $(DO_SHLIB_CC)
  273. $(BUILDDIR)/game/g_spawn.o : $(GAME_DIR)/g_spawn.c
  274. $(DO_SHLIB_CC)
  275. $(BUILDDIR)/game/g_target.o : $(GAME_DIR)/g_target.c
  276. $(DO_SHLIB_CC)
  277. $(BUILDDIR)/game/g_trigger.o : $(GAME_DIR)/g_trigger.c
  278. $(DO_SHLIB_CC)
  279. $(BUILDDIR)/game/g_turret.o : $(GAME_DIR)/g_turret.c
  280. $(DO_SHLIB_CC)
  281. $(BUILDDIR)/game/g_utils.o : $(GAME_DIR)/g_utils.c
  282. $(DO_SHLIB_CC)
  283. $(BUILDDIR)/game/g_weapon.o : $(GAME_DIR)/g_weapon.c
  284. $(DO_SHLIB_CC)
  285. $(BUILDDIR)/game/m_actor.o : $(GAME_DIR)/m_actor.c
  286. $(DO_SHLIB_CC)
  287. $(BUILDDIR)/game/m_berserk.o : $(GAME_DIR)/m_berserk.c
  288. $(DO_SHLIB_CC)
  289. $(BUILDDIR)/game/m_boss2.o : $(GAME_DIR)/m_boss2.c
  290. $(DO_SHLIB_CC)
  291. $(BUILDDIR)/game/m_boss3.o : $(GAME_DIR)/m_boss3.c
  292. $(DO_SHLIB_CC)
  293. $(BUILDDIR)/game/m_boss31.o : $(GAME_DIR)/m_boss31.c
  294. $(DO_SHLIB_CC)
  295. $(BUILDDIR)/game/m_boss32.o : $(GAME_DIR)/m_boss32.c
  296. $(DO_SHLIB_CC)
  297. $(BUILDDIR)/game/m_brain.o : $(GAME_DIR)/m_brain.c
  298. $(DO_SHLIB_CC)
  299. $(BUILDDIR)/game/m_chick.o : $(GAME_DIR)/m_chick.c
  300. $(DO_SHLIB_CC)
  301. $(BUILDDIR)/game/m_flipper.o : $(GAME_DIR)/m_flipper.c
  302. $(DO_SHLIB_CC)
  303. $(BUILDDIR)/game/m_float.o : $(GAME_DIR)/m_float.c
  304. $(DO_SHLIB_CC)
  305. $(BUILDDIR)/game/m_flyer.o : $(GAME_DIR)/m_flyer.c
  306. $(DO_SHLIB_CC)
  307. $(BUILDDIR)/game/m_gladiator.o : $(GAME_DIR)/m_gladiator.c
  308. $(DO_SHLIB_CC)
  309. $(BUILDDIR)/game/m_gunner.o : $(GAME_DIR)/m_gunner.c
  310. $(DO_SHLIB_CC)
  311. $(BUILDDIR)/game/m_hover.o : $(GAME_DIR)/m_hover.c
  312. $(DO_SHLIB_CC)
  313. $(BUILDDIR)/game/m_infantry.o : $(GAME_DIR)/m_infantry.c
  314. $(DO_SHLIB_CC)
  315. $(BUILDDIR)/game/m_insane.o : $(GAME_DIR)/m_insane.c
  316. $(DO_SHLIB_CC)
  317. $(BUILDDIR)/game/m_medic.o : $(GAME_DIR)/m_medic.c
  318. $(DO_SHLIB_CC)
  319. $(BUILDDIR)/game/m_move.o : $(GAME_DIR)/m_move.c
  320. $(DO_SHLIB_CC)
  321. $(BUILDDIR)/game/m_mutant.o : $(GAME_DIR)/m_mutant.c
  322. $(DO_SHLIB_CC)
  323. $(BUILDDIR)/game/m_parasite.o : $(GAME_DIR)/m_parasite.c
  324. $(DO_SHLIB_CC)
  325. $(BUILDDIR)/game/m_soldier.o : $(GAME_DIR)/m_soldier.c
  326. $(DO_SHLIB_CC)
  327. $(BUILDDIR)/game/m_supertank.o : $(GAME_DIR)/m_supertank.c
  328. $(DO_SHLIB_CC)
  329. $(BUILDDIR)/game/m_tank.o : $(GAME_DIR)/m_tank.c
  330. $(DO_SHLIB_CC)
  331. $(BUILDDIR)/game/p_hud.o : $(GAME_DIR)/p_hud.c
  332. $(DO_SHLIB_CC)
  333. $(BUILDDIR)/game/p_trail.o : $(GAME_DIR)/p_trail.c
  334. $(DO_SHLIB_CC)
  335. $(BUILDDIR)/game/p_view.o : $(GAME_DIR)/p_view.c
  336. $(DO_SHLIB_CC)
  337. $(BUILDDIR)/game/p_weapon.o : $(GAME_DIR)/p_weapon.c
  338. $(DO_SHLIB_CC)
  339. $(BUILDDIR)/game/q_shared.o : $(GAME_DIR)/q_shared.c
  340. $(DO_SHLIB_CC)
  341. $(BUILDDIR)/game/m_flash.o : $(GAME_DIR)/m_flash.c
  342. $(DO_SHLIB_CC)
  343. $(BUILDDIR)/game/g_so.o : $(SOLARIS_DIR)/g_so.c
  344. $(DO_SHLIB_CC)
  345. #############################################################################
  346. # MISC
  347. #############################################################################
  348. clean: clean-debug clean-release
  349. clean-debug:
  350. $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  351. clean-release:
  352. $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  353. clean2:
  354. -rm -f $(QUAKE2_OBJS) \
  355. $(GAME_OBJS) \
  356. $(REF_SOFT_OBJS) \
  357. $(REF_SOFT_SVGA_OBJS) \
  358. $(REF_SOFT_X11_OBJS) \
  359. $(REF_GL_OBJS)