Makefile.Solaris 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. #
  2. # QuakeWorld Makefile for Linux 2.0
  3. #
  4. # Apr '98 by Zoid <zoid@idsoftware.com>
  5. #
  6. # GNU Make required
  7. #
  8. ifneq (,$(findstring i86pc,$(shell uname -m)))
  9. ARCH=i386
  10. else
  11. ARCH=sparc
  12. endif
  13. MAINDIR=/grog/Projects/QW
  14. BUILD_DEBUG_DIR=debug$(ARCH)
  15. BUILD_RELEASE_DIR=release$(ARCH)
  16. CLIENT_DIR=$(MAINDIR)/client
  17. SERVER_DIR=$(MAINDIR)/server
  18. CC=gcc
  19. BASE_CFLAGS=-Wall -Dstricmp=strcasecmp -I$(CLIENT_DIR) -I$(SERVER_DIR)
  20. RELEASE_CFLAGS=$(BASE_CFLAGS) -O2 -ffast-math
  21. # -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
  22. DEBUG_CFLAGS=$(BASE_CFLAGS) -g
  23. LDFLAGS=-lm -lsocket -lnsl
  24. DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
  25. DO_SERVER_CC=$(CC) -DSERVERONLY $(CFLAGS) -o $@ -c $<
  26. #############################################################################
  27. # SETUP AND BUILD
  28. #############################################################################
  29. TARGETS=$(BUILDDIR)/qwsv
  30. build_debug:
  31. @-mkdir $(BUILD_DEBUG_DIR) \
  32. $(BUILD_DEBUG_DIR)/server
  33. $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  34. build_release:
  35. @-mkdir $(BUILD_RELEASE_DIR) \
  36. $(BUILD_RELEASE_DIR)/server
  37. $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)"
  38. all: build_debug build_release
  39. targets: $(TARGETS)
  40. #############################################################################
  41. # SERVER
  42. #############################################################################
  43. QWSV_OBJS = \
  44. $(BUILDDIR)/server/pr_cmds.o \
  45. $(BUILDDIR)/server/pr_edict.o \
  46. $(BUILDDIR)/server/pr_exec.o \
  47. $(BUILDDIR)/server/sv_init.o \
  48. $(BUILDDIR)/server/sv_main.o \
  49. $(BUILDDIR)/server/sv_nchan.o \
  50. $(BUILDDIR)/server/sv_ents.o \
  51. $(BUILDDIR)/server/sv_send.o \
  52. $(BUILDDIR)/server/sv_move.o \
  53. $(BUILDDIR)/server/sv_phys.o \
  54. $(BUILDDIR)/server/sv_user.o \
  55. $(BUILDDIR)/server/sv_ccmds.o \
  56. $(BUILDDIR)/server/world.o \
  57. $(BUILDDIR)/server/sys_unix.o \
  58. $(BUILDDIR)/server/model.o \
  59. $(BUILDDIR)/server/cmd.o \
  60. $(BUILDDIR)/server/common.o \
  61. $(BUILDDIR)/server/crc.o \
  62. $(BUILDDIR)/server/cvar.o \
  63. $(BUILDDIR)/server/mathlib.o \
  64. $(BUILDDIR)/server/md4.o \
  65. $(BUILDDIR)/server/zone.o \
  66. $(BUILDDIR)/server/pmove.o \
  67. $(BUILDDIR)/server/pmovetst.o \
  68. $(BUILDDIR)/server/net_chan.o \
  69. $(BUILDDIR)/server/net_udp.o
  70. $(BUILDDIR)/qwsv : $(QWSV_OBJS)
  71. $(CC) $(CFLAGS) -o $@ $(QWSV_OBJS) $(LDFLAGS)
  72. $(BUILDDIR)/server/pr_cmds.o : $(SERVER_DIR)/pr_cmds.c
  73. $(DO_SERVER_CC)
  74. $(BUILDDIR)/server/pr_edict.o : $(SERVER_DIR)/pr_edict.c
  75. $(DO_SERVER_CC)
  76. $(BUILDDIR)/server/pr_exec.o : $(SERVER_DIR)/pr_exec.c
  77. $(DO_SERVER_CC)
  78. $(BUILDDIR)/server/sv_init.o : $(SERVER_DIR)/sv_init.c
  79. $(DO_SERVER_CC)
  80. $(BUILDDIR)/server/sv_main.o : $(SERVER_DIR)/sv_main.c
  81. $(DO_SERVER_CC)
  82. $(BUILDDIR)/server/sv_nchan.o : $(SERVER_DIR)/sv_nchan.c
  83. $(DO_SERVER_CC)
  84. $(BUILDDIR)/server/sv_ents.o : $(SERVER_DIR)/sv_ents.c
  85. $(DO_SERVER_CC)
  86. $(BUILDDIR)/server/sv_send.o : $(SERVER_DIR)/sv_send.c
  87. $(DO_SERVER_CC)
  88. $(BUILDDIR)/server/sv_move.o : $(SERVER_DIR)/sv_move.c
  89. $(DO_SERVER_CC)
  90. $(BUILDDIR)/server/sv_phys.o : $(SERVER_DIR)/sv_phys.c
  91. $(DO_SERVER_CC)
  92. $(BUILDDIR)/server/sv_user.o : $(SERVER_DIR)/sv_user.c
  93. $(DO_SERVER_CC)
  94. $(BUILDDIR)/server/sv_ccmds.o : $(SERVER_DIR)/sv_ccmds.c
  95. $(DO_SERVER_CC)
  96. $(BUILDDIR)/server/world.o : $(SERVER_DIR)/world.c
  97. $(DO_SERVER_CC)
  98. $(BUILDDIR)/server/sys_unix.o : $(SERVER_DIR)/sys_unix.c
  99. $(DO_SERVER_CC)
  100. $(BUILDDIR)/server/model.o : $(SERVER_DIR)/model.c
  101. $(DO_SERVER_CC)
  102. $(BUILDDIR)/server/cmd.o : $(CLIENT_DIR)/cmd.c
  103. $(DO_SERVER_CC)
  104. $(BUILDDIR)/server/common.o : $(CLIENT_DIR)/common.c
  105. $(DO_SERVER_CC)
  106. $(BUILDDIR)/server/crc.o : $(CLIENT_DIR)/crc.c
  107. $(DO_SERVER_CC)
  108. $(BUILDDIR)/server/cvar.o : $(CLIENT_DIR)/cvar.c
  109. $(DO_SERVER_CC)
  110. $(BUILDDIR)/server/mathlib.o : $(CLIENT_DIR)/mathlib.c
  111. $(DO_SERVER_CC)
  112. $(BUILDDIR)/server/md4.o : $(CLIENT_DIR)/md4.c
  113. $(DO_SERVER_CC)
  114. $(BUILDDIR)/server/zone.o : $(CLIENT_DIR)/zone.c
  115. $(DO_SERVER_CC)
  116. $(BUILDDIR)/server/pmove.o : $(CLIENT_DIR)/pmove.c
  117. $(DO_SERVER_CC)
  118. $(BUILDDIR)/server/pmovetst.o : $(CLIENT_DIR)/pmovetst.c
  119. $(DO_SERVER_CC)
  120. $(BUILDDIR)/server/net_chan.o : $(CLIENT_DIR)/net_chan.c
  121. $(DO_SERVER_CC)
  122. $(BUILDDIR)/server/net_udp.o : $(CLIENT_DIR)/net_udp.c
  123. $(DO_SERVER_CC)
  124. #############################################################################
  125. # MISC
  126. #############################################################################
  127. clean: clean-debug clean-release
  128. clean-debug:
  129. $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  130. clean-release:
  131. $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)"
  132. clean2:
  133. -rm -f $(QWSV_OBJS) \
  134. $(QWCL_OBJS) \
  135. $(QWCL_AS_OBJS) \
  136. $(QWCL_SVGA_OBJS) \
  137. $(QWCL_X11_OBJS) \
  138. $(GLQWCL_OBJS) \