Source code compiling/Makefiles/Compiling flags

From SRB2 Wiki
Jump to navigation Jump to search
This article or section is outdated and has not been fully updated to reflect the current version of SRB2.

Please help the Wiki by correcting or removing any misinformation, as well as adding any new information to the page.


This is a list of flags that can be added when using the Makefiles method of compiling SRB2's source code, as of v2.2.8.

If it is appropriate to do so, these can be added as environment variables for your system, allowing you to omit the flags from the mingw32-make or make command to compile SRB2 with.

Platforms and interfaces

See also: Ports

These determine the platform or interface that SRB2's source code is compiled for. If none of these are given, by default SRB2 will be compiled for DOS using DJGPP, and the compiler will output srb2w16.exe to bin/Dos (object files will be sent to objs/djgppdos).

Note: List may include flags for ports that can no longer be compiled properly.

Main

Name Description Default exe name Output directory Object file directory Notes
MINGW Compiles for Windows 32-bit with MinGW srb2dd.exe
(or srb2win.exe if compiling with SDL)
bin/Mingw objs/Mingw
(or objs/Mingw/SDL/ if compiling with SDL)
The following are also turned on:
  • HAVE_LIBGME
  • HAVE_MINIUPNPC (if MINGW64 is not on)
  • SDLMAIN (if SDL is on and NOSDLMAIN is off)
MINGW64 Compiles for Windows 64-bit with MinGW srb2dd.exe
(or srb2win.exe if compiling with SDL)
bin/Mingw64 objs/Mingw64
(or objs/Mingw64/SDL if compiling with SDL)
The following are also turned on:
  • MINGW
  • NONX86
  • X86_64
  • HAVE_LIBGME
LINUX Compiles for i686 Linux lsdlsrb2 bin/Linux objs/Linux The following are also turned on:
  • SDL
  • UNIXCOMMON
  • HAVE_LIBGME (if NOGME is not on)
LINUX64 Compiles for 64-bit Linux (x86_64 or Itanium) lsdlsrb2 bin/Linux64 objs/Linux64 The following are also turned on:
  • LINUX
  • NONX86
FREEBSD Compiles for FreeBSD lsdlsrb2 bin/FreeBSD objs/FreeBSD The following are also turned on:
  • SDL
  • UNIXCOMMON
SOLARIS Compiles for Solaris lsdlsrb2 bin/Solaris objs/Solaris The following are also turned on:
  • SDL
  • UNIXCOMMON
MACOSX Compiles for Mac OS X. This currently builds only a binary of SRB2, not a Mac app. lsdlsrb2 bin/SDL objs/SDL Recommended build instructions:
make -C src MACOSX=1 NONX86=1 SDL=1

The following are also turned on:

  • UNIXCOMMON
DJGPPDOS Compiles for DOS using DJGPP srb2w16.exe bin/Dos objs/djgppdos This is the default option selected if not compiling for any of the other platforms/interfaces
UNIX Compiles for Unix lsdlsrb2 bin/SDL objs/SDL The SDL flag should also be turned on when using this.[confirm? – discuss]

The following are also turned on:

  • UNIXCOMMON
HAIKU Compiles for Haiku bin/SDL objs/SDL The following are also turned on:
  • SDL
  • NOIPX
CYGWIN32 Compiles for Cygwin 32-bit lsdlsrb2.exe bin/cygwin objs/cygwin The following are also turned on:
  • SDL
DUMMY Compiles with dummy interface code srb2dummy.exe bin/dummy objs/dummy The following are also turned on:
  • NOPNG
  • NOZLIB
  • NONET
  • NOHW
  • NOHS
  • NOIPX

Console ports

It is currently unknown if any of these can compile properly or even function properly as of 2.2. Exe names and directories supplied within parentheses are the intended settings, but are suspected not to be set by the compiler (due to the state of compiling for the corresponding ports).

