X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=makefile;h=84db7512929f70e67687b17d5bb9840f6fe0247b;hb=4e82f39f2505c30be145c98de8bb8aa166c6858c;hp=184029d9e625d4edd1a8b4baa2ed4b5016c424bb;hpb=9af5c9a87d7cddc6268fe5a13f6805ab242e38d8;p=xonotic%2Fdarkplaces.git diff --git a/makefile b/makefile index 184029d9..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,11 +240,10 @@ ifeq ($(DP_MAKE_TARGET), mingw) EXE_CLNEXUIZ=$(EXE_WINCLNEXUIZ) EXE_SVNEXUIZ=$(EXE_WINSVNEXUIZ) EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ) -endif -ifeq ($(WIN32RELEASE), 1) - CPUOPTIMIZATIONS=-march=i686 - CFLAGS_RELEASE="-DSUPPORTDIRECTX -DUSE_WSPIAPI_H" + # libjpeg dependency (set these to "" if you want to use dynamic loading instead) + CFLAGS_LIBJPEG=-DLINK_TO_LIBJPEG + LIB_JPEG=-ljpeg endif ##### Sound configuration ##### @@ -256,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)