--- code/unix/Makefile.orig 2024-02-13 13:27:33 UTC +++ code/unix/Makefile @@ -25,7 +25,7 @@ PLATFORM_RELEASE=$(shell uname -r) ### # Where we are building from (where the source code should be!) -MOUNT_DIR=../ +MOUNT_DIR=.. # Where we are building to, libMesaVoodooGL.so.3.3 should be here, etc. # the demo pk3 file should be here in demoq3/pak0.pk3 or baseq3/pak0.pk3 @@ -34,7 +34,7 @@ BDIR=$(MOUNT_DIR)/../run # Build name # BUILD_NAME=$(BUILD_NAME) -BUILD_NAME=quake3.x86 +BUILD_NAME=quake3 @@ -46,8 +46,8 @@ BASEQ3_DIR=$(BDIR)/baseq3 BASEQ3_DIR=$(BDIR)/baseq3 -BD=debug$(ARCH)$(GLIBC) -BR=release$(ARCH)$(GLIBC) +BD=debug +BR=release CDIR=$(MOUNT_DIR)/client SDIR=$(MOUNT_DIR)/server RDIR=$(MOUNT_DIR)/renderer @@ -65,7 +65,7 @@ SPLNDIR=$(MOUNT_DIR)/splines SPLNDIR=$(MOUNT_DIR)/splines # extract version info -VERSION=$(shell ./extract_ver.pl) +VERSION="Q3 1.32c" RPM_RELEASE=1 # NOTE: used by dcp rcp targets, not referenced @@ -76,7 +76,10 @@ RPM_RELEASE=1 ############################################################################# ## Defaults -DLL_ONLY=false +ARCH=$(shell uname -m) +RPMARCH=$(ARCH) +VENDOR=unknown +DLL_ONLY=true # bk010215 - TODO - add all defaults / kill Ryan @@ -199,31 +202,34 @@ GLIBC= #libc is irrelevant GLIBC= #libc is irrelevant -ifneq (,$(findstring alpha,$(shell uname -m))) -ARCH=axp -RPMARCH=alpha -VENDOR=dec -else #default to i386 -ARCH=i386 -RPMARCH=i386 -VENDOR=unknown -endif #alpha test +ifeq ($(ARCH),alpha) + ARCH=axp + RPMARCH=alpha + VENDOR=dec +else ifeq ($(ARCH),powerpc) + ARCH=ppc + RPMARCH=ppc + DLL_ONLY=false +else ifeq ($(ARCH),i386) + DLL_ONLY=false +endif +BASE_CFLAGS = -fsigned-char $(CFLAGS) -DDATADIR='\"$(Q3DIR)\"' -DLIBDIR='\"$(LIBDIR)\"' +ifeq ($(DLL_ONLY),true) + BASE_CFLAGS += -DDLL_ONLY +endif -BASE_CFLAGS = -pipe +GL_CFLAGS = -I$(LOCALBASE)/include -GL_CFLAGS = -I$(MESADIR)/include -I/usr/X11R6/include - DEBUG_CFLAGS=$(BASE_CFLAGS) -g -Wall -Werror -ifeq ($(ARCH),axp) -CC=pgcc -RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -else -#NEWPGCC=/loki/global/x86/bin/gcc # raistlin012301 -#NEWPGCC=/usr/local/gcc-2.95.2/bin/gcc -NEWPGCC=/home/raistllin/src/gcc/build/install/bin/gcc -CC=$(shell if [ -f $(NEWPGCC) ]; then echo $(NEWPGCC); else echo pgcc; fi ) -RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O6 -mcpu=pentiumpro -march=pentium -fomit-frame-pointer -pipe -ffast-math -malign-loops=2 -malign-jumps=2 -malign-functions=2 -fno-strict-aliasing - fstrength-reduce +RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG + +ifdef OPTIMIZED_CFLAGS + ifeq ($(ARCH),i386) +RELEASE_CFLAGS+=-ffast-math -falign-functions=2 + else +RELEASE_CFLAGS+=-ffast-math + endif endif LIBEXT=a @@ -237,25 +243,33 @@ THREAD_LDFLAGS=-lpthread THREAD_LDFLAGS=-lpthread # don't need -ldl (FreeBSD) -LDFLAGS=-lm +LDFLAGS+=-lm #GLLDFLAGS=-L/usr/X11R6/lib -L$(MESADIR)/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm #GLLDFLAGS=-L/usr/X11/lib -lGL -lX11 -lXext -lm -GLLDFLAGS=-L/usr/X11R6/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm +GLLDFLAGS=-L$(LOCALBASE)/lib -lGL -lX11 -lXext -lXxf86dga -lXxf86vm -ifeq ($(ARCH),axp) -TARGETS=\ - $(B)/$(PLATFORM)q3ded -else -TARGETS=\ - $(B)/$(PLATFORM)quake3 \ - $(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) \ - $(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) \ - $(B)/baseq3/ui$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) \ - $(B)/missionpack/ui$(ARCH).$(SHLIBEXT) +ifdef CLIENT +TARGETS+=$(B)/quake3 endif +ifdef DEDICATED +TARGETS+=$(B)/q3ded +endif + +ifdef SMP +TARGETS+=$(B)/quake3-smp +endif + +ifdef GAMELIBS +TARGETS+=\ + $(B)/baseq3/cgame.$(SHLIBEXT) \ + $(B)/baseq3/qagame.$(SHLIBEXT) \ + $(B)/baseq3/ui.$(SHLIBEXT) \ + $(B)/missionpack/cgame.$(SHLIBEXT) \ + $(B)/missionpack/qagame.$(SHLIBEXT) \ + $(B)/missionpack/ui.$(SHLIBEXT) +endif + else # ifeq freebsd ############################################################################# @@ -515,20 +529,6 @@ Q3OBJ = \ $(B)/client/unix_main.o \ $(B)/client/unix_net.o \ $(B)/client/unix_shared.o \ - \ - $(B)/client/ahoptim.o \ - $(B)/client/autohint.o \ - $(B)/client/ftbase.o \ - $(B)/client/ftdebug.o \ - $(B)/client/ftglyph.o \ - $(B)/client/ftinit.o \ - $(B)/client/ftmm.o \ - $(B)/client/ftsystem.o \ - $(B)/client/raster1.o \ - $(B)/client/sfnt.o \ - $(B)/client/sfobjs.o \ - $(B)/client/smooth.o \ - $(B)/client/truetype.o # \ # $(B)/client/q_parse.o \ # $(B)/client/math_quaternion.o \ @@ -541,12 +541,14 @@ Q3OBJ = \ # $(B)/client/q_shared.o \ ifeq ($(ARCH),i386) - Q3OBJ += $(B)/client/vm_x86.o + ifeq ($(DLL_ONLY),false) + Q3OBJ += $(B)/client/vm_x86.o + endif endif ifeq ($(ARCH),ppc) ifeq ($(DLL_ONLY),false) - Q3OBJ += $(B)/client/vm_ppc.o + Q3OBJ += $(B)/client/vm_ppc_new.o endif endif @@ -559,10 +561,24 @@ ifeq ($(PLATFORM),freebsd) $(B)/client/linux_qgl.o \ $(B)/client/linux_glimp.o \ $(B)/client/linux_snd.o \ + $(B)/client/linux_signals.o \ $(B)/client/snd_mixa.o \ - $(B)/client/matha.o \ - $(B)/client/ftol.o \ - $(B)/client/snapvector.o + $(B)/client/matha.o + + Q3POBJ_SMP=\ + $(B)/client/linux_common.o \ + $(B)/client/linux_qgl.o \ + $(B)/client/linux_glimp_smp.o \ + $(B)/client/linux_snd.o \ + $(B)/client/linux_signals.o \ + $(B)/client/snd_mixa.o \ + $(B)/client/matha.o + + ifeq ($(ARCH),i386) + Q3POBJ += $(B)/client/ftol.o $(B)/client/snapvector.o + Q3POBJ_SMP += $(B)/client/ftol.o $(B)/client/snapvector.o + endif + else ifeq ($(PLATFORM),irix) Q3POBJ=\ @@ -602,12 +618,12 @@ endif #IRIX endif #FreeBSD endif #IRIX -$(B)/$(PLATFORM)quake3 : $(Q3OBJ) $(Q3POBJ) +$(B)/quake3 : $(Q3OBJ) $(Q3POBJ) $(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(GLLDFLAGS) $(LDFLAGS) # TTimo: splines code requires C++ linking, but splines have not been officially included in the codebase # $(CXX) -o $@ $(Q3OBJ) $(Q3POBJ) $(GLLDFLAGS) $(LDFLAGS) -$(B)/$(PLATFORM)quake3-smp : $(Q3OBJ) $(Q3POBJ_SMP) +$(B)/quake3-smp : $(Q3OBJ) $(Q3POBJ_SMP) $(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(GLLDFLAGS) \ $(THREAD_LDFLAGS) $(LDFLAGS) @@ -758,6 +774,7 @@ $(B)/client/linux_snd.o : $(UDIR)/linux_snd.c; $(DO_CC $(B)/client/linux_qgl.o : $(UDIR)/linux_qgl.c; $(DO_CC) $(GL_CFLAGS) $(B)/client/linux_input.o : $(UDIR)/linux_input.c; $(DO_CC) $(B)/client/linux_snd.o : $(UDIR)/linux_snd.c; $(DO_CC) +$(B)/client/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_CC) $(GL_CFLAGS) $(B)/client/snd_mixa.o : $(UDIR)/snd_mixa.s; $(DO_AS) $(B)/client/matha.o : $(UDIR)/matha.s; $(DO_AS) @@ -769,7 +786,7 @@ ifeq ($(DLL_ONLY),false) ifeq ($(ARCH),ppc) ifeq ($(DLL_ONLY),false) -$(B)/client/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_CC) +$(B)/client/vm_ppc_new.o : $(CMDIR)/vm_ppc_new.c; $(DO_CC) endif endif @@ -912,22 +929,26 @@ Q3DOBJ = \ $(B)/ded/unix_main.o \ $(B)/ded/unix_net.o \ $(B)/ded/unix_shared.o \ + $(B)/ded/linux_signals.o \ \ $(B)/ded/null_client.o \ $(B)/ded/null_input.o \ $(B)/ded/null_snddma.o ifeq ($(ARCH),i386) - Q3DOBJ += $(B)/ded/vm_x86.o $(B)/ded/ftol.o $(B)/ded/snapvector.o + Q3DOBJ += $(B)/ded/ftol.o $(B)/ded/snapvector.o + ifeq ($(DLL_ONLY),false) + Q3DOBJ += $(B)/ded/vm_x86.o + endif endif ifeq ($(ARCH),ppc) ifeq ($(DLL_ONLY),false) - Q3DOBJ += $(B)/ded/vm_ppc.o + Q3DOBJ += $(B)/ded/vm_ppc_new.o endif endif -$(B)/$(PLATFORM)q3ded : $(Q3DOBJ) +$(B)/q3ded : $(Q3DOBJ) $(CC) -o $@ $(Q3DOBJ) $(LDFLAGS) $(B)/ded/sv_bot.o : $(SDIR)/sv_bot.c; $(DO_DED_CC) @@ -988,6 +1009,7 @@ $(B)/ded/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_D $(B)/ded/unix_main.o : $(UDIR)/unix_main.c; $(DO_DED_CC) $(B)/ded/unix_net.o : $(UDIR)/unix_net.c; $(DO_DED_CC) $(B)/ded/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_DED_CC) +$(B)/ded/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_DED_CC) $(B)/ded/null_client.o : $(NDIR)/null_client.c; $(DO_DED_CC) $(B)/ded/null_input.o : $(NDIR)/null_input.c; $(DO_DED_CC) $(B)/ded/null_snddma.o : $(NDIR)/null_snddma.c; $(DO_DED_CC) @@ -1003,7 +1025,7 @@ ifeq ($(DLL_ONLY),false) ifeq ($(ARCH),ppc) ifeq ($(DLL_ONLY),false) -$(B)/ded/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_DED_CC) +$(B)/ded/vm_ppc_new.o : $(CMDIR)/vm_ppc_new.c; $(DO_DED_CC) endif endif @@ -1068,7 +1090,7 @@ Q3CGOBJ = \ $(B)/baseq3/cgame/q_math.o \ $(B)/baseq3/cgame/q_shared.o -$(B)/baseq3/cgame$(ARCH).$(SHLIBEXT) : $(Q3CGOBJ) +$(B)/baseq3/cgame.$(SHLIBEXT) : $(Q3CGOBJ) $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) $(B)/baseq3/cgame/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) @@ -1128,7 +1150,7 @@ MPCGOBJ = \ $(B)/missionpack/cgame/q_shared.o \ $(B)/missionpack/cgame/ui_shared.o -$(B)/missionpack/cgame$(ARCH).$(SHLIBEXT) : $(MPCGOBJ) +$(B)/missionpack/cgame.$(SHLIBEXT) : $(MPCGOBJ) $(CC) $(SHLIBLDFLAGS) -o $@ $(MPCGOBJ) $(B)/missionpack/cgame/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) -DMISSIONPACK @@ -1200,7 +1222,7 @@ Q3GOBJ = \ $(B)/baseq3/game/q_math.o \ $(B)/baseq3/game/q_shared.o -$(B)/baseq3/qagame$(ARCH).$(SHLIBEXT) : $(Q3GOBJ) +$(B)/baseq3/qagame.$(SHLIBEXT) : $(Q3GOBJ) $(CC) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) $(B)/baseq3/game/ai_chat.o : $(GDIR)/ai_chat.c; $(DO_SHLIB_CC) @@ -1278,7 +1300,7 @@ MPGOBJ = \ $(B)/missionpack/game/q_math.o \ $(B)/missionpack/game/q_shared.o -$(B)/missionpack/qagame$(ARCH).$(SHLIBEXT) : $(MPGOBJ) +$(B)/missionpack/qagame.$(SHLIBEXT) : $(MPGOBJ) $(CC) $(SHLIBLDFLAGS) -o $@ $(MPGOBJ) $(B)/missionpack/game/ai_chat.o : $(GDIR)/ai_chat.c; $(DO_SHLIB_CC) -DMISSIONPACK @@ -1367,7 +1389,7 @@ Q3UIOBJ = \ $(B)/baseq3/ui/q_math.o \ $(B)/baseq3/ui/q_shared.o -$(B)/baseq3/ui$(ARCH).$(SHLIBEXT) : $(Q3UIOBJ) +$(B)/baseq3/ui.$(SHLIBEXT) : $(Q3UIOBJ) $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) $(B)/baseq3/ui/bg_misc.o : $(GDIR)/bg_misc.c; $(DO_SHLIB_CC) @@ -1410,7 +1432,7 @@ $(B)/baseq3/ui/ui_teamorders.o : $(Q3UIDIR)/ui_teamord $(B)/baseq3/ui/ui_startserver.o : $(Q3UIDIR)/ui_startserver.c; $(DO_SHLIB_CC) $(B)/baseq3/ui/ui_team.o : $(Q3UIDIR)/ui_team.c; $(DO_SHLIB_CC) $(B)/baseq3/ui/ui_teamorders.o : $(Q3UIDIR)/ui_teamorders.c; $(DO_SHLIB_CC) -$(B)/baseq3/ui/ui_syscalls.o : $(Q3UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC) +$(B)/baseq3/ui/ui_syscalls.o : $(UIDIR)/ui_syscalls.c; $(DO_SHLIB_CC) $(B)/baseq3/ui/ui_video.o : $(Q3UIDIR)/ui_video.c; $(DO_SHLIB_CC) # bk001205 - these wre the only SHLIB compiles in 1.17 @@ -1450,7 +1472,7 @@ MPUIOBJ = \ # $(B)/missionpack/ui/q_math.o \ # $(B)/missionpack/ui/q_shared.o -$(B)/missionpack/ui$(ARCH).$(SHLIBEXT) : $(MPUIOBJ) +$(B)/missionpack/ui.$(SHLIBEXT) : $(MPUIOBJ) $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(MPUIOBJ) $(B)/missionpack/ui/ui_atoms.o : $(UIDIR)/ui_atoms.c; $(DO_SHLIB_CC) -DMISSIONPACK @@ -1613,34 +1635,21 @@ Q3SOBJ = \ $(B)/q3static/unix_net.o \ $(B)/q3static/unix_shared.o \ \ - $(B)/q3static/ahoptim.o \ - $(B)/q3static/autohint.o \ - $(B)/q3static/ftbase.o \ - $(B)/q3static/ftdebug.o \ - $(B)/q3static/ftglyph.o \ - $(B)/q3static/ftinit.o \ - $(B)/q3static/ftmm.o \ - $(B)/q3static/ftsystem.o \ - $(B)/q3static/raster1.o \ - $(B)/q3static/sfnt.o \ - $(B)/q3static/sfobjs.o \ - $(B)/q3static/smooth.o \ - $(B)/q3static/truetype.o \ - \ $(B)/q3static/linux_qgl.o \ $(B)/q3static/linux_glimp.o \ - $(B)/q3static/linux_joystick.o \ $(B)/q3static/linux_snd.o \ $(B)/q3static/snd_mixa.o \ $(B)/q3static/matha.o ifeq ($(ARCH),i386) - Q3SOBJ += $(B)/q3static/vm_x86.o + ifeq ($(DLL_ONLY),false) + Q3SOBJ += $(B)/q3static/vm_x86.o + endif endif ifeq ($(ARCH),ppc) ifeq ($(DLL_ONLY),false) - Q3SOBJ += $(B)/q3static/vm_ppc.o + Q3SOBJ += $(B)/q3static/vm_ppc_new.o endif endif @@ -1795,7 +1804,7 @@ ifeq ($(DLL_ONLY),false) ifeq ($(ARCH),ppc) ifeq ($(DLL_ONLY),false) -$(B)/q3static/vm_ppc.o : $(CMDIR)/vm_ppc.c; $(DO_CC) -DQ3_STATIC +$(B)/q3static/vm_ppc_new.o : $(CMDIR)/vm_ppc_new.c; $(DO_CC) -DQ3_STATIC endif endif @@ -2020,7 +2029,7 @@ $(B)/q3static/bg_slidemove.o : $(GDIR)/bg_slidemove.c; -$(B)/$(PLATFORM)q3static : $(Q3SOBJ) +$(B)/q3static : $(Q3SOBJ) $(CC) $(CFLAGS) -o $@ $(Q3SOBJ) $(GLLDFLAGS) $(LDFLAGS)