Name Description Default exe name Output directory Object file directory Notes
PANDORA Cross-compiles for Pandora on Linux srb2.pnd bin/pnd N/A [confirm? – discuss] The following are also turned on:
  • LINUX
  • NONX86
  • NOHW
  • NOHS

Non-specific

These are not to be used on their own, but in combination with any of the above if needed.

Name Description
SDL Compiles with SDL (automatically turned on by HAIKU, LINUX, FREEBSD, SOLARIS and CYGWIN32)
Outputs to the /SDL sub-directory of the bin directory for the port being compiled for, e.g. bin/Mingw/SDL

Builds that need SDL will also be compiled with the files in src/sdl for the interface code.

UNIXCOMMON Compiles with code shared by Unix and Unix-like OSes (automatically turned on by UNIX, LINUX, SOLARIS, FREEBSD and MACOSX)

Compiler options

These flags toggle on/off various options related to the compiling process itself, including detection of coding errors during compiling.

Miscellaneous

Name Description
ECHO Gives you detailed information during the compiling process
STATIC On systems that support dynamic linking, this prevents linking with shared libraries
WINDOWSHELL Use comptime.bat instead of comptime.sh, don't use certain gzip commands. This should be used if compiling for Windows using Command Prompt (cmd.exe) rather than through a shell environment (such as MinGW's MSYS).

Warnings/errors

Name Description
WARNINGMODE Compiles with extra warning flags:
  • -W
  • -Wno-div-by-zero (unless GCC295 is set)
  • -Wdeclaration-after-statement (requires VCHELP)
  • -Wundef
  • -Wendif-labels (unless GCC295 is set)
  • -Wshadow (requires GCC41)
  • -Wpointer-arith
  • -Wbad-function-cast
  • -Wcast-qual
  • -Wcast-align (unless NOCASTALIGNWARN is set)
  • -Wwrite-strings
  • -Wsign-compare
  • -Wlogical-op (requires GCC45)
  • -Waggregate-return
  • -Wold-style-definition (requires GCC40)
  • -Wmissing-prototypes
  • -Wmissing-declarations
  • -Wmissing-field-initializers (requires GCC40)
  • -Wmissing-noreturn
  • -Wnested-externs
  • -Winline
  • -funit-at-a-time (requires GCC43)
  • -Wlogical-op (requires GCC43)
  • -Wdisabled-optimization (unless GCC295 is set)
ERRORMODE All warnings are treated as errors (-Werror). Automatically turns on WARNINGMODE when set.
VCHELP Requires WARNINGMODE

Compiles with declaration-after-statement warnings. (Automatically turned on if GCC41 is set.)

Warning flags added:

  • -Wdeclaration-after-statement
  • -Wno-error=declaration-after-statement
NOCASTALIGNWARN Requires WARNINGMODE

Compiles without pointer cast alignment warnings (-Wcast-align)

NOLDWARNING Adds -Wl,--as-needed to the linker flags

GCC flags

Name Description
GCC29 Includes GCC 2.9-only options

Other notes:

  • (if NONX86 is not set) Compiles with -mpentium instead of -march=pentium
GCC295 Includes GCC 2.95-only options (automatically turns on GCC29 when set)

Disables the following WARNINGMODE-only warning flags:

  • -Wno-div-by-zero
  • -Wendif-labels
  • -Wdisabled-optimization
GCC40 Includes GCC 4.0-only options

Warning flags added:

  • -Wold-style-definition (requires WARNINGMODE)
  • -Wmissing-field-initializers (requires WARNINGMODE)
GCC41 Includes GCC 4.1-only options (automatically turns on GCC40 and VCHELP when set)

Warning flags added:

  • -Wshadow (requires WARNINGMODE)
GCC42 Includes GCC 4.2-only options (automatically turns on GCC41 when set)
GCC43 Includes GCC 4.3-only options (automatically turns on GCC42 when set)

