X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=makefile.inc;h=0d5d790ba52d7deec656bca33513fc13a5b26600;hb=b9ba98a3576c56354a320d66435ca18b7720952b;hp=9a9c51bbde48ce4f40ff31f2431df2ddde5fb604;hpb=0a5bcf5dd2555fa3d373a60bba724365f9244578;p=xonotic%2Fdarkplaces.git diff --git a/makefile.inc b/makefile.inc index 9a9c51bb..0d5d790b 100644 --- a/makefile.inc +++ b/makefile.inc @@ -1,28 +1,34 @@ +# Invalid call detection +CHECKLEVEL1 = @if [ "$(LEVEL)" != 1 ]; then $(MAKE) help; false; fi +CHECKLEVEL2 = @if [ "$(LEVEL)" != 2 ]; then $(MAKE) help; false; fi + # Choose the compiler you want to use CC=gcc # athlon optimizations -#CPUOPTIMIZATIONS=-march=athlon +#CPUOPTIMIZATIONS?=-march=athlon # athlon xp optimizations -#CPUOPTIMIZATIONS=-march=athlon-xp +#CPUOPTIMIZATIONS?=-march=athlon-xp # athlon 64 optimizations -#CPUOPTIMIZATIONS=-march=athlon64 -m32 +#CPUOPTIMIZATIONS?=-march=athlon64 -m32 # Pentium 3 optimizations -#CPUOPTIMIZATIONS=-march=pentium3 +#CPUOPTIMIZATIONS?=-march=pentium3 # Pentium 4 optimizations -#CPUOPTIMIZATIONS=-march=pentium4 +#CPUOPTIMIZATIONS?=-march=pentium4 # 686 (Pentium Pro/II) optimizations -#CPUOPTIMIZATIONS=-march=i686 +#CPUOPTIMIZATIONS?=-march=i686 # No specific CPU (386 compatible) -CPUOPTIMIZATIONS= +CPUOPTIMIZATIONS?= +# Experimental +#CPUOPTIMIZATIONS?=-fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fassociative-math -freciprocal-math -fno-signed-zeros -fno-trapping-math SDL_CONFIG?=sdl-config SDLCONFIG_UNIXCFLAGS?=`$(SDL_CONFIG) --cflags` SDLCONFIG_UNIXLIBS?=`$(SDL_CONFIG) --libs` SDLCONFIG_UNIXSTATICLIBS?=`$(SDL_CONFIG) --static-libs` -SDLCONFIG_MACOSXCFLAGS= -SDLCONFIG_MACOSXLIBS=-framework SDL -framework Cocoa -SDLCONFIG_MACOSXSTATICLIBS=-framework SDL -framework Cocoa +SDLCONFIG_MACOSXCFLAGS=-I/Library/Frameworks/SDL.framework/Headers +SDLCONFIG_MACOSXLIBS=-framework SDL -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS) +SDLCONFIG_MACOSXSTATICLIBS=-framework SDL -framework Cocoa $(SDLCONFIG_MACOSXCFLAGS) STRIP?=strip @@ -47,7 +53,7 @@ OBJ_SND_ALSA=$(OBJ_SND_COMMON) snd_alsa.o LIB_SND_ALSA=-lasound $(LIB_SND_MODPLUG) # Core Audio (Mac OS X) -OBJ_SND_COREAUDIO=$(OBJ_SND_COMMON) snd_coreaudio.c +OBJ_SND_COREAUDIO=$(OBJ_SND_COMMON) snd_coreaudio.o LIB_SND_COREAUDIO=-framework CoreAudio $(LIB_SND_MODPLUG) # BSD / Sun audio API (NetBSD and OpenBSD) @@ -58,6 +64,9 @@ LIB_SND_BSD=$(LIB_SND_MODPLUG) OBJ_SND_WIN=$(OBJ_SND_COMMON) snd_win.o LIB_SND_WIN=$(LIB_SND_MODPLUG) +# Qantourisc's 3D Realtime Acoustic Lib (3D RAS) +OBJ_SND_3DRAS=snd_3dras.o +LIB_SND_3DRAS= # CD objects OBJ_NOCD=cd_null.o @@ -167,9 +176,9 @@ DO_CC=$(CC) $(CFLAGS) -c $< -o $@ # Link -LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG) -LDFLAGS_PROFILE=-g -pg $(OPTIM_RELEASE) -LDFLAGS_RELEASE=$(OPTIM_RELEASE) +LDFLAGS_DEBUG=-g -ggdb $(OPTIM_DEBUG) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=debug +LDFLAGS_PROFILE=-g -pg $(OPTIM_RELEASE) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=profile +LDFLAGS_RELEASE=$(OPTIM_RELEASE) -DSVNREVISION=`test -d .svn && svnversion || echo -` -DBUILDTYPE=release ##### UNIX specific variables ##### @@ -202,9 +211,9 @@ OBJ_LINUXCD=cd_linux.o #OBJ_LINUXCD=$(OBJ_NOCD) # Link -LDFLAGS_LINUXCL=$(LDFLAGS_UNIXCOMMON) -ldl $(LDFLAGS_UNIXCL) -LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -ldl -LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -ldl $(LDFLAGS_UNIXSDL) +LDFLAGS_LINUXCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXCL) +LDFLAGS_LINUXSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl +LDFLAGS_LINUXSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl $(LDFLAGS_UNIXSDL) ##### Mac OS X specific variables ##### @@ -231,9 +240,9 @@ OBJ_SUNOSCD=$(OBJ_NOCD) CFLAGS_SUNOS=-I/usr/lib/oss/include -DBSD_COMP -DSUNOS # Link -LDFLAGS_SUNOSCL=$(LDFLAGS_UNIXCOMMON) -ldl -lsocket -lnsl -R$(UNIX_X11LIBPATH) -L$(UNIX_X11LIBPATH) -lX11 -lXpm -lXext -lXxf86vm $(LIB_SOUND) -LDFLAGS_SUNOSSV=$(LDFLAGS_UNIXCOMMON) -ldl -lsocket -lnsl -LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -ldl -lsocket -lnsl $(LDFLAGS_UNIXSDL) +LDFLAGS_SUNOSCL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl -R$(UNIX_X11LIBPATH) -L$(UNIX_X11LIBPATH) -lX11 -lXpm -lXext -lXxf86vm $(LIB_SOUND) +LDFLAGS_SUNOSSV=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl +LDFLAGS_SUNOSSDL=$(LDFLAGS_UNIXCOMMON) -lrt -ldl -lsocket -lnsl $(LDFLAGS_UNIXSDL) ##### BSD specific variables ##### @@ -245,7 +254,7 @@ OBJ_BSDCD=cd_bsd.o # Link LDFLAGS_BSDCL=$(LDFLAGS_UNIXCOMMON) -lutil $(LDFLAGS_UNIXCL) -LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON) +LDFLAGS_BSDSV=$(LDFLAGS_UNIXCOMMON) LDFLAGS_BSDSDL=$(LDFLAGS_UNIXCOMMON) $(LDFLAGS_UNIXSDL) @@ -257,7 +266,7 @@ OBJ_WINCD=cd_win.o #if you want no CD audio #OBJ_WINCD=$(OBJ_NOCD) -OBJ_WGL= builddate.c sys_win.o vid_wgl.o conproc.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON) +OBJ_WGL= builddate.c sys_win.o vid_wgl.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON) # Link # Note that Windows Vista users may need --large-address-aware because Vista seems to map over 500MB of application address space for its own purposes, which is a significant chunk taken out of the default 2GB address space, this option raises the limit to 4GB (or 3GB on Vista 32 and older versions of Windows). @@ -319,131 +328,153 @@ nexuiz : cl-debug : $(MAKE) bin-debug \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" + EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1 cl-profile : $(MAKE) bin-profile \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" + EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1 cl-release : $(MAKE) bin-release \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" + EXE="$(EXE_CL)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1 cl-nexuiz : $(MAKE) bin-release \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_CLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_CL)" + EXE="$(EXE_CLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_CL)" LEVEL=1 sv-debug : $(MAKE) bin-debug \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" + EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1 sv-profile : $(MAKE) bin-profile \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" + EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1 sv-release : $(MAKE) bin-release \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" + EXE="$(EXE_SV)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1 sv-nexuiz : $(MAKE) bin-release \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SVNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SV)" + EXE="$(EXE_SVNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SV)" LEVEL=1 sdl-debug : $(MAKE) bin-debug \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" + EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1 sdl-profile : $(MAKE) bin-profile \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" + EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1 sdl-release : $(MAKE) bin-release \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" + EXE="$(EXE_SDL)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1 sdl-nexuiz : $(MAKE) bin-release \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ - EXE="$(EXE_SDLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" + EXE="$(EXE_SDLNEXUIZ)" LDFLAGS_COMMON="$(LDFLAGS_SDL)" LEVEL=1 bin-debug : + $(CHECKLEVEL1) @echo @echo "========== $(EXE) (debug) ==========" $(MAKE) $(EXE) \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\ - LDFLAGS="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)" + LDFLAGS="$(LDFLAGS_DEBUG) $(LDFLAGS_COMMON)" LEVEL=2 bin-profile : + $(CHECKLEVEL1) @echo @echo "========== $(EXE) (profile) ==========" $(MAKE) $(EXE) \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\ - LDFLAGS="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)" + LDFLAGS="$(LDFLAGS_PROFILE) $(LDFLAGS_COMMON)" LEVEL=2 bin-release : + $(CHECKLEVEL1) @echo @echo "========== $(EXE) (release) ==========" $(MAKE) $(EXE) \ DP_MAKE_TARGET=$(DP_MAKE_TARGET) DP_SOUND_API=$(DP_SOUND_API) \ CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_EXTRA) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\ - LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" + LDFLAGS="$(LDFLAGS_RELEASE) $(LDFLAGS_COMMON)" LEVEL=2 $(STRIP) $(EXE) snd_modplug.o: snd_modplug.c + $(CHECKLEVEL2) $(DO_CC) $(CFLAGS_SND_MODPLUG) vid_glx.o: vid_glx.c + $(CHECKLEVEL2) $(DO_CC) -I/usr/X11R6/include vid_sdl.o: vid_sdl.c + $(CHECKLEVEL2) $(DO_CC) $(CFLAGS_SDL) sys_sdl.o: sys_sdl.c + $(CHECKLEVEL2) $(DO_CC) $(CFLAGS_SDL) snd_sdl.o: snd_sdl.c + $(CHECKLEVEL2) $(DO_CC) $(CFLAGS_SDL) +snd_3dras.o: snd_3dras.c + $(CHECKLEVEL2) + $(DO_CC) + cd_sdl.o: cd_sdl.c + $(CHECKLEVEL2) $(DO_CC) $(CFLAGS_SDL) darkplaces.o: %.o : %.rc + $(CHECKLEVEL2) $(WINDRES) -o $@ $< nexuiz.o: %.o : %.rc + $(CHECKLEVEL2) $(WINDRES) -o $@ $< .c.o: + $(CHECKLEVEL2) $(DO_CC) $(EXE_CL): $(OBJ_CL) $(OBJ_ICON) + $(CHECKLEVEL2) $(DO_LD) $(EXE_SV): $(OBJ_SV) $(OBJ_ICON) + $(CHECKLEVEL2) $(DO_LD) $(EXE_SDL): $(OBJ_SDL) $(OBJ_ICON) + $(CHECKLEVEL2) $(DO_LD) $(EXE_CLNEXUIZ): $(OBJ_CL) $(OBJ_ICON_NEXUIZ) + $(CHECKLEVEL2) $(DO_LD) $(EXE_SVNEXUIZ): $(OBJ_SV) $(OBJ_ICON_NEXUIZ) + $(CHECKLEVEL2) $(DO_LD) $(EXE_SDLNEXUIZ): $(OBJ_SDL) $(OBJ_ICON_NEXUIZ) + $(CHECKLEVEL2) $(DO_LD) clean: