Makefile.Solaris 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. #
  2. # Quake Makefile for Solaris
  3. #
  4. # Nov '97 by Zoid <zoid@idsoftware.com>
  5. #
  6. # ELF only
  7. #
  8. VERSION=1.09
  9. ifneq (,$(findstring i86pc,$(shell uname -m)))
  10. ARCH=i386
  11. else
  12. ARCH=sparc
  13. endif
  14. MOUNT_DIR=/grog/Projects/WinQuake
  15. BUILD_DEBUG_DIR=debug$(ARCH)
  16. BUILD_RELEASE_DIR=release$(ARCH)
  17. CC=gcc
  18. BASE_CFLAGS=-I/usr/openwin/include
  19. RELEASE_CFLAGS=$(BASE_CFLAGS) -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
  20. DEBUG_CFLAGS=$(BASE_CFLAGS) -g
  21. LDFLAGS=-R /usr/openwin/lib -L /usr/openwin/lib -lm -lX11 -lXext -lsocket -lnsl -lthread -ldl
  22. XIL_LDFLAGS=-L /opt/SUNWits/Graphics-sw/xil/lib -R /opt/SUNWits/Graphics-sw/xil/lib:/usr/openwin/lib -L /usr/openwin/lib -lm -lxil -lX11 -lXext -lsocket -lnsl -lthread -ldl
  23. DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
  24. DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
  25. #############################################################################
  26. # SETUP AND BUILD
  27. #############################################################################
  28. TARGETS=$(BUILDDIR)/quake.sw $(BUILDDIR)/quake.xil
  29. build_debug:
  30. @-mkdir $(BUILD_DEBUG_DIR)
  31. $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  32. build_release:
  33. @-mkdir $(BUILD_RELEASE_DIR)
  34. $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)"
  35. all: build_debug build_release
  36. targets: $(TARGETS)
  37. #############################################################################
  38. # CLIENT/SERVER
  39. #############################################################################
  40. QUAKE_OBJS= \
  41. $(BUILDDIR)/chase.o \
  42. $(BUILDDIR)/cl_demo.o \
  43. $(BUILDDIR)/cl_input.o \
  44. $(BUILDDIR)/cl_main.o \
  45. $(BUILDDIR)/cl_parse.o \
  46. $(BUILDDIR)/cl_tent.o \
  47. $(BUILDDIR)/cmd.o \
  48. $(BUILDDIR)/common.o \
  49. $(BUILDDIR)/console.o \
  50. $(BUILDDIR)/crc.o \
  51. $(BUILDDIR)/cvar.o \
  52. $(BUILDDIR)/draw.o \
  53. $(BUILDDIR)/d_edge.o \
  54. $(BUILDDIR)/d_fill.o \
  55. $(BUILDDIR)/d_init.o \
  56. $(BUILDDIR)/d_modech.o \
  57. $(BUILDDIR)/d_part.o \
  58. $(BUILDDIR)/d_polyse.o \
  59. $(BUILDDIR)/d_scan.o \
  60. $(BUILDDIR)/d_sky.o \
  61. $(BUILDDIR)/d_sprite.o \
  62. $(BUILDDIR)/d_surf.o \
  63. $(BUILDDIR)/d_vars.o \
  64. $(BUILDDIR)/d_zpoint.o \
  65. $(BUILDDIR)/host.o \
  66. $(BUILDDIR)/host_cmd.o \
  67. $(BUILDDIR)/keys.o \
  68. $(BUILDDIR)/menu.o \
  69. $(BUILDDIR)/mathlib.o \
  70. $(BUILDDIR)/model.o \
  71. $(BUILDDIR)/nonintel.o \
  72. $(BUILDDIR)/pr_cmds.o \
  73. $(BUILDDIR)/pr_edict.o \
  74. $(BUILDDIR)/pr_exec.o \
  75. $(BUILDDIR)/r_aclip.o \
  76. $(BUILDDIR)/r_alias.o \
  77. $(BUILDDIR)/r_bsp.o \
  78. $(BUILDDIR)/r_light.o \
  79. $(BUILDDIR)/r_draw.o \
  80. $(BUILDDIR)/r_efrag.o \
  81. $(BUILDDIR)/r_edge.o \
  82. $(BUILDDIR)/r_misc.o \
  83. $(BUILDDIR)/r_main.o \
  84. $(BUILDDIR)/r_sky.o \
  85. $(BUILDDIR)/r_sprite.o \
  86. $(BUILDDIR)/r_surf.o \
  87. $(BUILDDIR)/r_part.o \
  88. $(BUILDDIR)/r_vars.o \
  89. $(BUILDDIR)/screen.o \
  90. $(BUILDDIR)/sbar.o \
  91. $(BUILDDIR)/sv_main.o \
  92. $(BUILDDIR)/sv_phys.o \
  93. $(BUILDDIR)/sv_move.o \
  94. $(BUILDDIR)/sv_user.o \
  95. $(BUILDDIR)/zone.o \
  96. $(BUILDDIR)/view.o \
  97. $(BUILDDIR)/wad.o \
  98. $(BUILDDIR)/world.o \
  99. $(BUILDDIR)/cd_null.o \
  100. $(BUILDDIR)/snd_dma.o \
  101. $(BUILDDIR)/snd_mix.o \
  102. $(BUILDDIR)/snd_mem.o \
  103. $(BUILDDIR)/net_dgrm.o \
  104. $(BUILDDIR)/net_loop.o \
  105. $(BUILDDIR)/net_main.o \
  106. $(BUILDDIR)/net_vcr.o \
  107. $(BUILDDIR)/net_udp.o \
  108. $(BUILDDIR)/net_bsd.o \
  109. $(BUILDDIR)/sys_sun.o \
  110. $(BUILDDIR)/snd_sun.o
  111. QUAKE_AS_OBJS= \
  112. $(BUILDDIR)/d_copy.o \
  113. $(BUILDDIR)/d_draw.o \
  114. $(BUILDDIR)/d_draw16.o \
  115. $(BUILDDIR)/d_parta.o \
  116. $(BUILDDIR)/d_polysa.o \
  117. $(BUILDDIR)/d_scana.o \
  118. $(BUILDDIR)/d_spr8.o \
  119. $(BUILDDIR)/d_varsa.o \
  120. $(BUILDDIR)/math.o \
  121. $(BUILDDIR)/r_aliasa.o \
  122. $(BUILDDIR)/r_drawa.o \
  123. $(BUILDDIR)/r_edgea.o \
  124. $(BUILDDIR)/r_varsa.o \
  125. $(BUILDDIR)/surf16.o \
  126. $(BUILDDIR)/surf8.o \
  127. $(BUILDDIR)/worlda.o \
  128. $(BUILDDIR)/r_aclipa.o \
  129. $(BUILDDIR)/snd_mixa.o \
  130. $(BUILDDIR)/sys_dosa.o
  131. QUAKE_X_OBJS = $(BUILDDIR)/vid_sunx.o
  132. QUAKE_XIL_OBJS = $(BUILDDIR)/vid_sunxil.o
  133. ifeq ($(ARCH),i386)
  134. $(BUILDDIR)/quake.sw : $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_X_OBJS)
  135. $(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_X_OBJS) $(LDFLAGS)
  136. $(BUILDDIR)/quake.xil: $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_XIL_OBJS)
  137. $(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_XIL_OBJS) $(XIL_LDFLAGS)
  138. else
  139. $(BUILDDIR)/quake.sw : $(QUAKE_OBJS) $(QUAKE_X_OBJS)
  140. $(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_X_OBJS) $(LDFLAGS)
  141. $(BUILDDIR)/quake.xil: $(QUAKE_OBJS) $(QUAKE_XIL_OBJS)
  142. $(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_XIL_OBJS) $(XIL_LDFLAGS)
  143. endif
  144. ##
  145. $(BUILDDIR)/chase.o : $(MOUNT_DIR)/chase.c
  146. $(DO_CC)
  147. $(BUILDDIR)/cl_demo.o : $(MOUNT_DIR)/cl_demo.c
  148. $(DO_CC)
  149. $(BUILDDIR)/cl_input.o : $(MOUNT_DIR)/cl_input.c
  150. $(DO_CC)
  151. $(BUILDDIR)/cl_main.o : $(MOUNT_DIR)/cl_main.c
  152. $(DO_CC)
  153. $(BUILDDIR)/cl_parse.o : $(MOUNT_DIR)/cl_parse.c
  154. $(DO_CC)
  155. $(BUILDDIR)/cl_tent.o : $(MOUNT_DIR)/cl_tent.c
  156. $(DO_CC)
  157. $(BUILDDIR)/cmd.o : $(MOUNT_DIR)/cmd.c
  158. $(DO_CC)
  159. $(BUILDDIR)/common.o : $(MOUNT_DIR)/common.c
  160. $(DO_CC)
  161. $(BUILDDIR)/console.o : $(MOUNT_DIR)/console.c
  162. $(DO_CC)
  163. $(BUILDDIR)/crc.o : $(MOUNT_DIR)/crc.c
  164. $(DO_CC)
  165. $(BUILDDIR)/cvar.o : $(MOUNT_DIR)/cvar.c
  166. $(DO_CC)
  167. $(BUILDDIR)/draw.o : $(MOUNT_DIR)/draw.c
  168. $(DO_CC)
  169. $(BUILDDIR)/d_edge.o : $(MOUNT_DIR)/d_edge.c
  170. $(DO_CC)
  171. $(BUILDDIR)/d_fill.o : $(MOUNT_DIR)/d_fill.c
  172. $(DO_CC)
  173. $(BUILDDIR)/d_init.o : $(MOUNT_DIR)/d_init.c
  174. $(DO_CC)
  175. $(BUILDDIR)/d_modech.o : $(MOUNT_DIR)/d_modech.c
  176. $(DO_CC)
  177. $(BUILDDIR)/d_part.o : $(MOUNT_DIR)/d_part.c
  178. $(DO_CC)
  179. $(BUILDDIR)/d_polyse.o : $(MOUNT_DIR)/d_polyse.c
  180. $(DO_CC)
  181. $(BUILDDIR)/d_scan.o : $(MOUNT_DIR)/d_scan.c
  182. $(DO_CC)
  183. $(BUILDDIR)/d_sky.o : $(MOUNT_DIR)/d_sky.c
  184. $(DO_CC)
  185. $(BUILDDIR)/d_sprite.o : $(MOUNT_DIR)/d_sprite.c
  186. $(DO_CC)
  187. $(BUILDDIR)/d_surf.o : $(MOUNT_DIR)/d_surf.c
  188. $(DO_CC)
  189. $(BUILDDIR)/d_vars.o : $(MOUNT_DIR)/d_vars.c
  190. $(DO_CC)
  191. $(BUILDDIR)/d_zpoint.o : $(MOUNT_DIR)/d_zpoint.c
  192. $(DO_CC)
  193. $(BUILDDIR)/host.o : $(MOUNT_DIR)/host.c
  194. $(DO_CC)
  195. $(BUILDDIR)/host_cmd.o : $(MOUNT_DIR)/host_cmd.c
  196. $(DO_CC)
  197. $(BUILDDIR)/keys.o : $(MOUNT_DIR)/keys.c
  198. $(DO_CC)
  199. $(BUILDDIR)/menu.o : $(MOUNT_DIR)/menu.c
  200. $(DO_CC)
  201. $(BUILDDIR)/mathlib.o : $(MOUNT_DIR)/mathlib.c
  202. $(DO_CC)
  203. $(BUILDDIR)/model.o : $(MOUNT_DIR)/model.c
  204. $(DO_CC)
  205. $(BUILDDIR)/nonintel.o : $(MOUNT_DIR)/nonintel.c
  206. $(DO_CC)
  207. $(BUILDDIR)/pr_cmds.o : $(MOUNT_DIR)/pr_cmds.c
  208. $(DO_CC)
  209. $(BUILDDIR)/pr_edict.o : $(MOUNT_DIR)/pr_edict.c
  210. $(DO_CC)
  211. $(BUILDDIR)/pr_exec.o : $(MOUNT_DIR)/pr_exec.c
  212. $(DO_CC)
  213. $(BUILDDIR)/r_aclip.o : $(MOUNT_DIR)/r_aclip.c
  214. $(DO_CC)
  215. $(BUILDDIR)/r_alias.o : $(MOUNT_DIR)/r_alias.c
  216. $(DO_CC)
  217. $(BUILDDIR)/r_bsp.o : $(MOUNT_DIR)/r_bsp.c
  218. $(DO_CC)
  219. $(BUILDDIR)/r_light.o : $(MOUNT_DIR)/r_light.c
  220. $(DO_CC)
  221. $(BUILDDIR)/r_draw.o : $(MOUNT_DIR)/r_draw.c
  222. $(DO_CC)
  223. $(BUILDDIR)/r_efrag.o : $(MOUNT_DIR)/r_efrag.c
  224. $(DO_CC)
  225. $(BUILDDIR)/r_edge.o : $(MOUNT_DIR)/r_edge.c
  226. $(DO_CC)
  227. $(BUILDDIR)/r_misc.o : $(MOUNT_DIR)/r_misc.c
  228. $(DO_CC)
  229. $(BUILDDIR)/r_main.o : $(MOUNT_DIR)/r_main.c
  230. $(DO_CC)
  231. $(BUILDDIR)/r_sky.o : $(MOUNT_DIR)/r_sky.c
  232. $(DO_CC)
  233. $(BUILDDIR)/r_sprite.o : $(MOUNT_DIR)/r_sprite.c
  234. $(DO_CC)
  235. $(BUILDDIR)/r_surf.o : $(MOUNT_DIR)/r_surf.c
  236. $(DO_CC)
  237. $(BUILDDIR)/r_part.o : $(MOUNT_DIR)/r_part.c
  238. $(DO_CC)
  239. $(BUILDDIR)/r_vars.o : $(MOUNT_DIR)/r_vars.c
  240. $(DO_CC)
  241. $(BUILDDIR)/screen.o : $(MOUNT_DIR)/screen.c
  242. $(DO_CC)
  243. $(BUILDDIR)/sbar.o : $(MOUNT_DIR)/sbar.c
  244. $(DO_CC)
  245. $(BUILDDIR)/sv_main.o : $(MOUNT_DIR)/sv_main.c
  246. $(DO_CC)
  247. $(BUILDDIR)/sv_phys.o : $(MOUNT_DIR)/sv_phys.c
  248. $(DO_CC)
  249. $(BUILDDIR)/sv_move.o : $(MOUNT_DIR)/sv_move.c
  250. $(DO_CC)
  251. $(BUILDDIR)/sv_user.o : $(MOUNT_DIR)/sv_user.c
  252. $(DO_CC)
  253. $(BUILDDIR)/zone.o : $(MOUNT_DIR)/zone.c
  254. $(DO_CC)
  255. $(BUILDDIR)/view.o : $(MOUNT_DIR)/view.c
  256. $(DO_CC)
  257. $(BUILDDIR)/wad.o : $(MOUNT_DIR)/wad.c
  258. $(DO_CC)
  259. $(BUILDDIR)/world.o : $(MOUNT_DIR)/world.c
  260. $(DO_CC)
  261. $(BUILDDIR)/cd_null.o : $(MOUNT_DIR)/cd_null.c
  262. $(DO_CC)
  263. $(BUILDDIR)/snd_dma.o : $(MOUNT_DIR)/snd_dma.c
  264. $(DO_CC)
  265. $(BUILDDIR)/snd_mix.o : $(MOUNT_DIR)/snd_mix.c
  266. $(DO_CC)
  267. $(BUILDDIR)/snd_mem.o : $(MOUNT_DIR)/snd_mem.c
  268. $(DO_CC)
  269. $(BUILDDIR)/net_dgrm.o : $(MOUNT_DIR)/net_dgrm.c
  270. $(DO_CC)
  271. $(BUILDDIR)/net_loop.o : $(MOUNT_DIR)/net_loop.c
  272. $(DO_CC)
  273. $(BUILDDIR)/net_main.o : $(MOUNT_DIR)/net_main.c
  274. $(DO_CC)
  275. $(BUILDDIR)/net_vcr.o : $(MOUNT_DIR)/net_vcr.c
  276. $(DO_CC)
  277. $(BUILDDIR)/net_udp.o : $(MOUNT_DIR)/net_udp.c
  278. $(DO_CC)
  279. $(BUILDDIR)/net_bsd.o : $(MOUNT_DIR)/net_bsd.c
  280. $(DO_CC)
  281. $(BUILDDIR)/sys_sun.o : $(MOUNT_DIR)/sys_sun.c
  282. $(DO_CC)
  283. $(BUILDDIR)/snd_sun.o : $(MOUNT_DIR)/snd_sun.c
  284. $(DO_CC)
  285. $(BUILDDIR)/in_sun.o : $(MOUNT_DIR)/in_sun.c
  286. $(DO_CC)
  287. $(BUILDDIR)/vid_sunx.o : $(MOUNT_DIR)/vid_sunx.c
  288. $(DO_CC)
  289. $(BUILDDIR)/vid_sunxil.o : $(MOUNT_DIR)/vid_sunxil.c
  290. $(DO_CC)
  291. #####
  292. $(BUILDDIR)/d_copy.o : $(MOUNT_DIR)/d_copy.s
  293. $(DO_AS)
  294. $(BUILDDIR)/d_draw.o : $(MOUNT_DIR)/d_draw.s
  295. $(DO_AS)
  296. $(BUILDDIR)/d_draw16.o : $(MOUNT_DIR)/d_draw16.s
  297. $(DO_AS)
  298. $(BUILDDIR)/d_parta.o : $(MOUNT_DIR)/d_parta.s
  299. $(DO_AS)
  300. $(BUILDDIR)/d_polysa.o : $(MOUNT_DIR)/d_polysa.s
  301. $(DO_AS)
  302. $(BUILDDIR)/d_scana.o : $(MOUNT_DIR)/d_scana.s
  303. $(DO_AS)
  304. $(BUILDDIR)/d_spr8.o : $(MOUNT_DIR)/d_spr8.s
  305. $(DO_AS)
  306. $(BUILDDIR)/d_varsa.o : $(MOUNT_DIR)/d_varsa.s
  307. $(DO_AS)
  308. $(BUILDDIR)/math.o : $(MOUNT_DIR)/math.s
  309. $(DO_AS)
  310. $(BUILDDIR)/r_aliasa.o : $(MOUNT_DIR)/r_aliasa.s
  311. $(DO_AS)
  312. $(BUILDDIR)/r_drawa.o : $(MOUNT_DIR)/r_drawa.s
  313. $(DO_AS)
  314. $(BUILDDIR)/r_edgea.o : $(MOUNT_DIR)/r_edgea.s
  315. $(DO_AS)
  316. $(BUILDDIR)/r_varsa.o : $(MOUNT_DIR)/r_varsa.s
  317. $(DO_AS)
  318. $(BUILDDIR)/surf16.o : $(MOUNT_DIR)/surf16.s
  319. $(DO_AS)
  320. $(BUILDDIR)/surf8.o : $(MOUNT_DIR)/surf8.s
  321. $(DO_AS)
  322. $(BUILDDIR)/worlda.o : $(MOUNT_DIR)/worlda.s
  323. $(DO_AS)
  324. $(BUILDDIR)/r_aclipa.o : $(MOUNT_DIR)/r_aclipa.s
  325. $(DO_AS)
  326. $(BUILDDIR)/snd_mixa.o : $(MOUNT_DIR)/snd_mixa.s
  327. $(DO_AS)
  328. $(BUILDDIR)/sys_dosa.o : $(MOUNT_DIR)/sys_dosa.s
  329. $(DO_AS)
  330. #############################################################################
  331. # TAR
  332. #############################################################################
  333. # Make RPMs. You need to be root to make this work
  334. RPMDIR = /var/tmp/quake-$(VERSION)
  335. tar:
  336. if [ ! -d archives ];then mkdir archives;fi
  337. $(MAKE) copyfiles COPYDIR=$(RPMDIR)
  338. cd $(RPMDIR); tar cvf q2ded-$(VERSION)-$(ARCH)-sun-solaris2.5.1.tar *
  339. cd $(RPMDIR); compress q2ded-$(VERSION)-$(ARCH)-sun-solaris2.5.1.tar
  340. mv $(RPMDIR)/*.tar.Z archives/.
  341. rm -rf $(RPMDIR)
  342. copyfiles:
  343. -mkdirhier $(COPYDIR)
  344. cp $(BUILD_RELEASE_DIR)/quake.sw $(COPYDIR)
  345. cp $(BUILD_RELEASE_DIR)/quake.xil $(COPYDIR)
  346. strip $(COPYDIR)/quake
  347. strip $(COPYDIR)/quake.xil
  348. cp $(MOUNT_DIR)/README.Solaris $(COPYDIR)/README.Solaris
  349. #############################################################################
  350. # MISC
  351. #############################################################################
  352. clean: clean-debug clean-release
  353. clean-debug:
  354. $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  355. clean-release:
  356. $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  357. clean2:
  358. -rm -f $(QUAKE_OBJS) $(QUAKE_X_OBJS) $(QUAKE_XIL_OBJS)