# # Quake2 Makefile for Linux 2.0 # # Nov '97 by Zoid # # Kingpin-ized, July '99 by Ridah # # ELF only # VERSION=1.21_ VERSION_FN=$(VERSION)beta_glibc#$(GLIBC) RPM_RELEASE=1 ifneq (,$(findstring libc6,$(shell if [ -e /lib/libc.so.6* ];then echo libc6;fi))) GLIBC=-glibc else GLIBC= endif ifneq (,$(findstring alpha,$(shell uname -m))) ARCH=axp RPMARCH=alpha else ARCH=i386 RPMARCH=i386 endif MOUNT_DIR=/disks/f/kingpin/source BUILD_DEBUG_DIR=debug$(ARCH)$(GLIBC) BUILD_RELEASE_DIR=release$(ARCH)$(GLIBC) CLIENT_DIR=$(MOUNT_DIR)/client SERVER_DIR=$(MOUNT_DIR)/server REF_GL_DIR=$(MOUNT_DIR)/ref_gl COMMON_DIR=$(MOUNT_DIR)/qcommon LINUX_DIR=$(MOUNT_DIR)/linux GAME_DIR=$(MOUNT_DIR)/game NULL_DIR=$(MOUNT_DIR)/null MESA_DIR=/usr/local/src/Mesa-3.1 #CC=i386-glibc20-linux-gcc CC=gcc CPP=g++ BASE_CFLAGS=-Dstricmp=strcasecmp ifeq ($(ARCH),axp) RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \ -fomit-frame-pointer -fexpensive-optimizations else RELEASE_CFLAGS=$(BASE_CFLAGS) -m486 -O6 -ffast-math -funroll-loops \ -fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \ -malign-jumps=2 -malign-functions=2 endif DEBUG_CFLAGS=$(BASE_CFLAGS) -g LDFLAGS=-ldl -lm SVGALDFLAGS=-lvga -lm XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext XCFLAGS= GLLDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib \ -L$(MESA_DIR)/lib -lX11 -lXext -lvga -lm GLXLDFLAGS=-L/usr/X11R6/lib -L/usr/local/lib \ -L$(MESA_DIR)/lib -lX11 -lXext -lm GLCFLAGS=-I$(MESA_DIR)/include -I/usr/include/glide SHLIBEXT=so SHLIBCFLAGS=-fPIC SHLIBLDFLAGS=-shared # Enable the following line to enable the CD copy protection DO_CC=$(CC) $(CFLAGS) -DCOPYPROTECT -o $@ -c $< #DO_NORMAL_CC=$(CC) $(CFLAGS) -o $@ -c $< DO_DED_CC=$(CC) $(CFLAGS) -DDEDICATED_ONLY -o $@ -c $< DO_O_CC=$(CC) $(CFLAGS) -O -o $@ -c $< DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< DO_SHLIB_O_CC=$(CC) $(CFLAGS) -O $(SHLIBCFLAGS) -o $@ -c $< DO_GL_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< DO_GL_SHLIB_CPP=$(CPP) $(CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< DO_GL_SHLIB_O_CC=$(CC) $(CFLAGS) -O $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< DO_SHLIB_AS=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< ############################################################################# # SETUP AND BUILD ############################################################################# TARGETS=$(BUILDDIR)/kingpin \ $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) \ $(BUILDDIR)/ref_gl.$(SHLIBEXT) \ $(BUILDDIR)/ref_glx.$(SHLIBEXT) TARGETS_DED=$(BUILDDIR)/kpded \ $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) build_debug: @-mkdir $(BUILD_DEBUG_DIR) \ $(BUILD_DEBUG_DIR)/client \ $(BUILD_DEBUG_DIR)/ded \ $(BUILD_DEBUG_DIR)/ref_gl \ $(BUILD_DEBUG_DIR)/game $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" build_release: @-mkdir $(BUILD_RELEASE_DIR) \ $(BUILD_RELEASE_DIR)/client \ $(BUILD_RELEASE_DIR)/ded \ $(BUILD_RELEASE_DIR)/ref_gl \ $(BUILD_RELEASE_DIR)/game $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)" build_release_ded: @-mkdir $(BUILD_RELEASE_DIR) \ $(BUILD_RELEASE_DIR)/ded \ $(BUILD_RELEASE_DIR)/game $(MAKE) targets_ded BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)" all: build_debug build_release build_releas_ded egcs egcs_release: $(MAKE) build_release CC=egcs GLIBC=-glibc-egcs \ RELEASE_CFLAGS="$(BASE_CFLAGS) -mpentium -O6 -ffast-math \ -fomit-frame-pointer -fexpensive-optimizations" egcs_debug: $(MAKE) build_debug CC=egcs GLIBC=-glibc-egcs \ DEBUG_CFLAGS="$(BASE_CFLAGS) -g" targets: $(TARGETS) targets_ded: $(TARGETS_DED) ############################################################################# # CLIENT/SERVER ############################################################################# QUAKE2_OBJS = \ $(BUILDDIR)/client/cl_cin.o \ $(BUILDDIR)/client/cl_ents.o \ $(BUILDDIR)/client/cl_fx.o \ $(BUILDDIR)/client/cl_input.o \ $(BUILDDIR)/client/cl_inv.o \ $(BUILDDIR)/client/cl_main.o \ $(BUILDDIR)/client/cl_parse.o \ $(BUILDDIR)/client/cl_pred.o \ $(BUILDDIR)/client/cl_tent.o \ $(BUILDDIR)/client/cl_scrn.o \ $(BUILDDIR)/client/cl_view.o \ $(BUILDDIR)/client/console.o \ $(BUILDDIR)/client/keys.o \ $(BUILDDIR)/client/menu.o \ $(BUILDDIR)/client/snd_dma.o \ $(BUILDDIR)/client/snd_mem.o \ $(BUILDDIR)/client/snd_mix.o \ $(BUILDDIR)/client/qmenu.o \ \ $(BUILDDIR)/client/cmd.o \ $(BUILDDIR)/client/cmodel.o \ $(BUILDDIR)/client/common.o \ $(BUILDDIR)/client/cvar.o \ $(BUILDDIR)/client/files.o \ $(BUILDDIR)/client/md4.o \ $(BUILDDIR)/client/net_chan.o \ \ $(BUILDDIR)/client/sv_ccmds.o \ $(BUILDDIR)/client/sv_ents.o \ $(BUILDDIR)/client/sv_game.o \ $(BUILDDIR)/client/sv_init.o \ $(BUILDDIR)/client/sv_main.o \ $(BUILDDIR)/client/sv_send.o \ $(BUILDDIR)/client/sv_user.o \ $(BUILDDIR)/client/sv_world.o \ \ $(BUILDDIR)/client/cd_linux.o \ $(BUILDDIR)/client/q_shlinux.o \ $(BUILDDIR)/client/vid_menu.o \ $(BUILDDIR)/client/vid_so.o \ $(BUILDDIR)/client/snd_linux.o \ $(BUILDDIR)/client/sys_linux.o \ $(BUILDDIR)/client/glob.o \ $(BUILDDIR)/client/net_udp.o \ \ $(BUILDDIR)/client/q_shared.o \ $(BUILDDIR)/client/pmove.o \ \ $(BUILDDIR)/client/goautil.o \ $(BUILDDIR)/client/nonport.o \ \ $(BUILDDIR)/client/crc.o ifeq ($(ARCH),axp) QUAKE2_AS_OBJS = #blank else QUAKE2_AS_OBJS = \ $(BUILDDIR)/client/snd_mixa.o endif $(BUILDDIR)/kingpin : $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(CC) $(CFLAGS) -o $@ $(QUAKE2_OBJS) $(QUAKE2_AS_OBJS) $(LDFLAGS) $(BUILDDIR)/client/cl_cin.o : $(CLIENT_DIR)/cl_cin.c $(DO_CC) $(BUILDDIR)/client/cl_ents.o : $(CLIENT_DIR)/cl_ents.c $(DO_CC) $(BUILDDIR)/client/cl_fx.o : $(CLIENT_DIR)/cl_fx.c $(DO_CC) $(BUILDDIR)/client/cl_input.o : $(CLIENT_DIR)/cl_input.c $(DO_CC) $(BUILDDIR)/client/cl_inv.o : $(CLIENT_DIR)/cl_inv.c $(DO_CC) $(BUILDDIR)/client/cl_main.o : $(CLIENT_DIR)/cl_main.c $(DO_CC) $(BUILDDIR)/client/cl_parse.o : $(CLIENT_DIR)/cl_parse.c $(DO_CC) $(BUILDDIR)/client/cl_pred.o : $(CLIENT_DIR)/cl_pred.c $(DO_CC) $(BUILDDIR)/client/cl_tent.o : $(CLIENT_DIR)/cl_tent.c $(DO_CC) $(BUILDDIR)/client/cl_scrn.o : $(CLIENT_DIR)/cl_scrn.c $(DO_CC) $(BUILDDIR)/client/cl_view.o : $(CLIENT_DIR)/cl_view.c $(DO_CC) $(BUILDDIR)/client/console.o : $(CLIENT_DIR)/console.c $(DO_CC) $(BUILDDIR)/client/keys.o : $(CLIENT_DIR)/keys.c $(DO_CC) $(BUILDDIR)/client/menu.o : $(CLIENT_DIR)/menu.c $(DO_CC) $(BUILDDIR)/client/snd_dma.o : $(CLIENT_DIR)/snd_dma.c $(DO_CC) $(BUILDDIR)/client/snd_mem.o : $(CLIENT_DIR)/snd_mem.c $(DO_CC) $(BUILDDIR)/client/snd_mix.o : $(CLIENT_DIR)/snd_mix.c $(DO_CC) $(BUILDDIR)/client/qmenu.o : $(CLIENT_DIR)/qmenu.c $(DO_CC) $(BUILDDIR)/client/cmd.o : $(COMMON_DIR)/cmd.c $(DO_CC) $(BUILDDIR)/client/cmodel.o : $(COMMON_DIR)/cmodel.c $(DO_CC) $(BUILDDIR)/client/common.o : $(COMMON_DIR)/common.c $(DO_CC) $(BUILDDIR)/client/crc.o : $(COMMON_DIR)/crc.c $(DO_CC) $(BUILDDIR)/client/cvar.o : $(COMMON_DIR)/cvar.c $(DO_CC) $(BUILDDIR)/client/files.o : $(COMMON_DIR)/files.c $(DO_CC) $(BUILDDIR)/client/md4.o : $(COMMON_DIR)/md4.c $(DO_CC) $(BUILDDIR)/client/net_chan.o : $(COMMON_DIR)/net_chan.c $(DO_CC) $(BUILDDIR)/client/q_shared.o : $(GAME_DIR)/q_shared.c $(CC) $(DEBUG_CFLAGS) -o $@ -c $< $(BUILDDIR)/client/pmove.o : $(COMMON_DIR)/pmove.c $(DO_CC) $(BUILDDIR)/client/sv_ccmds.o : $(SERVER_DIR)/sv_ccmds.c $(DO_CC) $(BUILDDIR)/client/sv_ents.o : $(SERVER_DIR)/sv_ents.c $(DO_CC) $(BUILDDIR)/client/sv_game.o : $(SERVER_DIR)/sv_game.c $(DO_CC) $(BUILDDIR)/client/sv_init.o : $(SERVER_DIR)/sv_init.c $(DO_CC) $(BUILDDIR)/client/sv_main.o : $(SERVER_DIR)/sv_main.c $(DO_CC) $(BUILDDIR)/client/sv_send.o : $(SERVER_DIR)/sv_send.c $(DO_CC) $(BUILDDIR)/client/sv_user.o : $(SERVER_DIR)/sv_user.c $(DO_CC) $(BUILDDIR)/client/sv_world.o : $(SERVER_DIR)/sv_world.c $(DO_CC) $(BUILDDIR)/client/cd_linux.o : $(LINUX_DIR)/cd_linux.c $(DO_CC) $(BUILDDIR)/client/q_shlinux.o : $(LINUX_DIR)/q_shlinux.c $(DO_O_CC) $(BUILDDIR)/client/vid_menu.o : $(LINUX_DIR)/vid_menu.c $(DO_CC) $(BUILDDIR)/client/vid_so.o : $(LINUX_DIR)/vid_so.c $(DO_CC) $(BUILDDIR)/client/snd_linux.o : $(LINUX_DIR)/snd_linux.c $(DO_CC) $(BUILDDIR)/client/snd_mixa.o : $(LINUX_DIR)/snd_mixa.s $(DO_AS) $(BUILDDIR)/client/sys_linux.o : $(LINUX_DIR)/sys_linux.c $(DO_CC) $(BUILDDIR)/client/glob.o : $(LINUX_DIR)/glob.c $(DO_CC) $(BUILDDIR)/client/net_udp.o : $(LINUX_DIR)/net_udp.c $(DO_CC) $(BUILDDIR)/client/goautil.o : $(SERVER_DIR)/goautil.c $(DO_CC) $(BUILDDIR)/client/nonport.o : $(SERVER_DIR)/nonport.c $(DO_CC) ############################################################################# # DEDICATED SERVER ############################################################################# Q2DED_OBJS = \ \ $(BUILDDIR)/ded/cmd.o \ $(BUILDDIR)/ded/cmodel.o \ $(BUILDDIR)/ded/common.o \ $(BUILDDIR)/ded/cvar.o \ $(BUILDDIR)/ded/files.o \ $(BUILDDIR)/ded/md4.o \ $(BUILDDIR)/ded/net_chan.o \ \ $(BUILDDIR)/ded/sv_ccmds.o \ $(BUILDDIR)/ded/sv_ents.o \ $(BUILDDIR)/ded/sv_game.o \ $(BUILDDIR)/ded/sv_init.o \ $(BUILDDIR)/ded/sv_main.o \ $(BUILDDIR)/ded/sv_send.o \ $(BUILDDIR)/ded/sv_user.o \ $(BUILDDIR)/ded/sv_world.o \ \ $(BUILDDIR)/ded/q_shlinux.o \ $(BUILDDIR)/ded/sys_linux.o \ $(BUILDDIR)/ded/glob.o \ $(BUILDDIR)/ded/net_udp.o \ \ $(BUILDDIR)/ded/q_shared.o \ $(BUILDDIR)/ded/pmove.o \ \ $(BUILDDIR)/ded/cl_null.o \ $(BUILDDIR)/ded/cd_null.o \ \ $(BUILDDIR)/ded/goautil.o \ $(BUILDDIR)/ded/nonport.o \ \ $(BUILDDIR)/ded/crc.o $(BUILDDIR)/kpded : $(Q2DED_OBJS) $(CC) $(CFLAGS) -o $@ $(Q2DED_OBJS) $(LDFLAGS) $(BUILDDIR)/ded/cmd.o : $(COMMON_DIR)/cmd.c $(DO_DED_CC) $(BUILDDIR)/ded/cmodel.o : $(COMMON_DIR)/cmodel.c $(DO_DED_CC) $(BUILDDIR)/ded/common.o : $(COMMON_DIR)/common.c $(DO_DED_CC) $(BUILDDIR)/ded/cvar.o : $(COMMON_DIR)/cvar.c $(DO_DED_CC) $(BUILDDIR)/ded/files.o : $(COMMON_DIR)/files.c $(DO_DED_CC) $(BUILDDIR)/ded/md4.o : $(COMMON_DIR)/md4.c $(DO_DED_CC) $(BUILDDIR)/ded/net_chan.o : $(COMMON_DIR)/net_chan.c $(DO_DED_CC) $(BUILDDIR)/ded/q_shared.o : $(GAME_DIR)/q_shared.c $(DO_DED_CC) $(BUILDDIR)/ded/pmove.o : $(COMMON_DIR)/pmove.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_ccmds.o : $(SERVER_DIR)/sv_ccmds.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_ents.o : $(SERVER_DIR)/sv_ents.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_game.o : $(SERVER_DIR)/sv_game.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_init.o : $(SERVER_DIR)/sv_init.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_main.o : $(SERVER_DIR)/sv_main.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_send.o : $(SERVER_DIR)/sv_send.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_user.o : $(SERVER_DIR)/sv_user.c $(DO_DED_CC) $(BUILDDIR)/ded/sv_world.o : $(SERVER_DIR)/sv_world.c $(DO_DED_CC) $(BUILDDIR)/ded/q_shlinux.o : $(LINUX_DIR)/q_shlinux.c $(DO_DED_CC) $(BUILDDIR)/ded/sys_linux.o : $(LINUX_DIR)/sys_linux.c $(DO_DED_CC) $(BUILDDIR)/ded/glob.o : $(LINUX_DIR)/glob.c $(DO_DED_CC) $(BUILDDIR)/ded/net_udp.o : $(LINUX_DIR)/net_udp.c $(DO_DED_CC) $(BUILDDIR)/ded/cd_null.o : $(NULL_DIR)/cd_null.c $(DO_DED_CC) $(BUILDDIR)/ded/cl_null.o : $(NULL_DIR)/cl_null.c $(DO_DED_CC) $(BUILDDIR)/ded/goautil.o : $(SERVER_DIR)/goautil.c $(DO_DED_CC) $(BUILDDIR)/ded/nonport.o : $(SERVER_DIR)/nonport.c $(DO_DED_CC) $(BUILDDIR)/ded/crc.o : $(COMMON_DIR)/crc.c $(DO_DED_CC) ############################################################################# # GAME ############################################################################# GAME_OBJS = \ $(BUILDDIR)/game/ai_bitch.o \ $(BUILDDIR)/game/ai_bum_sit.o \ $(BUILDDIR)/game/ai_dog.o \ $(BUILDDIR)/game/ai_punk.o \ $(BUILDDIR)/game/ai_runt.o \ $(BUILDDIR)/game/ai_shorty.o \ $(BUILDDIR)/game/ai_skinny.o \ $(BUILDDIR)/game/ai_thug.o \ $(BUILDDIR)/game/ai_thug_sit.o \ $(BUILDDIR)/game/ai_whore.o \ $(BUILDDIR)/game/ep_all.o \ $(BUILDDIR)/game/ep_crystalpalace.o \ $(BUILDDIR)/game/ep_log.o \ $(BUILDDIR)/game/ep_posionville.o \ $(BUILDDIR)/game/ep_radiocity.o \ $(BUILDDIR)/game/ep_shipyards.o \ $(BUILDDIR)/game/ep_skidrow.o \ $(BUILDDIR)/game/ep_steeltown.o \ $(BUILDDIR)/game/ep_trainyard.o \ $(BUILDDIR)/game/g_ai.o \ $(BUILDDIR)/game/g_ai_ents.o \ $(BUILDDIR)/game/g_ai_fight.o \ $(BUILDDIR)/game/g_ai_memory.o \ $(BUILDDIR)/game/g_cast.o \ $(BUILDDIR)/game/g_chase.o \ $(BUILDDIR)/game/g_cmds.o \ $(BUILDDIR)/game/g_combat.o \ $(BUILDDIR)/game/g_fog.o \ $(BUILDDIR)/game/g_func.o \ $(BUILDDIR)/game/g_items.o \ $(BUILDDIR)/game/g_joe_misc.o \ $(BUILDDIR)/game/g_main.o \ $(BUILDDIR)/game/g_misc.o \ $(BUILDDIR)/game/g_nav.o \ $(BUILDDIR)/game/g_nav_cells.o \ $(BUILDDIR)/game/g_nav_io.o \ $(BUILDDIR)/game/g_nav_misc.o \ $(BUILDDIR)/game/g_pawn.o \ $(BUILDDIR)/game/g_phys.o \ $(BUILDDIR)/game/g_save.o \ $(BUILDDIR)/game/g_spawn.o \ $(BUILDDIR)/game/g_svcmds.o \ $(BUILDDIR)/game/g_target.o \ $(BUILDDIR)/game/g_teamplay.o \ $(BUILDDIR)/game/g_trigger.o \ $(BUILDDIR)/game/g_utils.o \ $(BUILDDIR)/game/g_weapon.o \ $(BUILDDIR)/game/lateral.o \ $(BUILDDIR)/game/m_bbox.o \ $(BUILDDIR)/game/m_flash.o \ $(BUILDDIR)/game/m_move.o \ $(BUILDDIR)/game/p_client.o \ $(BUILDDIR)/game/p_hud.o \ $(BUILDDIR)/game/p_trail.o \ $(BUILDDIR)/game/p_view.o \ $(BUILDDIR)/game/p_weapon.o \ $(BUILDDIR)/game/q_shared.o \ $(BUILDDIR)/game/vehicles.o \ $(BUILDDIR)/game/voice.o \ $(BUILDDIR)/game/voice_bitch.o \ $(BUILDDIR)/game/voice_punk.o # $(BUILDDIR)/game/g_so.o $(BUILDDIR)/game$(ARCH).$(SHLIBEXT) : $(GAME_OBJS) $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(GAME_OBJS) $(BUILDDIR)/game/ai_bitch.o : $(GAME_DIR)/ai_bitch.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_bum_sit.o : $(GAME_DIR)/ai_bum_sit.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_dog.o : $(GAME_DIR)/ai_dog.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_punk.o : $(GAME_DIR)/ai_punk.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_runt.o : $(GAME_DIR)/ai_runt.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_shorty.o : $(GAME_DIR)/ai_shorty.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_skinny.o : $(GAME_DIR)/ai_skinny.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_thug.o : $(GAME_DIR)/ai_thug.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_thug_sit.o : $(GAME_DIR)/ai_thug_sit.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ai_whore.o : $(GAME_DIR)/ai_whore.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_all.o : $(GAME_DIR)/ep_all.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_crystalpalace.o : $(GAME_DIR)/ep_crystalpalace.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_log.o : $(GAME_DIR)/ep_log.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_posionville.o : $(GAME_DIR)/ep_posionville.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_radiocity.o : $(GAME_DIR)/ep_radiocity.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_shipyards.o : $(GAME_DIR)/ep_shipyards.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_skidrow.o : $(GAME_DIR)/ep_skidrow.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_steeltown.o : $(GAME_DIR)/ep_steeltown.c $(DO_SHLIB_CC) $(BUILDDIR)/game/ep_trainyard.o : $(GAME_DIR)/ep_trainyard.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_ai.o : $(GAME_DIR)/g_ai.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_ai_ents.o : $(GAME_DIR)/g_ai_ents.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_ai_fight.o : $(GAME_DIR)/g_ai_fight.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_ai_memory.o : $(GAME_DIR)/g_ai_memory.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_cast.o : $(GAME_DIR)/g_cast.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_cmds.o : $(GAME_DIR)/g_cmds.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_chase.o : $(GAME_DIR)/g_chase.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_combat.o : $(GAME_DIR)/g_combat.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_fog.o : $(GAME_DIR)/g_fog.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_func.o : $(GAME_DIR)/g_func.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_items.o : $(GAME_DIR)/g_items.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_joe_misc.o : $(GAME_DIR)/g_joe_misc.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_main.o : $(GAME_DIR)/g_main.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_misc.o : $(GAME_DIR)/g_misc.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_nav.o : $(GAME_DIR)/g_nav.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_nav_cells.o : $(GAME_DIR)/g_nav_cells.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_nav_io.o : $(GAME_DIR)/g_nav_io.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_nav_misc.o : $(GAME_DIR)/g_nav_misc.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_pawn.o : $(GAME_DIR)/g_pawn.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_phys.o : $(GAME_DIR)/g_phys.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_save.o : $(GAME_DIR)/g_save.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_spawn.o : $(GAME_DIR)/g_spawn.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_svcmds.o : $(GAME_DIR)/g_svcmds.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_target.o : $(GAME_DIR)/g_target.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_teamplay.o : $(GAME_DIR)/g_teamplay.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_trigger.o : $(GAME_DIR)/g_trigger.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_utils.o : $(GAME_DIR)/g_utils.c $(DO_SHLIB_CC) $(BUILDDIR)/game/g_weapon.o : $(GAME_DIR)/g_weapon.c $(DO_SHLIB_CC) $(BUILDDIR)/game/lateral.o : $(GAME_DIR)/lateral.c $(DO_SHLIB_CC) $(BUILDDIR)/game/m_bbox.o : $(GAME_DIR)/m_bbox.c $(DO_SHLIB_CC) $(BUILDDIR)/game/m_flash.o : $(GAME_DIR)/m_flash.c $(DO_SHLIB_CC) $(BUILDDIR)/game/m_move.o : $(GAME_DIR)/m_move.c $(DO_SHLIB_CC) $(BUILDDIR)/game/p_client.o : $(GAME_DIR)/p_client.c $(DO_SHLIB_CC) $(BUILDDIR)/game/p_hud.o : $(GAME_DIR)/p_hud.c $(DO_SHLIB_CC) $(BUILDDIR)/game/p_trail.o : $(GAME_DIR)/p_trail.c $(DO_SHLIB_CC) $(BUILDDIR)/game/p_view.o : $(GAME_DIR)/p_view.c $(DO_SHLIB_CC) $(BUILDDIR)/game/p_weapon.o : $(GAME_DIR)/p_weapon.c $(DO_SHLIB_CC) $(BUILDDIR)/game/q_shared.o : $(GAME_DIR)/q_shared.c $(CC) $(DEBUG_CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< $(BUILDDIR)/game/vehicles.o : $(GAME_DIR)/vehicles.c $(DO_SHLIB_CC) $(BUILDDIR)/game/voice.o : $(GAME_DIR)/voice.c $(DO_SHLIB_CC) $(BUILDDIR)/game/voice_bitch.o : $(GAME_DIR)/voice_bitch.c $(DO_SHLIB_CC) $(BUILDDIR)/game/voice_punk.o : $(GAME_DIR)/voice_punk.c $(DO_SHLIB_CC) ############################################################################# # REF_GL ############################################################################# REF_GL_OBJS = \ $(BUILDDIR)/ref_gl/gl_draw.o \ $(BUILDDIR)/ref_gl/gl_image.o \ $(BUILDDIR)/ref_gl/gl_light.o \ $(BUILDDIR)/ref_gl/gl_mesh.o \ $(BUILDDIR)/ref_gl/gl_model.o \ $(BUILDDIR)/ref_gl/gl_rmain.o \ $(BUILDDIR)/ref_gl/gl_rmisc.o \ $(BUILDDIR)/ref_gl/gl_rsurf.o \ $(BUILDDIR)/ref_gl/gl_warp.o \ \ $(BUILDDIR)/ref_gl/qgl_linux.o \ $(BUILDDIR)/ref_gl/q_shared.o \ $(BUILDDIR)/ref_gl/q_shlinux.o \ $(BUILDDIR)/ref_gl/glob.o \ $(BUILDDIR)/ref_gl/xatrixtxrmap.o REF_GL_FXMESA_OBJS = \ $(BUILDDIR)/ref_gl/gl_fxmesa.o \ $(BUILDDIR)/ref_gl/rw_in_svgalib.o REF_GL_GLX_OBJS = \ $(BUILDDIR)/ref_gl/gl_glx.o $(BUILDDIR)/ref_gl.$(SHLIBEXT) : $(REF_GL_OBJS) $(REF_GL_FXMESA_OBJS) $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_GL_OBJS) $(REF_GL_FXMESA_OBJS) $(GLLDFLAGS) $(BUILDDIR)/ref_glx.$(SHLIBEXT) : $(REF_GL_OBJS) $(REF_GL_GLX_OBJS) $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(REF_GL_OBJS) $(REF_GL_GLX_OBJS) $(GLXLDFLAGS) $(BUILDDIR)/ref_gl/gl_draw.o : $(REF_GL_DIR)/gl_draw.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_image.o : $(REF_GL_DIR)/gl_image.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_light.o : $(REF_GL_DIR)/gl_light.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_mesh.o : $(REF_GL_DIR)/gl_mesh.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_model.o : $(REF_GL_DIR)/gl_model.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_rmain.o : $(REF_GL_DIR)/gl_rmain.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_rmisc.o : $(REF_GL_DIR)/gl_rmisc.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_rsurf.o : $(REF_GL_DIR)/gl_rsurf.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_warp.o : $(REF_GL_DIR)/gl_warp.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/qgl_linux.o : $(LINUX_DIR)/qgl_linux.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_fxmesa.o : $(LINUX_DIR)/gl_fxmesa.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/gl_glx.o : $(LINUX_DIR)/gl_glx.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/rw_in_svgalib.o : $(LINUX_DIR)/rw_in_svgalib.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/q_shared.o : $(GAME_DIR)/q_shared.c $(CC) $(DEBUG_CFLAGS) $(SHLIBCFLAGS) $(GLCFLAGS) -o $@ -c $< $(BUILDDIR)/ref_gl/q_shlinux.o : $(LINUX_DIR)/q_shlinux.c $(DO_GL_SHLIB_O_CC) $(BUILDDIR)/ref_gl/glob.o : $(LINUX_DIR)/glob.c $(DO_GL_SHLIB_CC) $(BUILDDIR)/ref_gl/xatrixtxrmap.o : $(REF_GL_DIR)/xatrixtxrmap.cpp $(DO_GL_SHLIB_CPP) ############################################################################# # RPM ############################################################################# # Make RPMs. You need to be root to make this work RPMROOT=/usr/src/RPM RPM = rpm RPMFLAGS = -bb INSTALLDIR = /usr/local/games/kingpin QUAKE2_DIR = /usr/local/games/quake2 DESTDIR= $(RPMDIR)/$(INSTALLDIR) RPMDIR = /var/tmp/kingpin-$(VERSION_FN) rpm: kingpin.spec # touch $(RPMROOT)/SOURCES/kingpin-$(VERSION_FN).tar.gz if [ ! -d archives ];then mkdir archives;fi $(MAKE) copyfiles COPYDIR=$(DESTDIR) cd $(MOUNT_DIR) -mkdir $(RPMDIR)/etc cp $(MOUNT_DIR)/linux/kingpin.conf $(RPMDIR)/etc/kingpin.conf cp kingpin.spec $(RPMROOT)/SPECS/. cd $(RPMROOT)/SPECS/.; $(RPM) $(RPMFLAGS) kingpin.spec rm -rf $(RPMDIR) mv $(RPMROOT)/RPMS/$(ARCH)/kingpin-$(VERSION_FN)-$(RPM_RELEASE).$(RPMARCH).rpm /pub tar: if [ ! -d archives ];then mkdir archives;fi $(MAKE) copyfiles COPYDIR=$(RPMDIR) cp $(MOUNT_DIR)/linux/kingpin.conf $(RPMDIR)/kingpin.conf cd $(RPMDIR); sh $(MOUNT_DIR)/linux/fixperms.sh cd $(RPMDIR); tar czvf kingpin-$(VERSION_FN)-$(ARCH)-linux2.0.tar.gz * mv $(RPMDIR)/*.tar.gz /pub rm -rf $(RPMDIR) copyfiles: -mkdirhier $(COPYDIR) cp $(BUILD_RELEASE_DIR)/kingpin $(COPYDIR)/kingpin strip $(COPYDIR)/kingpin -mkdir $(COPYDIR)/main -mkdir $(COPYDIR)/main/maps for x in `find $(COPYDIR)/main -type d`; do chmod 755 $$x;done for x in `find $(COPYDIR)/main -type f`; do chmod 644 $$x;done chmod 1777 $(COPYDIR)/main chmod 1777 $(COPYDIR)/main/maps # Swap these over when debugging process is complete # cp $(BUILD_DEBUG_DIR)/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/main cp $(BUILD_RELEASE_DIR)/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/main cp $(BUILD_RELEASE_DIR)/ref_gl.$(SHLIBEXT) $(COPYDIR) cp $(BUILD_RELEASE_DIR)/ref_glx.$(SHLIBEXT) $(COPYDIR) cp $(QUAKE2_DIR)/lib3dfxgl.so $(COPYDIR) cp $(QUAKE2_DIR)/libTNTgl.so $(COPYDIR) cp $(QUAKE2_DIR)/libMesaGL.so.2.6 $(COPYDIR) cd $(COPYDIR); ln -sf libMesaGL.so.2.6 libMesaGL.so.2 cd $(COPYDIR); ln -sf libMesaGL.so.2 libMesaGL.so cd $(COPYDIR); ln -sf libMesaGL.so libGL.so cp $(MOUNT_DIR)/linux/README $(COPYDIR) cp ccase $(COPYDIR)/main cp $(MOUNT_DIR)/../patch12.txt $(COPYDIR) cp $(MOUNT_DIR)/../main/server.cfg $(COPYDIR)/main cp $(MOUNT_DIR)/../main/teammaps.lst $(COPYDIR)/main cp $(MOUNT_DIR)/../main/maps/team_rival.bsp $(COPYDIR)/main/maps cp $(MOUNT_DIR)/../main/maps/team_towers.bsp $(COPYDIR)/main/maps kingpin.spec : $(MOUNT_DIR)/linux/kingpin.spec.sh makefile sh $< $(VERSION_FN) $(RPM_RELEASE) $(ARCH) $(INSTALLDIR) > $@ tar_ded: if [ ! -d archives ];then mkdir archives;fi $(MAKE) copyfiles_ded COPYDIR=$(RPMDIR) cp $(MOUNT_DIR)/linux/kingpin.conf $(RPMDIR)/kingpin.conf cd $(RPMDIR); sh $(MOUNT_DIR)/linux/fixperms.sh cd $(RPMDIR); tar czvf kpded-$(VERSION_FN)-$(ARCH)-linux2.0.tar.gz * mv $(RPMDIR)/*.tar.gz /pub rm -rf $(RPMDIR) copyfiles_ded: -mkdirhier $(COPYDIR) cp $(BUILD_RELEASE_DIR)/kingpin $(COPYDIR)/kingpin strip $(COPYDIR)/kingpin -mkdir $(COPYDIR)/main -mkdir $(COPYDIR)/main/maps for x in `find $(COPYDIR)/main -type d`; do chmod 755 $$x;done for x in `find $(COPYDIR)/main -type f`; do chmod 644 $$x;done chmod 1777 $(COPYDIR)/main chmod 1777 $(COPYDIR)/main/maps # Swap these over when debugging process is complete cp $(BUILD_DEBUG_DIR)/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/main # cp $(BUILD_RELEASE_DIR)/game$(ARCH).$(SHLIBEXT) $(COPYDIR)/main cp $(MOUNT_DIR)/linux/README $(COPYDIR) cp ccase $(COPYDIR)/main cp $(MOUNT_DIR)/../patch12.txt $(COPYDIR) cp $(MOUNT_DIR)/../main/server.cfg $(COPYDIR)/main cp $(MOUNT_DIR)/../main/teammaps.lst $(COPYDIR)/main cp $(MOUNT_DIR)/../main/maps/team_rival.bsp $(COPYDIR)/main/maps cp $(MOUNT_DIR)/../main/maps/team_towers.bsp $(COPYDIR)/main/maps ############################################################################# # MISC ############################################################################# clean: clean-debug clean-release clean-debug: $(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)" clean-release: $(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)" clean2: -rm -f \ $(QUAKE2_OBJS) \ $(Q2DED_OBJS) \ $(QUAKE2_AS_OBJS) \ $(GAME_OBJS) \ $(CTF_OBJS) \ $(XATRIX_OBJS) \ $(ROGUE_OBJS) \ $(REF_SOFT_OBJS) \ $(REF_SOFT_SVGA_OBJS) \ $(REF_SOFT_X11_OBJS) \ $(REF_GL_OBJS) \ $(REF_GL_FXMESA_OBJS) \ $(REF_GL_GLX_OBJS)