1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
|
--- ./Makefile.orig Sun Dec 31 14:01:34 2006
+++ ./Makefile Fri Jan 5 15:51:35 2007
@@ -9,7 +9,7 @@
# Check OS type.
OSTYPE= $(shell uname -s | tr A-Z a-z)
-ARCH= $(shell uname -m | sed -e s/i.86/i386/)
+ARCH?= $(shell uname -m | sed -e s/i.86/i386/)
MARCH= $(shell uname -m)
OP_SYSTEM= $(shell uname -sr)
@@ -27,75 +27,75 @@
# verbose compilation #
# process. #
#===========================#
-VERBOSE=NO
+VERBOSE=YES
#===========================#
# Q2P Client #
#===========================#
-BUILD_Q2P=YES
+BUILD_Q2P?=NO
#===========================#
# Enable Optimizations. #
# Release build only. #
#===========================#
-OPTIMIZE=NO
+OPTIMIZE?=NO
#===========================#
# Remove symbols from #
# binaries, reduce size. #
# Release build only. #
#===========================#
-STRIP=YES
+STRIP?=YES
#===========================#
# Sound Drivers #
#===========================#
ifeq ($(OSTYPE),linux)
-BUILD_ALSA_SND=YES
+BUILD_ALSA_SND?=NO
endif
-BUILD_OSS_SND=YES
-BUILD_SDL_SND=YES
+BUILD_OSS_SND?=NO
+BUILD_SDL_SND?=NO
#===========================#
# Quake 2 dedicated server. #
#===========================#
-BUILD_DEDICATED=YES
+BUILD_DEDICATED?=NO
#===========================#
# GLX, SDL-GLX #
# render. #
#===========================#
-BUILD_GLX=YES
-BUILD_SDLGL=YES
+BUILD_GLX?=NO
+BUILD_SDLGL?=NO
#===========================#
# Linked To GLU library. #
#===========================#
-WITH_GLULIB=YES
+WITH_GLULIB?=YES
#===========================#
# Built in DGA mouse #
# support. #
#===========================#
-WITH_XF86_DGA=NO
+WITH_XF86_DGA?=YES
#===========================#
# Read from $(DATADIR) and #
# write to "~/.quake2" #
#===========================#
-WITH_DATADIR=NO
+WITH_DATADIR?=YES
#===========================#
# Load renderers #
# from $(LIBDIR) #
#===========================#
-WITH_LIBDIR=NO
+WITH_LIBDIR?=YES
#===========================#
# Built in CD Audio #
# support. #
#===========================#
-WITH_CDAUDIO=NO
+WITH_CDAUDIO?=YES
ifeq ($(OSTYPE),freebsd)
CD_API=cd_freebsd.c
endif
@@ -107,22 +107,19 @@
# Enable XMMS/Audacious #
# support. Only one of them #
# at same time. #
-# No yet for FreeBSD :( #
#===========================#
-ifeq ($(OSTYPE),linux)
-WITH_AUDACIOUS=YES
-WITH_XMMS=NO
-endif
+WITH_AUDACIOUS?=NO
+WITH_XMMS?=NO
#===========================#
# Quake 2 game library. #
#===========================#
-BUILD_GAME=YES
+BUILD_GAME?=NO
#===========================#
# CTF Library. #
#===========================#
-BUILD_CTF=YES
+BUILD_CTF?=NO
CLIENT_DIR=$(MOUNT_DIR)/client
@@ -133,24 +130,24 @@
GAME_DIR=$(MOUNT_DIR)/game
CTF_DIR=$(MOUNT_DIR)/ctf
-CC=gcc
+CC?=gcc
CC_VERSION=$(shell $(CC) -dumpversion)
-X11BASE= /usr/X11R6
-LOCALBASE= /usr/local
-GAMEBASE= /usr/local
-SYSBINDIR=$(LOCALBASE)/bin
+X11BASE?= /usr/X11R6
+LOCALBASE?= /usr/local
+GAMEBASE?= $(PREFIX)
+SYSBINDIR?= $(PREFIX)/bin
ifeq ($(OSTYPE),freebsd)
- DATADIR= $(GAMEBASE)/share/quake2
- LIBDIR= $(GAMEBASE)/lib/quake2
+ DATADIR?= $(GAMEBASE)/share/quake2
+ LIBDIR?= $(GAMEBASE)/lib/quake2
else
- DATADIR= $(GAMEBASE)/games/quake2
- LIBDIR= $(GAMEBASE)/games/quake2
+ DATADIR?= $(GAMEBASE)/games/quake2
+ LIBDIR?= $(GAMEBASE)/games/quake2
endif
SHLIB_EXT=so
-GAME_NAME=game$(ARCH).$(SHLIB_EXT)
+GAME_NAME=game.$(SHLIB_EXT)
BASE_CFLAGS+=-I$(LOCALBASE)/include \
-I$(X11BASE)/include \
@@ -168,15 +165,14 @@
ifeq ($(strip $(OPTIMIZE)),YES)
RELEASE_CFLAGS+=-O3 \
- -march=$(MARCH) \
-funroll-loops \
-fstrength-reduce \
- -fexpensive-optimizations \
- -falign-loops=2 \
+ -fexpensive-optimizations -fomit-frame-pointer -ffast-math
+ifeq ($(ARCH),i386)
+ RELEASE_CFLAGS+=-falign-loops=2 \
-falign-jumps=2 \
-falign-functions=2
-else
- RELEASE_CFLAGS+=-O2
+endif
endif
ifeq ($(strip $(STRIP)),YES)
@@ -263,7 +259,7 @@
endif
ifeq ($(strip $(BUILD_DEDICATED)),YES)
- TARGETS += $(BINDIR)/q2p-dedicated
+ TARGETS += $(BINDIR)/q2p-ded
DED_CFLAGS += -DDEDICATED_ONLY
endif
@@ -292,11 +288,11 @@
endif
ifeq ($(strip $(BUILD_GAME)),YES)
- TARGETS+=$(BINDIR)/baseq2/game$(ARCH).$(SHLIB_EXT)
+ TARGETS+=$(BINDIR)/baseq2/game.$(SHLIB_EXT)
endif
ifeq ($(strip $(BUILD_CTF)),YES)
- TARGETS+=$(BINDIR)/ctf/game$(ARCH).$(SHLIB_EXT)
+ TARGETS+=$(BINDIR)/ctf/game.$(SHLIB_EXT)
endif
all:
@@ -585,7 +581,7 @@
$(BUILDDIR)/ded/q_shared.o $(BUILDDIR)/ded/pmove.o \
$(BUILDDIR)/ded/cl_null.o $(BUILDDIR)/ded/cd_null.o
-$(BINDIR)/q2p-dedicated : $(Q2PDED_OBJS)
+$(BINDIR)/q2p-ded : $(Q2PDED_OBJS)
@echo
@echo "**Built Q2P dedicated client with cflags:"
@echo "$(CC) $(CC_VERSION)";
@@ -709,7 +705,7 @@
$(BUILDDIR)/game/m_tank.o $(BUILDDIR)/game/p_hud.o $(BUILDDIR)/game/p_trail.o \
$(BUILDDIR)/game/p_view.o $(BUILDDIR)/game/p_weapon.o $(BUILDDIR)/game/m_flash.o
-$(BINDIR)/baseq2/game$(ARCH).$(SHLIB_EXT) : $(GAME_OBJS)
+$(BINDIR)/baseq2/game.$(SHLIB_EXT) : $(GAME_OBJS)
@echo
@echo "**Built $@ with cflags:"
@echo "$(CC) $(CC_VERSION) $(CFLAGS)";
@@ -784,7 +780,7 @@
$(BUILDDIR)/ctf/p_menu.o $(BUILDDIR)/ctf/p_trail.o $(BUILDDIR)/ctf/p_view.o \
$(BUILDDIR)/ctf/p_weapon.o $(BUILDDIR)/ctf/q_shared.o
-$(BINDIR)/ctf/game$(ARCH).$(SHLIB_EXT) : $(CTF_OBJS)
+$(BINDIR)/ctf/game.$(SHLIB_EXT) : $(CTF_OBJS)
@echo
@echo "**Built $@ with cflags:"
@echo "$(CC) $(CC_VERSION) $(CFLAGS)";
@@ -935,4 +931,4 @@
@tar cjvf $(Q2P_VERSION_BZ2)-$(OSTYPE)-$(DATE).tar.bz2 $(BINDIR)
@printf ".... Done.\n"
-
\ No newline at end of file
+
|