Warning flags added:

  • -funit-at-a-time (requires WARNINGMODE)
  • -Wlogical-op (requires WARNINGMODE)
GCC44 Includes GCC 4.4-only options (automatically turns on GCC43 when set)

Warning flags added:

  • -Wno-error=array-bounds
GCC45 Includes GCC 4.5-only options (automatically turns on GCC44 when set)

Warning flags added:

  • -Wlogical-op (requires WARNINGMODE)
GCC46 Includes GCC 4.6-only options (automatically turns on GCC45 when set)

Warning flags added:

  • -Wno-suggest-attribute=noreturn
  • -Wno-error=suggest-attribute=noreturn
GCC47 Includes GCC 4.7-only options (automatically turns on GCC46 when set)
GCC48 Includes GCC 4.8-only options (automatically turns on GCC47 when set)

Other notes:

  • DEBUGMODE=1 compiles with -Og instead of -O0
GCC49 Includes GCC 4.9-only options (automatically turns on GCC48 when set)
GCC51 Includes GCC 5.1-only options (automatically turns on GCC49 when set)
GCC52 Includes GCC 5.2-only options (automatically turns on GCC51 when set)
GCC53 Includes GCC 5.3-only options (automatically turns on GCC52 when set)
GCC54 Includes GCC 5.4-only options (automatically turns on GCC53 when set)

Warning flags added:

  • -Wno-logical-op
  • -Wno-error=logical-op
GCC61 Includes GCC 6.1-only options (automatically turns on GCC54 when set)

Warning flags added:

  • -Wno-tautological-compare
  • -Wno-error=tautological-compare
GCC62 Includes GCC 6.2-only options (automatically turns on GCC61 when set)
GCC63 Includes GCC 6.3-only options (automatically turns on GCC62 when set)
GCC64 Includes GCC 6.4-only options (automatically turns on GCC63 when set)
GCC71 Includes GCC 7.1-only options (automatically turns on GCC64 when set)

Warning flags added:

  • -Wno-error=format-overflow=2
  • -Wimplicit-fallthrough=4
GCC72 Includes GCC 7.2-only options (automatically turns on GCC71 when set)
GCC80 Includes GCC 8.0-only options (automatically turns on GCC72 when set)
GCC81 Includes GCC 8.1-only options (automatically turns on GCC80 when set)

Warning flags added:

  • -Wno-error=format-overflow
  • -Wno-error=stringop-truncation
  • -Wno-error=stringop-overflow
  • -Wno-format-overflow
  • -Wno-stringop-truncation
  • -Wno-stringop-overflow
  • -Wno-error=multistatement-macro
GCC82 Includes GCC 8.2-only options (automatically turns on GCC81 when set)
GCC83 Includes GCC 8.3-only options (automatically turns on GCC82 when set)
GCC91 Includes GCC 9.1-only options (automatically turns on GCC83 when set)

Warning flags added:

  • -Wno-error=address-of-packed-member

Debugging

These flags toggle on/off compiling of debugging tools and other options for debugging SRB2 after compiling it.

Name Description
DEBUGMODE Compiles a debug version of SRB2 (Outputs to /Debug instead of /Release in the bin directory for the port being compiled for)
PROFILEMODE Compiles with profiling information (see gprof)
NOOBJDUMP Does not dump debugging info in output folder (if VALGRIND is set, this is not needed)

Compiles with STABS for debugging instead of DWARF 2

ZDEBUG Compiles with debugging for zone memory allocation code
VALGRIND Compiles with Valgrind
RDB Requires DJGPPDOS

Compiles with GDB stubs (for remote debugging)

MOBJCONSISTANCY Compiles with mobj consistency checking code
PACKETDROP Compiles with packet drop testing code

Libraries

These flags toggle on/off compiling of libraries supported by SRB2, or various options linked to them. For manipulating C compiler/linker flags relating to some of these libraries, see the Compiler flags (Libraries) section.

Main dependencies

