From ffbf946dd63dccf0d6b6553c8bc1c9da4d3c89b3 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Sun, 15 Jul 2007 14:15:41 +0000 Subject: * Merge of ioq3-r1112 --- Makefile | 440 +++++++++++++++++++++------------------------------------------ 1 file changed, 143 insertions(+), 297 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1ef730c9..5e12bf23 100644 --- a/Makefile +++ b/Makefile @@ -162,8 +162,6 @@ endif ############################################################################# ## Defaults -VM_PPC= - LIB=lib INSTALL=install @@ -171,8 +169,6 @@ MKDIR=mkdir ifeq ($(PLATFORM),linux) - CC=gcc - ifeq ($(ARCH),alpha) ARCH=axp else @@ -197,7 +193,7 @@ ifeq ($(PLATFORM),linux) BASE_CFLAGS += -DUSE_OPENAL_DLOPEN=1 endif endif - + ifeq ($(USE_CURL),1) BASE_CFLAGS += -DUSE_CURL=1 ifeq ($(USE_CURL_DLOPEN),1) @@ -211,9 +207,8 @@ ifeq ($(PLATFORM),linux) ifeq ($(USE_SDL),1) BASE_CFLAGS += -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1 $(shell sdl-config --cflags) - GL_CFLAGS = else - GL_CFLAGS = -I/usr/X11R6/include + BASE_CFLAGS += -I/usr/X11R6/include endif OPTIMIZE = -O3 -ffast-math -funroll-loops -fomit-frame-pointer @@ -233,9 +228,7 @@ ifeq ($(PLATFORM),linux) else ifeq ($(ARCH),ppc) BASE_CFLAGS += -maltivec - ifneq ($(VM_PPC),) - HAVE_VM_COMPILED=true - endif + HAVE_VM_COMPILED=false endif endif endif @@ -266,7 +259,7 @@ ifeq ($(PLATFORM),linux) CLIENT_LDFLAGS += -lopenal endif endif - + ifeq ($(USE_CURL),1) ifneq ($(USE_CURL_DLOPEN),1) CLIENT_LDFLAGS += -lcurl @@ -290,8 +283,6 @@ else # ifeq Linux ############################################################################# ifeq ($(PLATFORM),darwin) - CC=gcc - VM_PPC=vm_ppc_new HAVE_VM_COMPILED=true BASE_CFLAGS= CLIENT_LDFLAGS= @@ -371,7 +362,7 @@ ifeq ($(PLATFORM),darwin) BASE_CFLAGS += -DUSE_OPENAL_DLOPEN=1 endif endif - + ifeq ($(USE_CURL),1) BASE_CFLAGS += -DUSE_CURL=1 ifneq ($(USE_CURL_DLOPEN),1) @@ -389,12 +380,11 @@ ifeq ($(PLATFORM),darwin) ifeq ($(USE_SDL),1) BASE_CFLAGS += -DUSE_SDL_VIDEO=1 -DUSE_SDL_SOUND=1 -D_THREAD_SAFE=1 \ -I$(SDLHDIR)/include - GL_CFLAGS = # We copy sdlmain before ranlib'ing it so that subversion doesn't think # the file has been modified by each build. LIBSDLMAIN=$(B)/libSDLmain.a LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDLmain.a - CLIENT_LDFLAGS += -framework Cocoa -framework OpenGL \ + CLIENT_LDFLAGS += -framework Cocoa -framework IOKit -framework OpenGL \ $(LIBSDIR)/macosx/libSDL-1.2.0.dylib else # !!! FIXME: frameworks: OpenGL, Carbon, etc... @@ -426,8 +416,9 @@ else # ifeq darwin ifeq ($(PLATFORM),mingw32) - CC=gcc - WINDRES=windres +ifndef WINDRES +WINDRES=windres +endif ARCH=x86 @@ -436,7 +427,7 @@ ifeq ($(PLATFORM),mingw32) ifeq ($(USE_OPENAL),1) BASE_CFLAGS += -DUSE_OPENAL=1 -DUSE_OPENAL_DLOPEN=1 endif - + ifeq ($(USE_CURL),1) BASE_CFLAGS += -DUSE_CURL=1 ifneq ($(USE_CURL_DLOPEN),1) @@ -448,9 +439,6 @@ ifeq ($(PLATFORM),mingw32) BASE_CFLAGS += -DUSE_CODEC_VORBIS=1 endif - GL_CFLAGS = - MINGW_CFLAGS = -DDONT_TYPEDEF_INT32 - OPTIMIZE = -O3 -march=i586 -fomit-frame-pointer -ffast-math -falign-loops=2 \ -funroll-loops -falign-jumps=2 -falign-functions=2 -fstrength-reduce @@ -503,9 +491,8 @@ ifeq ($(PLATFORM),freebsd) endif #alpha test - BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes - - GL_CFLAGS = -I/usr/X11R6/include + BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ + -I/usr/X11R6/include DEBUG_CFLAGS=$(BASE_CFLAGS) -g @@ -525,13 +512,11 @@ ifeq ($(PLATFORM),freebsd) endif ifeq ($(ARCH),axp) - CC=gcc BASE_CFLAGS += -DNO_VM_COMPILED RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -ffast-math -funroll-loops \ -fomit-frame-pointer -fexpensive-optimizations else ifeq ($(ARCH),x86) - CC=gcc RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 -mtune=pentiumpro \ -march=pentium -fomit-frame-pointer -pipe -ffast-math \ -falign-loops=2 -falign-jumps=2 -falign-functions=2 \ @@ -581,7 +566,6 @@ ifeq ($(PLATFORM),netbsd) ARCH=x86 endif - CC=gcc LDFLAGS=-lm SHLIBEXT=so SHLIBCFLAGS=-fPIC @@ -608,7 +592,6 @@ ifeq ($(PLATFORM),irix) ARCH=mips #default to MIPS - CC=cc BASE_CFLAGS=-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 -mips3 \ -nostdinc -I. -I$(ROOT)/usr/include -DNO_VM_COMPILED RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 @@ -629,7 +612,6 @@ else # ifeq IRIX ifeq ($(PLATFORM),sunos) - CC=gcc INSTALL=ginstall MKDIR=gmkdir COPYDIR="/usr/local/share/games/tremulous" @@ -651,9 +633,8 @@ ifeq ($(PLATFORM),sunos) ifeq ($(USE_SDL),1) BASE_CFLAGS += -DUSE_SDL_SOUND=1 $(shell sdl-config --cflags) - GL_CFLAGS = else - GL_CFLAGS = -I/usr/openwin/include + BASE_CFLAGS += -I/usr/openwin/include endif OPTIMIZE = -O3 -ffast-math -funroll-loops @@ -670,8 +651,8 @@ ifeq ($(PLATFORM),sunos) -falign-functions=2 -fstrength-reduce HAVE_VM_COMPILED=true BASE_CFLAGS += -m32 - LDFLAGS+=-m32 - GL_CFLAGS+= -I/usr/X11/include/NVIDIA + LDFLAGS += -m32 + BASE_CFLAGS += -I/usr/X11/include/NVIDIA endif endif @@ -703,7 +684,6 @@ else # ifeq sunos ############################################################################# # SETUP AND BUILD -- GENERIC ############################################################################# - CC=cc BASE_CFLAGS=-DNO_VM_COMPILED DEBUG_CFLAGS=$(BASE_CFLAGS) -g RELEASE_CFLAGS=$(BASE_CFLAGS) -DNDEBUG -O3 @@ -763,50 +743,53 @@ ifeq ($(USE_LOCAL_HEADERS),1) endif ifeq ($(GENERATE_DEPENDENCIES),1) - ifeq ($(CC),gcc) - DEPEND_CFLAGS=-MMD - endif + DEPEND_CFLAGS=-MMD endif ifeq ($(USE_SVN),1) BASE_CFLAGS += -DSVN_VERSION=\\\"$(SVN_VERSION)\\\" endif -DO_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $< -DO_SMP_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DSMP -o $@ -c $< -DO_BOT_CC=$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) $(BOTCFLAGS) -DBOTLIB -o $@ -c $< # $(SHLIBCFLAGS) # bk001212 -DO_DEBUG_CC=$(CC) $(NOTSHLIBCFLAGS) $(DEBUG_CFLAGS) -o $@ -c $< -DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< -DO_SHLIB_DEBUG_CC=$(CC) $(DEBUG_CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< -DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< -DO_DED_CC=$(CC) $(NOTSHLIBCFLAGS) -DDEDICATED $(CFLAGS) -o $@ -c $< -DO_WINDRES=$(WINDRES) -i $< -o $@ +DO_CC = @echo "CC $<"; \ + $(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $< +DO_SMP_CC = @echo "SMP_CC $<"; \ + $(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -DSMP -o $@ -c $< +DO_BOT_CC = @echo "BOT_CC $<"; \ + $(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) $(BOTCFLAGS) -DBOTLIB -o $@ -c $< +DO_SHLIB_CC = @echo "SHLIB_CC $<"; \ + $(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $< +DO_AS = @echo "AS $<"; \ + $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $< +DO_DED_CC = @echo "DED_CC $<"; \ + $(CC) $(NOTSHLIBCFLAGS) -DDEDICATED $(CFLAGS) -o $@ -c $< +DO_WINDRES = @echo "WINDRES $<"; \ + $(WINDRES) -i $< -o $@ ############################################################################# # MAIN TARGETS ############################################################################# -default:build_release +default: build_release debug: build_debug release: build_release -build_debug: B=$(BD) -build_debug: makedirs tools - $(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS) $(DEPEND_CFLAGS)" +build_debug: tools + $(MAKE) makedirs targets B=$(BD) \ + CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS) $(DEPEND_CFLAGS)" ifeq ($(BUILD_MASTER_SERVER),1) $(MAKE) -C $(MASTERDIR) debug endif -build_release: B=$(BR) -build_release: makedirs tools - $(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS) $(DEPEND_CFLAGS)" +build_release: tools + $(MAKE) makedirs targets B=$(BR) \ + CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS) $(DEPEND_CFLAGS)" ifeq ($(BUILD_MASTER_SERVER),1) $(MAKE) -C $(MASTERDIR) release endif -#Build both debug and release builds -all:build_debug build_release +# Build both debug and release builds +all: build_debug build_release targets: $(TARGETS) @@ -814,6 +797,7 @@ makedirs: @if [ ! -d $(BUILD_DIR) ];then $(MKDIR) $(BUILD_DIR);fi @if [ ! -d $(B) ];then $(MKDIR) $(B);fi @if [ ! -d $(B)/client ];then $(MKDIR) $(B)/client;fi + @if [ ! -d $(B)/clientsmp ];then $(MKDIR) $(B)/clientsmp;fi @if [ ! -d $(B)/ded ];then $(MKDIR) $(B)/ded;fi @if [ ! -d $(B)/base ];then $(MKDIR) $(B)/base;fi @if [ ! -d $(B)/base/cgame ];then $(MKDIR) $(B)/base/cgame;fi @@ -831,14 +815,15 @@ Q3ASM=$(TOOLSDIR)/q3asm$(BINEXT) ifeq ($(CROSS_COMPILING),1) tools: - echo QVM tools not built when cross-compiling + @echo QVM tools not built when cross-compiling else tools: $(MAKE) -C $(TOOLSDIR)/lcc install $(MAKE) -C $(TOOLSDIR)/asm install endif -DO_Q3LCC=$(Q3LCC) -o $@ $< +DO_Q3LCC = @echo "Q3LCC $<"; \ + $(Q3LCC) -o $@ $< ############################################################################# # CLIENT/SERVER @@ -981,7 +966,7 @@ ifeq ($(HAVE_VM_COMPILED),true) Q3OBJ += $(B)/client/vm_x86_64.o endif ifeq ($(ARCH),ppc) - Q3OBJ += $(B)/client/$(VM_PPC).o + Q3OBJ += $(B)/client/vm_ppc.o endif endif @@ -1023,15 +1008,18 @@ else $(B)/client/sdl_glimp.o Q3POBJ_SMP = \ - $(B)/client/linux_glimp_smp.o \ - $(B)/client/sdl_glimp_smp.o + $(B)/clientsmp/linux_glimp.o \ + $(B)/clientsmp/sdl_glimp.o endif $(B)/tremulous.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ) $(LIBSDLMAIN) - $(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN) + @echo "LD $@" + @$(CC) -o $@ $(Q3OBJ) $(Q3POBJ) $(CLIENT_LDFLAGS) \ + $(LDFLAGS) $(LIBSDLMAIN) $(B)/tremulous-smp.$(ARCH)$(BINEXT): $(Q3OBJ) $(Q3POBJ_SMP) $(LIBSDLMAIN) - $(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \ + @echo "LD $@" + @$(CC) -o $@ $(Q3OBJ) $(Q3POBJ_SMP) $(CLIENT_LDFLAGS) \ $(THREAD_LDFLAGS) $(LDFLAGS) $(LIBSDLMAIN) ifneq ($(strip $(LIBSDLMAIN)),) @@ -1042,172 +1030,7 @@ $(LIBSDLMAIN) : $(LIBSDLMAINSRC) endif endif -$(B)/client/cl_cgame.o : $(CDIR)/cl_cgame.c; $(DO_CC) -$(B)/client/cl_cin.o : $(CDIR)/cl_cin.c; $(DO_CC) -$(B)/client/cl_console.o : $(CDIR)/cl_console.c; $(DO_CC) -ifeq ($(USE_SVN),1) - $(B)/client/cl_console.o : .svn/entries -endif -$(B)/client/cl_input.o : $(CDIR)/cl_input.c; $(DO_CC) -$(B)/client/cl_keys.o : $(CDIR)/cl_keys.c; $(DO_CC) -$(B)/client/cl_main.o : $(CDIR)/cl_main.c; $(DO_CC) -$(B)/client/cl_net_chan.o : $(CDIR)/cl_net_chan.c; $(DO_CC) -$(B)/client/cl_parse.o : $(CDIR)/cl_parse.c; $(DO_CC) -$(B)/client/cl_scrn.o : $(CDIR)/cl_scrn.c; $(DO_CC) -$(B)/client/cl_ui.o : $(CDIR)/cl_ui.c; $(DO_CC) -$(B)/client/cl_avi.o : $(CDIR)/cl_avi.c; $(DO_CC) -$(B)/client/snd_adpcm.o : $(CDIR)/snd_adpcm.c; $(DO_CC) -$(B)/client/snd_dma.o : $(CDIR)/snd_dma.c; $(DO_CC) -$(B)/client/snd_mem.o : $(CDIR)/snd_mem.c; $(DO_CC) -$(B)/client/snd_mix.o : $(CDIR)/snd_mix.c; $(DO_CC) -$(B)/client/snd_wavelet.o : $(CDIR)/snd_wavelet.c; $(DO_CC) - -$(B)/client/snd_main.o : $(CDIR)/snd_main.c; $(DO_CC) -$(B)/client/snd_codec.o : $(CDIR)/snd_codec.c; $(DO_CC) -$(B)/client/snd_codec_wav.o : $(CDIR)/snd_codec_wav.c; $(DO_CC) -$(B)/client/snd_codec_ogg.o : $(CDIR)/snd_codec_ogg.c; $(DO_CC) - -$(B)/client/qal.o : $(CDIR)/qal.c; $(DO_CC) -$(B)/client/snd_openal.o : $(CDIR)/snd_openal.c; $(DO_CC) - -$(B)/client/cl_curl.o : $(CDIR)/cl_curl.c; $(DO_CC) - -$(B)/client/sv_client.o : $(SDIR)/sv_client.c; $(DO_CC) -$(B)/client/sv_ccmds.o : $(SDIR)/sv_ccmds.c; $(DO_CC) -$(B)/client/sv_game.o : $(SDIR)/sv_game.c; $(DO_CC) -$(B)/client/sv_init.o : $(SDIR)/sv_init.c; $(DO_CC) -$(B)/client/sv_main.o : $(SDIR)/sv_main.c; $(DO_CC) -$(B)/client/sv_net_chan.o : $(SDIR)/sv_net_chan.c; $(DO_CC) -$(B)/client/sv_snapshot.o : $(SDIR)/sv_snapshot.c; $(DO_CC) -$(B)/client/sv_world.o : $(SDIR)/sv_world.c; $(DO_CC) -$(B)/client/cm_trace.o : $(CMDIR)/cm_trace.c; $(DO_CC) -$(B)/client/cm_load.o : $(CMDIR)/cm_load.c; $(DO_CC) -$(B)/client/cm_test.o : $(CMDIR)/cm_test.c; $(DO_CC) -$(B)/client/cm_patch.o : $(CMDIR)/cm_patch.c; $(DO_CC) -$(B)/client/cm_polylib.o : $(CMDIR)/cm_polylib.c; $(DO_CC) -$(B)/client/cmd.o : $(CMDIR)/cmd.c; $(DO_CC) -$(B)/client/common.o : $(CMDIR)/common.c; $(DO_CC) -ifeq ($(USE_SVN),1) - $(B)/client/common.o : .svn/entries -endif -$(B)/client/cvar.o : $(CMDIR)/cvar.c; $(DO_CC) -$(B)/client/files.o : $(CMDIR)/files.c; $(DO_CC) -$(B)/client/md4.o : $(CMDIR)/md4.c; $(DO_CC) -$(B)/client/md5.o : $(CMDIR)/md5.c; $(DO_CC) -$(B)/client/msg.o : $(CMDIR)/msg.c; $(DO_CC) -$(B)/client/net_chan.o : $(CMDIR)/net_chan.c; $(DO_CC) -$(B)/client/huffman.o : $(CMDIR)/huffman.c; $(DO_CC) -$(B)/client/parse.o : $(CMDIR)/parse.c; $(DO_CC) -$(B)/client/q_shared.o : $(CMDIR)/q_shared.c; $(DO_CC) -$(B)/client/q_math.o : $(CMDIR)/q_math.c; $(DO_CC) - -$(B)/client/jcapimin.o : $(JPDIR)/jcapimin.c; $(DO_CC) -$(B)/client/jchuff.o : $(JPDIR)/jchuff.c; $(DO_CC) -$(B)/client/jcinit.o : $(JPDIR)/jcinit.c; $(DO_CC) -$(B)/client/jccoefct.o : $(JPDIR)/jccoefct.c; $(DO_CC) -$(B)/client/jccolor.o : $(JPDIR)/jccolor.c; $(DO_CC) -$(B)/client/jfdctflt.o : $(JPDIR)/jfdctflt.c; $(DO_CC) -$(B)/client/jcdctmgr.o : $(JPDIR)/jcdctmgr.c; $(DO_CC) -$(B)/client/jcmainct.o : $(JPDIR)/jcmainct.c; $(DO_CC) -$(B)/client/jcmarker.o : $(JPDIR)/jcmarker.c; $(DO_CC) -$(B)/client/jcmaster.o : $(JPDIR)/jcmaster.c; $(DO_CC) -$(B)/client/jcomapi.o : $(JPDIR)/jcomapi.c; $(DO_CC) -$(B)/client/jcparam.o : $(JPDIR)/jcparam.c; $(DO_CC) -$(B)/client/jcprepct.o : $(JPDIR)/jcprepct.c; $(DO_CC) -$(B)/client/jcsample.o : $(JPDIR)/jcsample.c; $(DO_CC) - -$(B)/client/jdapimin.o : $(JPDIR)/jdapimin.c; $(DO_CC) -$(B)/client/jdapistd.o : $(JPDIR)/jdapistd.c; $(DO_CC) -$(B)/client/jdatasrc.o : $(JPDIR)/jdatasrc.c; $(DO_CC) -$(B)/client/jdcoefct.o : $(JPDIR)/jdcoefct.c; $(DO_CC) -$(B)/client/jdcolor.o : $(JPDIR)/jdcolor.c; $(DO_CC) -$(B)/client/jcphuff.o : $(JPDIR)/jcphuff.c; $(DO_CC) -$(B)/client/jddctmgr.o : $(JPDIR)/jddctmgr.c; $(DO_CC) -$(B)/client/jdhuff.o : $(JPDIR)/jdhuff.c; $(DO_CC) -$(B)/client/jdinput.o : $(JPDIR)/jdinput.c; $(DO_CC) -$(B)/client/jdmainct.o : $(JPDIR)/jdmainct.c; $(DO_CC) -$(B)/client/jdmarker.o : $(JPDIR)/jdmarker.c; $(DO_CC) -$(B)/client/jdmaster.o : $(JPDIR)/jdmaster.c; $(DO_CC) -$(B)/client/jdpostct.o : $(JPDIR)/jdpostct.c; $(DO_CC) -$(B)/client/jdsample.o : $(JPDIR)/jdsample.c; $(DO_CC) -$(B)/client/jdtrans.o : $(JPDIR)/jdtrans.c; $(DO_CC) -$(B)/client/jerror.o : $(JPDIR)/jerror.c; $(DO_CC) $(GL_CFLAGS) $(MINGW_CFLAGS) -$(B)/client/jidctflt.o : $(JPDIR)/jidctflt.c; $(DO_CC) -$(B)/client/jmemmgr.o : $(JPDIR)/jmemmgr.c; $(DO_CC) -$(B)/client/jmemnobs.o : $(JPDIR)/jmemnobs.c; $(DO_CC) $(GL_CFLAGS) $(MINGW_CFLAGS) -$(B)/client/jutils.o : $(JPDIR)/jutils.c; $(DO_CC) - -$(B)/client/tr_bsp.o : $(RDIR)/tr_bsp.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_animation.o : $(RDIR)/tr_animation.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_backend.o : $(RDIR)/tr_backend.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_cmds.o : $(RDIR)/tr_cmds.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_curve.o : $(RDIR)/tr_curve.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_flares.o : $(RDIR)/tr_flares.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_font.o : $(RDIR)/tr_font.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_image.o : $(RDIR)/tr_image.c; $(DO_CC) $(GL_CFLAGS) $(MINGW_CFLAGS) -$(B)/client/tr_init.o : $(RDIR)/tr_init.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_light.o : $(RDIR)/tr_light.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_main.o : $(RDIR)/tr_main.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_marks.o : $(RDIR)/tr_marks.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_mesh.o : $(RDIR)/tr_mesh.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_model.o : $(RDIR)/tr_model.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_noise.o : $(RDIR)/tr_noise.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_scene.o : $(RDIR)/tr_scene.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shade.o : $(RDIR)/tr_shade.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shader.o : $(RDIR)/tr_shader.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shade_calc.o : $(RDIR)/tr_shade_calc.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_shadows.o : $(RDIR)/tr_shadows.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_sky.o : $(RDIR)/tr_sky.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_smp.o : $(RDIR)/tr_smp.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_stripify.o : $(RDIR)/tr_stripify.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_subdivide.o : $(RDIR)/tr_subdivide.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_surface.o : $(RDIR)/tr_surface.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/tr_world.o : $(RDIR)/tr_world.c; $(DO_CC) $(GL_CFLAGS) - -$(B)/client/unix_qgl.o : $(UDIR)/unix_qgl.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/unix_main.o : $(UDIR)/unix_main.c; $(DO_CC) -$(B)/client/unix_net.o : $(UDIR)/unix_net.c; $(DO_CC) -$(B)/client/unix_shared.o : $(UDIR)/unix_shared.c; $(DO_CC) -$(B)/client/irix_glimp.o : $(UDIR)/irix_glimp.c; $(DO_CC) -$(B)/client/irix_glimp_smp.o : $(UDIR)/irix_glimp.c; $(DO_SMP_CC) -$(B)/client/irix_snd.o : $(UDIR)/irix_snd.c; $(DO_CC) -$(B)/client/irix_input.o : $(UDIR)/irix_input.c; $(DO_CC) -$(B)/client/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/linux_glimp.o : $(UDIR)/linux_glimp.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/sdl_glimp.o : $(UDIR)/sdl_glimp.c; $(DO_CC) $(GL_CFLAGS) -$(B)/client/linux_glimp_smp.o : $(UDIR)/linux_glimp.c; $(DO_SMP_CC) $(GL_CFLAGS) -$(B)/client/sdl_glimp_smp.o : $(UDIR)/sdl_glimp.c; $(DO_SMP_CC) $(GL_CFLAGS) -$(B)/client/linux_joystick.o : $(UDIR)/linux_joystick.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/sdl_snd.o : $(UDIR)/sdl_snd.c; $(DO_CC) -$(B)/client/snd_mixa.o : $(UDIR)/snd_mixa.s; $(DO_AS) -$(B)/client/matha.o : $(UDIR)/matha.s; $(DO_AS) -$(B)/client/ftola.o : $(UDIR)/ftola.s; $(DO_AS) -$(B)/client/snapvectora.o : $(UDIR)/snapvectora.s; $(DO_AS) - -$(B)/client/win_gamma.o : $(W32DIR)/win_gamma.c; $(DO_CC) -$(B)/client/win_glimp.o : $(W32DIR)/win_glimp.c; $(DO_CC) -$(B)/client/win_input.o : $(W32DIR)/win_input.c; $(DO_CC) -$(B)/client/win_main.o : $(W32DIR)/win_main.c; $(DO_CC) -$(B)/client/win_net.o : $(W32DIR)/win_net.c; $(DO_CC) -$(B)/client/win_qgl.o : $(W32DIR)/win_qgl.c; $(DO_CC) -$(B)/client/win_shared.o : $(W32DIR)/win_shared.c; $(DO_CC) -$(B)/client/win_snd.o : $(W32DIR)/win_snd.c; $(DO_CC) -$(B)/client/win_syscon.o : $(W32DIR)/win_syscon.c; $(DO_CC) -$(B)/client/win_wndproc.o : $(W32DIR)/win_wndproc.c; $(DO_CC) -$(B)/client/win_resource.o : $(W32DIR)/win_resource.rc; $(DO_WINDRES) - -$(B)/client/vm_x86.o : $(CMDIR)/vm_x86.c; $(DO_CC) -$(B)/client/vm_x86_64.o : $(CMDIR)/vm_x86_64.c; $(DO_CC) -ifneq ($(VM_PPC),) -$(B)/client/$(VM_PPC).o : $(CMDIR)/$(VM_PPC).c; $(DO_CC) -endif -$(B)/client/unzip.o : $(CMDIR)/unzip.c; $(DO_CC) -$(B)/client/vm.o : $(CMDIR)/vm.c; $(DO_CC) -$(B)/client/vm_interpreted.o : $(CMDIR)/vm_interpreted.c; $(DO_CC) ############################################################################# # DEDICATED SERVER @@ -1269,62 +1092,13 @@ ifeq ($(HAVE_VM_COMPILED),true) Q3DOBJ += $(B)/ded/vm_x86_64.o endif ifeq ($(ARCH),ppc) - Q3DOBJ += $(B)/ded/$(VM_PPC).o + Q3DOBJ += $(B)/ded/vm_ppc.o endif endif $(B)/tremded.$(ARCH)$(BINEXT): $(Q3DOBJ) - $(CC) -o $@ $(Q3DOBJ) $(LDFLAGS) - -$(B)/ded/sv_client.o : $(SDIR)/sv_client.c; $(DO_DED_CC) -$(B)/ded/sv_ccmds.o : $(SDIR)/sv_ccmds.c; $(DO_DED_CC) -$(B)/ded/sv_game.o : $(SDIR)/sv_game.c; $(DO_DED_CC) -$(B)/ded/sv_init.o : $(SDIR)/sv_init.c; $(DO_DED_CC) -$(B)/ded/sv_main.o : $(SDIR)/sv_main.c; $(DO_DED_CC) -$(B)/ded/sv_net_chan.o : $(SDIR)/sv_net_chan.c; $(DO_DED_CC) -$(B)/ded/sv_snapshot.o : $(SDIR)/sv_snapshot.c; $(DO_DED_CC) -$(B)/ded/sv_world.o : $(SDIR)/sv_world.c; $(DO_DED_CC) -$(B)/ded/cm_load.o : $(CMDIR)/cm_load.c; $(DO_DED_CC) -$(B)/ded/cm_polylib.o : $(CMDIR)/cm_polylib.c; $(DO_DED_CC) -$(B)/ded/cm_test.o : $(CMDIR)/cm_test.c; $(DO_DED_CC) -$(B)/ded/cm_trace.o : $(CMDIR)/cm_trace.c; $(DO_DED_CC) -$(B)/ded/cm_patch.o : $(CMDIR)/cm_patch.c; $(DO_DED_CC) -$(B)/ded/cmd.o : $(CMDIR)/cmd.c; $(DO_DED_CC) -$(B)/ded/common.o : $(CMDIR)/common.c; $(DO_DED_CC) -ifeq ($(USE_SVN),1) - $(B)/ded/common.o : .svn/entries -endif -$(B)/ded/cvar.o : $(CMDIR)/cvar.c; $(DO_DED_CC) -$(B)/ded/files.o : $(CMDIR)/files.c; $(DO_DED_CC) -$(B)/ded/md4.o : $(CMDIR)/md4.c; $(DO_DED_CC) -$(B)/ded/msg.o : $(CMDIR)/msg.c; $(DO_DED_CC) -$(B)/ded/net_chan.o : $(CMDIR)/net_chan.c; $(DO_DED_CC) -$(B)/ded/huffman.o : $(CMDIR)/huffman.c; $(DO_DED_CC) -$(B)/ded/parse.o : $(CMDIR)/parse.c; $(DO_DED_CC) -$(B)/ded/q_shared.o : $(CMDIR)/q_shared.c; $(DO_DED_CC) -$(B)/ded/q_math.o : $(CMDIR)/q_math.c; $(DO_DED_CC) - -$(B)/ded/linux_signals.o : $(UDIR)/linux_signals.c; $(DO_DED_CC) -$(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/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) -$(B)/ded/unzip.o : $(CMDIR)/unzip.c; $(DO_DED_CC) -$(B)/ded/vm.o : $(CMDIR)/vm.c; $(DO_DED_CC) -$(B)/ded/vm_interpreted.o : $(CMDIR)/vm_interpreted.c; $(DO_DED_CC) - -$(B)/ded/ftola.o : $(UDIR)/ftola.s; $(DO_AS) -$(B)/ded/snapvectora.o : $(UDIR)/snapvectora.s; $(DO_AS) -$(B)/ded/matha.o : $(UDIR)/matha.s; $(DO_AS) - -$(B)/ded/vm_x86.o : $(CMDIR)/vm_x86.c; $(DO_DED_CC) -$(B)/ded/vm_x86_64.o : $(CMDIR)/vm_x86_64.c; $(DO_DED_CC) -ifneq ($(VM_PPC),) -$(B)/ded/$(VM_PPC).o : $(CMDIR)/$(VM_PPC).c; $(DO_DED_CC) -endif + @echo "LD $@" + @$(CC) -o $@ $(Q3DOBJ) $(LDFLAGS) @@ -1369,10 +1143,12 @@ CGOBJ = $(CGOBJ_) $(B)/base/cgame/cg_syscalls.o CGVMOBJ = $(CGOBJ_:%.o=%.asm) $(B)/base/game/bg_lib.asm $(B)/base/cgame$(ARCH).$(SHLIBEXT) : $(CGOBJ) - $(CC) $(SHLIBLDFLAGS) -o $@ $(CGOBJ) + @echo "LD $@" + @$(CC) $(SHLIBLDFLAGS) -o $@ $(CGOBJ) $(B)/base/vm/cgame.qvm: $(CGVMOBJ) $(CGDIR)/cg_syscalls.asm - $(Q3ASM) -o $@ $(CGVMOBJ) $(CGDIR)/cg_syscalls.asm + @echo "Q3ASM $@" + @$(Q3ASM) -o $@ $(CGVMOBJ) $(CGDIR)/cg_syscalls.asm @@ -1414,10 +1190,12 @@ GOBJ = $(GOBJ_) $(B)/base/game/g_syscalls.o GVMOBJ = $(GOBJ_:%.o=%.asm) $(B)/base/game/bg_lib.asm $(B)/base/game$(ARCH).$(SHLIBEXT) : $(GOBJ) - $(CC) $(SHLIBLDFLAGS) -o $@ $(GOBJ) + @echo "LD $@" + @$(CC) $(SHLIBLDFLAGS) -o $@ $(GOBJ) $(B)/base/vm/game.qvm: $(GVMOBJ) $(GDIR)/g_syscalls.asm - $(Q3ASM) -o $@ $(GVMOBJ) $(GDIR)/g_syscalls.asm + @echo "Q3ASM $@" + @$(Q3ASM) -o $@ $(GVMOBJ) $(GDIR)/g_syscalls.asm @@ -1440,10 +1218,77 @@ UIOBJ = $(UIOBJ_) $(B)/base/ui/ui_syscalls.o UIVMOBJ = $(UIOBJ_:%.o=%.asm) $(B)/base/game/bg_lib.asm $(B)/base/ui$(ARCH).$(SHLIBEXT) : $(UIOBJ) - $(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(UIOBJ) + @echo "LD $@" + @$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(UIOBJ) $(B)/base/vm/ui.qvm: $(UIVMOBJ) $(UIDIR)/ui_syscalls.asm - $(Q3ASM) -o $@ $(UIVMOBJ) $(UIDIR)/ui_syscalls.asm + @echo "Q3ASM $@" + @$(Q3ASM) -o $@ $(UIVMOBJ) $(UIDIR)/ui_syscalls.asm + + + +############################################################################# +## CLIENT/SERVER RULES +############################################################################# + +$(B)/client/%.o: $(UDIR)/%.s + $(DO_AS) + +$(B)/client/%.o: $(CDIR)/%.c + $(DO_CC) + +$(B)/client/%.o: $(SDIR)/%.c + $(DO_CC) + +$(B)/client/%.o: $(CMDIR)/%.c + $(DO_CC) + +$(B)/client/%.o: $(BLIBDIR)/%.c + $(DO_BOT_CC) + +$(B)/client/%.o: $(JPDIR)/%.c + $(DO_CC) + +$(B)/client/%.o: $(RDIR)/%.c + $(DO_CC) + +$(B)/client/%.o: $(UDIR)/%.c + $(DO_CC) + +$(B)/clientsmp/%.o: $(UDIR)/%.c + $(DO_SMP_CC) + +$(B)/client/%.o: $(W32DIR)/%.c + $(DO_CC) + +$(B)/client/%.o: $(W32DIR)/%.rc + $(DO_WINDRES) + + +$(B)/ded/%.o: $(UDIR)/%.s + $(DO_AS) + +$(B)/ded/%.o: $(SDIR)/%.c + $(DO_DED_CC) + +$(B)/ded/%.o: $(CMDIR)/%.c + $(DO_DED_CC) + +$(B)/ded/%.o: $(BLIBDIR)/%.c + $(DO_BOT_CC) + +$(B)/ded/%.o: $(UDIR)/%.c + $(DO_DED_CC) + +$(B)/ded/%.o: $(NDIR)/%.c + $(DO_DED_CC) + +# Extra dependencies to ensure the SVN version is incorporated +ifeq ($(USE_SVN),1) + $(B)/client/cl_console.o : .svn/entries + $(B)/client/common.o : .svn/entries + $(B)/ded/common.o : .svn/entries +endif ############################################################################# @@ -1483,30 +1328,31 @@ $(B)/base/qcommon/%.asm: $(CMDIR)/%.c ############################################################################# clean: clean-debug clean-release - $(MAKE) -C $(MASTERDIR) clean + @$(MAKE) -C $(MASTERDIR) clean clean2: - if [ -d $(B) ];then (find $(B) -name '*.d' -exec rm {} \;)fi - rm -f $(Q3OBJ) $(Q3POBJ) $(Q3POBJ_SMP) $(Q3DOBJ) \ + @echo "CLEAN $(B)" + @if [ -d $(B) ];then (find $(B) -name '*.d' -exec rm {} \;)fi + @rm -f $(Q3OBJ) $(Q3POBJ) $(Q3POBJ_SMP) $(Q3DOBJ) \ $(GOBJ) $(CGOBJ) $(UIOBJ) \ $(GVMOBJ) $(CGVMOBJ) $(UIVMOBJ) - rm -f $(TARGETS) + @rm -f $(TARGETS) clean-debug: - $(MAKE) clean2 B=$(BD) CFLAGS="$(DEBUG_CFLAGS)" + @$(MAKE) clean2 B=$(BD) CFLAGS="$(DEBUG_CFLAGS)" clean-release: - $(MAKE) clean2 B=$(BR) CFLAGS="$(RELEASE_CFLAGS)" + @$(MAKE) clean2 B=$(BR) CFLAGS="$(RELEASE_CFLAGS)" toolsclean: - $(MAKE) -C $(TOOLSDIR)/asm clean uninstall - $(MAKE) -C $(TOOLSDIR)/lcc clean uninstall + @$(MAKE) -C $(TOOLSDIR)/asm clean uninstall + @$(MAKE) -C $(TOOLSDIR)/lcc clean uninstall distclean: clean toolsclean - rm -rf $(BUILD_DIR) + @rm -rf $(BUILD_DIR) installer: build_release - $(MAKE) VERSION=$(VERSION) -C $(LOKISETUPDIR) + @$(MAKE) VERSION=$(VERSION) -C $(LOKISETUPDIR) dist: rm -rf tremulous-$(SVN_VERSION) @@ -1521,7 +1367,7 @@ dist: D_FILES=$(shell find . -name '*.d') $(B)/base/vm/vm.d: $(GOBJ) $(CGOBJ) $(UIOBJ) - cat $(^:%.o=%.d) | sed -e 's/\.o/\.asm/g' > $@ + @cat $(^:%.o=%.d) | sed -e 's/\.o/\.asm/g' > $@ qvmdeps: $(B)/base/vm/vm.d -- cgit