X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=makefile;h=84db7512929f70e67687b17d5bb9840f6fe0247b;hb=refs%2Fheads%2Fakari%2Firc;hp=e3b6957e8245e900fb596b369e181cc4117c2cd9;hpb=3b913d2ec9c3b875521aa43e5b5147ffdaceeb9f;p=xonotic%2Fdarkplaces.git diff --git a/makefile b/makefile index e3b6957e..84db7512 100644 --- a/makefile +++ b/makefile @@ -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,6 +183,10 @@ 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 @@ -163,8 +194,11 @@ ifeq ($(WIN32RELEASE), 1) # TARGET=i686-pc-mingw32 # CC=$(TARGET)-g++ # WINDRES=$(TARGET)-windres - CPUOPTIMIZATIONS+=-march=i686 -DUSE_WSPIAPI_H - LDFLAGS_WINCOMMON+=-Wl,--large-address-aware + 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) @@ -174,12 +208,13 @@ ifeq ($(WIN64RELEASE), 1) endif ifeq ($(D3D), 1) - CPUOPTIMIZATIONS+=-DSUPPORTD3D -DSUPPORTDIRECTX + CFLAGS_D3D=-DSUPPORTD3D -DSUPPORTDIRECTX CFLAGS_WARNINGS=-Wall - LDFLAGS_WINCOMMON=-ld3d9 + LDFLAGS_D3D=-ld3d9 else + CFLAGS_D3D= CFLAGS_WARNINGS=-Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement - LDFLAGS_WINCOMMON= + LDFLAGS_D3D= endif @@ -205,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 ##### @@ -275,14 +314,6 @@ ifdef DP_PRELOAD_DEPENDENCIES endif endif -ifdef DP_LINK_TO_LIBJPEG - LDFLAGS_LIBJPEG?=-ljpeg - LDFLAGS_CL+=$(LDFLAGS_LIBJPEG) - LDFLAGS_SV+=$(LDFLAGS_LIBJPEG) - LDFLAGS_SDL+=$(LDFLAGS_LIBJPEG) - CFLAGS_PRELOAD+=$(CFLAGS_LIBJPEG) -DLINK_TO_LIBJPEG -endif - ##### GNU Make specific definitions ##### DO_LD=$(CC) -o $@ $^ $(LDFLAGS)