Name Description
NOZLIB Compiles without zlib. This will also turn on NOPNG if used, as zlib is required for PNG support.
NOPNG Compiles without libpng, will fall back on PCX/TGA code instead of PNG for screenshots
PNG_STATIC libpng library is statically linked. Not used if compiling with MINGW unless PNG_CONFIG is also defined
NOGME If compiling with LINUX, does not compile with HAVE_GME
HAVE_LIBGME Compiles with Game Music Emu library (see /libs/gme); turned on by default if compiling with MINGW, MINGW64, or LINUX (and not with NOGME, in the last case)
NOOPENMPT Compiles without libopenmpt
NOCURL Compiles without libcurl, note that libcurl is required for the Master Server, so setting this flag will disable master server support too.
NOUPNP Compiles without HAVE_MINIUPNPC
HAVE_MINIUPNPC Compiles with MiniUPnP's client library, MiniUPnPc (see libs/miniupnpc); turned on by default if compiling with MINGW, but not with MINGW64
GETTEXT Compiles with gettext, see libs/gettext
CCBS Requires MINGW and GETTEXT

Don't use libs/gettext/bin32/msgfmt.exe (useful for compiling builds for Windows on Unix systems[confirm? – discuss])

STATIC_GETTEXT Requires MINGW and GETTEXT

gettext libraries are statically linked; turned on by default if compiling with MINGW (and not with MINGW64)

SDL libraries

These toggle on/off support for separate libraries designed to work with SDL. Note that by default, compiling with SDL will also include support for SDL_mixer (and SDL_main if compiling for Windows).

Name Description
NOMIXER Requires SDL

Compiles without SDL_mixer, fall back on sdl_sound.c code

NOMIXERX Requires SDL

Compiles without SDL Mixer X

HAVE_MIXERX Requires SDL

Compiles with SDL Mixer X (Advanced Sound and MIDI support)

SDL_TTF Requires SDL

Compiles with SDL_ttf (TrueType font rendering support)

SDL_IMAGE Requires SDL

Compiles with SDL_image (support for multiple image formats)

SDL_NET Requires SDL

Compiles with SDL_net (networking support)

SDLMAIN Requires SDL

Compiles with SDL_main.h (redefines main() on Win32/MacOS); turned on by default if compiling with MINGW and SDL (and not NOSDLMAIN)

NOSDLMAIN If compiling with MINGW and SDL, does not compile with SDLMAIN

Sound drivers

Name Description
OPENAL Requires SDL

OpenAL sound driver

FMOD Requires SDL

FMOD 3D sound driver

DS3D Requires SDL and MINGW

DirectSound3D sound driver

NOHS Compiles without 3D sound support
STATICHS Requires SDL

3D sound libraries are statically linked

Other

Name Description
NOTERMIOS Requires SDL and UNIXCOMMON

Compiles without termios, the Unix API for terminal I/O

WATTCP Requires DJGPPDOS

Compiles for DOS using WatTCP (Waterloo TCP/IP)
(Outputs srb2dos.exe to bin/djgppdos/wattcp)

Miscellaneous

Name Description
DISTCC Compiles with distcc
CCACHE Compiles with ccache
NONET Compiles without netplay
NOHW Compiles without hardware mode (OpenGL) support
NOIPX Compiles without IPX
NOMD5 Compiles without MD5 support
NOUPX Compiles without UPX
NONX86 Compiles for non-x86 processors
NOPOSTPROCESSING Compiles without support for post-processing effects (including screenshots, movies and screen fades)
NO_IPV6 Compiles without IPv6 support
X86_64 Compiles for x86-64. Turned on by default if compiling with MINGW64.
WITHDATA Requires PANDORA

Downloads SRB2's resource files from a pre-determined URL (Note: the URL currently used contains the files for v2.0.6, an outdated version of SRB2)

NOTHREADS Compiles without Multithreading support

Variables

