X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=makefile;h=84db7512929f70e67687b17d5bb9840f6fe0247b;hb=c4079451039f769eb5444575fad05d4f5925d99e;hp=45b2d97f666b7f08004d331141799d3bde69430f;hpb=e5c4731198c6c0756c7100486cbd6c7c1bf3d537;p=xonotic%2Fdarkplaces.git diff --git a/makefile b/makefile index 45b2d97f..84db7512 100644 --- a/makefile +++ b/makefile @@ -3,7 +3,7 @@ ifndef DP_MAKE_TARGET # Win32 -ifdef windir +ifdef WINDIR DP_MAKE_TARGET=mingw else @@ -47,6 +47,12 @@ else UNIX_X11LIBPATH:=/usr/X11R6/lib endif +# default targets +TARGETS_DEBUG=sv-debug cl-debug sdl-debug +TARGETS_PROFILE=sv-profile cl-profile sdl-profile +TARGETS_RELEASE=sv-release cl-release sdl-release +TARGETS_RELEASE_PROFILE=sv-release-profile cl-release-profile sdl-release-profile +TARGETS_NEXUIZ=sv-nexuiz cl-nexuiz sdl-nexuiz # Linux configuration ifeq ($(DP_MAKE_TARGET), linux) @@ -61,9 +67,9 @@ ifeq ($(DP_MAKE_TARGET), linux) LDFLAGS_SV=$(LDFLAGS_LINUXSV) LDFLAGS_SDL=$(LDFLAGS_LINUXSDL) - SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) - SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) - SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) + SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11) + SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11) + SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11) EXE_CL=$(EXE_UNIXCL) EXE_SV=$(EXE_UNIXSV) @@ -71,6 +77,10 @@ ifeq ($(DP_MAKE_TARGET), linux) EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ) EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ) EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ) + + # libjpeg dependency (set these to "" if you want to use dynamic loading instead) + CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG + LIB_JPEG=-ljpeg endif # Mac OS X configuration @@ -100,6 +110,19 @@ ifeq ($(DP_MAKE_TARGET), macosx) ifeq ($(word 2, $(filter -arch, $(CC))), -arch) CFLAGS_MAKEDEP= endif + + # libjpeg dependency (set these to "" if you want to use dynamic loading instead) + # we don't currently link to libjpeg on Mac because the OS does not have an easy way to load libjpeg and we provide our own in the .app + CFLAGS_LIBJPEG= + LIB_JPEG= + + # on OS X, we don't build the CL by default because it uses deprecated + # and not-implemented-in-64bit Carbon + TARGETS_DEBUG=sv-debug sdl-debug + TARGETS_PROFILE=sv-profile sdl-profile + TARGETS_RELEASE=sv-release sdl-release + TARGETS_RELEASE_PROFILE=sv-release-profile sdl-release-profile + TARGETS_NEXUIZ=sv-nexuiz sdl-nexuiz endif # SunOS configuration (Solaris) @@ -117,9 +140,9 @@ ifeq ($(DP_MAKE_TARGET), sunos) LDFLAGS_SV=$(LDFLAGS_SUNOSSV) LDFLAGS_SDL=$(LDFLAGS_SUNOSSDL) - SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) - SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) - SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) + SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11) + SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11) + SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11) EXE_CL=$(EXE_UNIXCL) EXE_SV=$(EXE_UNIXSV) @@ -127,6 +150,10 @@ ifeq ($(DP_MAKE_TARGET), sunos) EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ) EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ) EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ) + + # libjpeg dependency (set these to "" if you want to use dynamic loading instead) + CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG + LIB_JPEG=-ljpeg endif # BSD configuration @@ -146,9 +173,9 @@ endif LDFLAGS_SV=$(LDFLAGS_BSDSV) LDFLAGS_SDL=$(LDFLAGS_BSDSDL) - SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) - SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) - SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) + SDLCONFIG_CFLAGS=$(SDLCONFIG_UNIXCFLAGS) $(SDLCONFIG_UNIXCFLAGS_X11) + SDLCONFIG_LIBS=$(SDLCONFIG_UNIXLIBS) $(SDLCONFIG_UNIXLIBS_X11) + SDLCONFIG_STATICLIBS=$(SDLCONFIG_UNIXSTATICLIBS) $(SDLCONFIG_UNIXSTATICLIBS_X11) EXE_CL=$(EXE_UNIXCL) EXE_SV=$(EXE_UNIXSV) @@ -156,9 +183,41 @@ endif EXE_CLNEXUIZ=$(EXE_UNIXCLNEXUIZ) EXE_SVNEXUIZ=$(EXE_UNIXSVNEXUIZ) EXE_SDLNEXUIZ=$(EXE_UNIXSDLNEXUIZ) + + # libjpeg dependency (set these to "" if you want to use dynamic loading instead) + CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG + LIB_JPEG=-ljpeg endif # Win32 configuration +ifeq ($(WIN32RELEASE), 1) +# TARGET=i686-pc-mingw32 +# CC=$(TARGET)-g++ +# WINDRES=$(TARGET)-windres + CPUOPTIMIZATIONS=-march=i686 -fno-math-errno -ffinite-math-only -fno-rounding-math -fno-signaling-nans -fno-trapping-math +# CPUOPTIMIZATIONS+=-DUSE_WSPIAPI_H -DSUPPORTIPV6 + LDFLAGS_WINCOMMON=-Wl,--large-address-aware +else + LDFLAGS_WINCOMMON= +endif + +ifeq ($(WIN64RELEASE), 1) +# TARGET=x86_64-pc-mingw32 +# CC=$(TARGET)-g++ +# WINDRES=$(TARGET)-windres +endif + +ifeq ($(D3D), 1) + CFLAGS_D3D=-DSUPPORTD3D -DSUPPORTDIRECTX + CFLAGS_WARNINGS=-Wall + LDFLAGS_D3D=-ld3d9 +else + CFLAGS_D3D= + CFLAGS_WARNINGS=-Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement + LDFLAGS_D3D= +endif + + ifeq ($(DP_MAKE_TARGET), mingw) DEFAULT_SNDAPI=WIN OBJ_CD=$(OBJ_WINCD) @@ -181,6 +240,10 @@ ifeq ($(DP_MAKE_TARGET), mingw) EXE_CLNEXUIZ=$(EXE_WINCLNEXUIZ) EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ) EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ) + + # libjpeg dependency (set these to "" if you want to use dynamic loading instead) + CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG + LIB_JPEG=-ljpeg endif ##### Sound configuration ##### @@ -225,10 +288,14 @@ ifeq ($(DP_SOUND_API), WIN) LIB_SOUND=$(LIB_SND_WIN) endif +ifeq ($(DP_SOUND_API),3DRAS) + OBJ_SOUND=$(OBJ_SND_3DRAS) + LIB_SOUND=$(LIB_SND_3DRAS) +endif ##### Extra CFLAGS ##### -CFLAGS_MAKEDEP?=-MD +CFLAGS_MAKEDEP?=-MMD ifdef DP_FS_BASEDIR CFLAGS_FS=-DDP_FS_BASEDIR='\"$(DP_FS_BASEDIR)\"' else