Unlike the flags in the previous sections, these are not simple on/off toggles but are variables that all take string values which determine options such as the names and paths of programs and tools to be used during compiling, compiler/linker flags for including libraries, and the name of the output executable.

Note that variables that specify a path can alternatively take the name of the program with no path, provided the program's path is already in your system's PATH environment variable.

For instance, when compiling on Windows, C:\MinGW\bin being in the PATH variable allows the following flag:

CC="C:\MinGW\bin\gcc.exe"

to be shortened to

CC=gcc

This works because gcc.exe is a file within C:\MinGW\bin, so the program can be specified directly instead of through its full path. However, this does not work if MinGW was installed in a different directory.

Compilers

Name Description
CC=path Determines the path for the program for compiling C programs; defaults to cc. For compiling SRB2 on Windows this should normally be set to gcc

Compiler flags (Main)

Name Description
CFLAGS=flags Extra flags to give to the C compiler
CPPFLAGS=flags Extra flags to give to the C preprocessor and programs that use it
LDFLAGS=flags Extra flags to give to compilers when they are supposed to invoke the linker
ASFLAGS=flags Extra flags to give to the assembler. This is used for compiling vid_copy.o prerequisites vid_copy.s and asm_defs.inc
WFLAGS=flags Extra warning flags for the C compiler. This does not overwrite any default warning options set, only adds to them.

Utilities/tools

Name Description
PKG_CONFIG=path Determines the path for pkg-config, a programming tool for inserting correct compiler options for libraries. Defaults to pkg-config
REMOVE=path_and_options Determines the path and options for rm, the Unix program for removing objects such as files from the filesystem. Defaults to rm -f.

Note: This program is used to remove the temporary file depend.ped during normal compiling, and by the clear target to remove all .o files in the corresponding objs folder. If rm is not available on the computer, both these actions will fail

MKDIR=path_and_options Determines the path and options for mkdir, the Unix program for making new directories. Defaults to mkdir -p
GZIP=path Determines the path for gzip. Defaults to gzip
GZIP_OPTS=options Determines options for gzip. Default is -9 -f -n. Note: --rsyncable will be appended onto these options, whether the default options or custom options are used.
UPX=path Will not be used if NOUPX is set

Determines the path for UPX. Defaults to upx

UPX_OPTS=options Will not be used if NOUPX is set

Determines options for UPX. Defaults to --best --preserve-build-id

MSGFMT=path Requires GETTEXT

Determines the path for msgfmt. Defaults to msgfmt. If MINGW is set and CCBS is not, defaults to ../libs/gettext/bin32/msgfmt.exe instead

Compiler flags (Libraries)

Name Description
SDL_CFLAGS=flags Requires SDL

Extra C compiler flags for compiling with SDL libraries

Default values:

  • MINGW=1: -I../libs/SDL2/i686-w64-mingw32/include/SDL2 -I../libs/SDLMixerX/i686-w64-mingw32/include/SDL2 -Dmain=SDL_main
  • MINGW64=1: -I../libs/SDL2/x86_64-w64-mingw32/include/SDL2 -I../libs/SDLMixerX/x86_64-w64-mingw32/include/SDL2 -Dmain=SDL_main
  • MINGW=1 NOMIXERX=1: -I../libs/SDL2/i686-w64-mingw32/include/SDL2 -I../libs/SDL2_mixer/i686-w64-mingw32/include/SDL2 -Dmain=SDL_main
  • MINGW64=1 NOMIXERX=1: -I../libs/SDL2/x86_64-w64-mingw32/include/SDL2 -I../libs/SDL2_mixer/x86_64-w64-mingw32/include/SDL2 -Dmain=SDL_main

If not compiling with either of the above, SDL_CONFIG (or SDL_PKGCONFIG, if it is defined) is used to set the C compiler flags by default

SDL_LDFLAGS=flags Requires SDL

Extra linker flags for compiling with SDL libraries

Default values:

  • MINGW=1: -L../libs/SDL2/i686-w64-mingw32/lib -L../libs/SDLMixerX/i686-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
  • MINGW64=1: -L../libs/SDL2/x86_64-w64-mingw32/lib -L../libs/SDLMixerX/x86_64-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
  • MINGW=1 NOMIXERX=1: -L../libs/SDL2/i686-w64-mingw32/lib -L../libs/SDL2_mixer/i686-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
  • MINGW64=1 NOMIXERX=1: -L../libs/SDL2/x86_64-w64-mingw32/lib -L../libs/SDL2_mixer/x86_64-w64-mingw32/lib -lmingw32 -lSDL2main -lSDL2 -mwindows

If not compiling with either of the above, SDL_CONFIG (or SDL_PKGCONFIG, if it is defined) is used to set the linker flags by default

SDL_PKGCONFIG=name Requires SDL

Name of .pc file for pkg-config to use to get compiler and linker flags for SDL libraries(No default value)

SDL_CONFIG=name Requires SDL

Name of script to use to get compiler and linker flags for SDL libraries. Defaults to sdl2-config.

If Cross-Compiling, setting this to */bin/sdl-config may help (With * being either /usr or /usr/local directories depending on where your sdl-config is found).

Note: this is only used if SDL_PKGCONFIG has not been set

ZLIB_CFLAGS=flags Extra C compiler flags for compiling with zlib

Default value:

  • MINGW=1: -I../libs/zlib
ZLIB_LDFLAGS=flags Extra linker flags for compiling with zlib

Default values:

  • MINGW=1: -L../libs/zlib/win32 -lz32
  • MINGW64=1: -L../libs/zlib/win32 -lz64

If not compiling with either of the above, ZLIB_PKGCONFIG is used to set the C compiler flags by default

ZLIB_PKGCONFIG=name Name of .pc file for pkg-config to use to get compiler and linker flags for zlib. Defaults to zlib
PNG_CFLAGS=flags Will not be used if NOPNG is set

Extra C compiler flags for compiling with libpng

Default value:

  • MINGW=1: -I../libs/libpng-src

If not compiling with the above, PNG_CONFIG (or PNG_PKGCONFIG, if it is defined) is used to set the C compiler flags by default

PNG_LDFLAGS=flags Will not be used if NOPNG is set

Extra linker flags for compiling with libpng

Default values:

  • MINGW=1: -L../libs/libpng-src/projects -lpng32
  • MINGW64=1: -L../libs/libpng-src/projects -lpng64

If not compiling with either of the above, PNG_CONFIG (or PNG_PKGCONFIG, if it is defined) is used to set the C compiler flags by default

PNG_PKGCONFIG=name Will not be used if NOPNG is set

Name of .pc file for pkg-config to use to get compiler and linker flags for libpng (No default value)

PNG_CONFIG=text Will not be used if NOPNG is set

Name of script to use to get compiler and linker flags for libpng. Defaults to libpng-config

Note: this is only used as a fallback if PNG_PKGCONFIG has not been set

VALGRIND_PKGCONFIG=name Requires VALGRIND

Name of .pc file for pkg-config to use to get compiler and linker flags for Valgrind. Defaults to valgrind

VALGRIND_CFLAGS=flags Requires VALGRIND

Extra C compiler flags for compiling with Valgrind. These are only used when compiling z_zone.c

VALGRIND_LDFLAGS=flags Requires VALGRIND

Extra linker flags for compiling with Valgrind

LIBGME_CFLAGS=flags Requires HAVE_LIBGME

Extra C compiler flags for compiling with the Game Music Emu library

Default values:

  • MINGW=1: -I../libs/gme/include
  • MINGW64=1: -I../libs/gme/include

If not compiling with the above, LIBGME_PKGCONFIG is used to set the C compiler flags by default

LIBGME_LDFLAGS=flags Requires HAVE_LIBGME

Extra linker flags for compiling with the Game Music Emu library

Default values:

  • MINGW=1: -L../libs/gme/win32 -lgme
  • MINGW64=1: -L../libs/gme/win64 -lgme

If not compiling with the above, LIBGME_PKGCONFIG is used to set the C compiler flags by default

LIBGME_PKGCONFIG=name Requires HAVE_LIBGME

Name of .pc file for pkg-config to use to get compiler and linker flags for the Game Music Emu library. Defaults to libgme

LIBOPENMPT_PKGCONFIG=name Will not be used if NOOPENMPT is set

Name of .pc file for pkg-config to use to get compiler and linker flags for the libopenmpt library. Defaults to libopenmpt

LIBOPENMPT_CFLAGS=flags Will not be used if NOOPENMPT is set

Extra C compiler flags for compiling with the libopenmpt library

Default values:

  • MINGW=1: -I../libs/libopenmpt/inc
  • MINGW64=1: -I../libs/libopenmpt/inc

If not compiling with the above, LIBOPENMPT_PKGCONFIG is used to set the C compiler flags by default

LIBOPENMPT_LDFLAGS=flags Will not be used if NOOPENMPT is set

Extra linker flags for compiling with the libopenmpt library

Default values:

  • MINGW=1: -L../libs/libopenmpt/lib/x86/mingw -lopenmpt
  • MINGW64=1: -L../libs/libopenmpt/lib/x86_64/mingw -lopenmpt

If not compiling with the above, LIBOPENMPT_PKGCONFIG is used to set the C compiler flags by default

LUA_CFLAGS=flags Extra C compiler flags for compiling files from the src/blua directory. If compiling with UNIXCOMMON (or anything that automatically sets it) or LINUX, -DLUA_USE_POSIX will be appended onto this variable

Miscellaneous

Name Description
D_DIR=path Determines the path to use as the resources directory; i.e. where the game's data files are kept. Defaults to ../bin/Resources

Note: This variable is only used in SRB2's Makefile when compiling for Pandora (PANDORA=1), for finding the game's asset files (srb2.srb, zones.dta, etc); they are not currently present in the default folder however (except for the dlls), so they would need to be added manually.

EXENAME=name Name of the output executable. Default depends on the compilation options (listed by order of precedence):
  • DUMMY=1: srb2dummy (no extension)
  • DJGPPDOS=1 WATTCP=1: srb2dos.exe
  • DJGPPDOS=1: srb2w16.exe
  • MINGW=1 SDL=1: srb2win.exe
  • MINGW=1: srb2dd.exe
  • All the below: lsdl2srb2 (no extension)
    • LINUX=1
    • LINUX64=1
    • SOLARIS=1
    • FREEBSD=1
    • UNIX=1 SDL=1
    • MACOSX=1 SDL=1
    • UNIXCOMMON=1 SDL=1
  • CYGWIN32=1: lsdlsrb2.exe
  • Fallback default, if none of the above: srb2 (no extension)
DBGNAME=name Name of the output debug file to go with the executable. Defaults to $(EXENAME).debug
PREFIX=name Used for cross-compiling. The compiler or assembler you're using is automatically appended to the end of this variable.

Usage on Linux

Note
If you're using this variable with GCC, you'll want to specify what GCC Flags you're using.
  • PREFIX=x86_64-w64-mingw32 MINGW64=1 - Compiles for 64-bit Windows.
  • PREFIX=i686-w64-mingw32 MINGW=1 - Compiles for 32-bit Windows.
ARCHNAME=name If set, this overrides the default output and object file directories with a user-defined subfolder name in both bin and objs, i.e. the output and object file directories are set to bin/name and objs/name instead.
ARCHOPTS=options Determines architecture-related options.

Default values:

  • (none): -march=pentium
  • GCC29=1: -mpentium
  • NONX86=1 X86_64=1: -march=nocona