2010-12-19 22:29:01 +00:00
|
|
|
|
|
|
|
## common definitions for Makefile, build/Makefile, source/enet/Makefile and
|
|
|
|
## source/jaudiolib/Makefile
|
|
|
|
|
2013-08-11 15:28:42 +00:00
|
|
|
# NOTE: make's 'dir' function keeps a trailing shash, the 'abspath' does not!
|
|
|
|
MAKEFILE_COMMON_DIR:=$(abspath $(dir $(lastword $(MAKEFILE_LIST))))
|
2012-12-13 02:34:30 +00:00
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
# Use colored output
|
2011-02-12 13:25:24 +00:00
|
|
|
PRETTY_OUTPUT ?= 1
|
2010-12-19 22:29:01 +00:00
|
|
|
|
2012-10-29 04:26:25 +00:00
|
|
|
# Tools
|
2013-07-20 03:36:54 +00:00
|
|
|
CROSS=
|
|
|
|
CC=$(CROSS)gcc
|
|
|
|
CXX=$(CROSS)g++
|
|
|
|
AS=$(CROSS)nasm
|
|
|
|
AR=$(CROSS)ar
|
|
|
|
RC=$(CROSS)windres
|
|
|
|
RANLIB=$(CROSS)ranlib
|
|
|
|
STRIP=$(CROSS)strip
|
2012-10-29 04:26:25 +00:00
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
L_CC=$(CC)
|
|
|
|
L_CXX=$(CXX)
|
|
|
|
|
2012-10-29 04:26:25 +00:00
|
|
|
CLANG?=0
|
|
|
|
|
|
|
|
ifneq (0,$(CLANG))
|
2012-11-05 02:49:08 +00:00
|
|
|
CC=clang -x c -std=gnu89
|
|
|
|
CXX=clang -x c++
|
2012-11-06 07:49:44 +00:00
|
|
|
L_CC=clang -std=gnu89
|
|
|
|
L_CXX=clang
|
2012-10-29 04:26:25 +00:00
|
|
|
endif
|
|
|
|
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
|
|
|
|
ifeq ($(PLATFORM),WII)
|
|
|
|
ifeq ($(strip $(DEVKITPPC)),)
|
|
|
|
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
|
|
|
endif
|
|
|
|
|
|
|
|
include $(DEVKITPPC)/wii_rules
|
|
|
|
|
|
|
|
RANLIB=powerpc-eabi-ranlib
|
|
|
|
STRIP=powerpc-eabi-strip
|
|
|
|
endif
|
|
|
|
|
2012-10-29 04:26:25 +00:00
|
|
|
# GCC version, for conditional selection of flags.
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifndef GCC_MAJOR
|
|
|
|
GCC_MAJOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f1)
|
|
|
|
endif
|
|
|
|
ifeq ($(GCC_MAJOR),)
|
|
|
|
GCC_MAJOR := 4
|
|
|
|
endif
|
|
|
|
ifndef GCC_MINOR
|
|
|
|
GCC_MINOR := $(shell $(CC) -dumpversion 2>&1 | cut -d'.' -f2)
|
|
|
|
endif
|
|
|
|
ifeq ($(GCC_MINOR),)
|
|
|
|
GCC_MINOR := 7
|
|
|
|
endif
|
2012-10-29 04:26:25 +00:00
|
|
|
|
|
|
|
# Detect machine architecture
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifndef SYSARCH
|
|
|
|
SYSARCH:=$(strip $(shell uname -m))
|
|
|
|
endif
|
2012-10-29 04:26:25 +00:00
|
|
|
|
|
|
|
# Detect the platform if it wasn't explicitly given to us from
|
|
|
|
# the outside world. This allows cross-compilation by overriding
|
|
|
|
# CC and giving us PLATFORM specifically.
|
|
|
|
#
|
|
|
|
ifndef PLATFORM
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
uname:=$(strip $(shell uname -s))
|
2012-10-29 04:26:25 +00:00
|
|
|
PLATFORM=UNKNOWN
|
|
|
|
ifeq ($(findstring Linux,$(uname)),Linux)
|
|
|
|
PLATFORM=LINUX
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring BSD,$(uname)),BSD)
|
|
|
|
PLATFORM=BSD
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring MINGW,$(uname)),MINGW)
|
|
|
|
PLATFORM=WINDOWS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring Darwin,$(uname)),Darwin)
|
|
|
|
PLATFORM=DARWIN
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring BeOS,$(uname)),BeOS)
|
|
|
|
PLATFORM=BEOS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring skyos,$(uname)),skyos)
|
|
|
|
PLATFORM=SKYOS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring QNX,$(uname)),QNX)
|
|
|
|
PLATFORM=QNX
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring SunOS,$(uname)),SunOS)
|
|
|
|
PLATFORM=SUNOS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring syllable,$(uname)),syllable)
|
|
|
|
PLATFORM=SYLLABLE
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2012-12-13 02:32:59 +00:00
|
|
|
ifndef SUBPLATFORM
|
|
|
|
SUBPLATFORM=
|
|
|
|
ifeq ($(PLATFORM),LINUX)
|
|
|
|
SUBPLATFORM=LINUX
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),DINGOO)
|
|
|
|
SUBPLATFORM=LINUX
|
2013-07-20 03:36:54 +00:00
|
|
|
CROSS=mipsel-linux-
|
2012-12-13 02:32:59 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),GCW)
|
|
|
|
SUBPLATFORM=LINUX
|
2013-07-20 03:36:54 +00:00
|
|
|
CROSS=mipsel-linux-
|
2012-12-13 02:32:59 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),CAANOO)
|
|
|
|
SUBPLATFORM=LINUX
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
|
|
|
|
|
2012-03-14 06:27:45 +00:00
|
|
|
# Binary suffix override:
|
|
|
|
EXESUFFIX_OVERRIDE ?=
|
|
|
|
|
2012-03-04 09:31:37 +00:00
|
|
|
# Mac OS X Frameworks location
|
|
|
|
# Like above, use absolute paths.
|
|
|
|
APPLE_FRAMEWORKS ?=/Library/Frameworks
|
2013-01-04 17:28:13 +00:00
|
|
|
# Without the resource files packaged in the .app bundle, the startupwindow produces errors, so give it an off switch.
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
OSX_STARTUPWINDOW ?= 1
|
2012-03-04 09:31:37 +00:00
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
# Engine options
|
2011-03-04 08:50:58 +00:00
|
|
|
# USE_OPENGL - enables basic OpenGL Polymost renderer
|
|
|
|
# POLYMER - enables fancy Polymer renderer
|
2010-12-19 22:29:01 +00:00
|
|
|
# NOASM - disables the use of inline assembly pragmas
|
|
|
|
# LINKED_GTK - enables compile-time linkage to GTK
|
|
|
|
#
|
|
|
|
POLYMER = 1
|
|
|
|
USE_OPENGL = 1
|
|
|
|
NOASM = 0
|
|
|
|
LINKED_GTK = 0
|
2011-06-17 13:11:19 +00:00
|
|
|
BUILD32_ON_64 ?= 0
|
2011-03-19 17:59:09 +00:00
|
|
|
# DO NOT SET THIS TO 1 AND COMMIT IT.
|
2012-07-20 21:57:53 +00:00
|
|
|
USE_LIBPNG ?= 1
|
2011-10-11 16:53:52 +00:00
|
|
|
USE_LIBVPX ?= 1
|
2012-12-09 13:24:44 +00:00
|
|
|
NETCODE ?= 1
|
2013-07-13 21:05:05 +00:00
|
|
|
LUNATIC ?= 0
|
2012-10-29 04:26:25 +00:00
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
ifeq (0,$(USE_OPENGL))
|
|
|
|
POLYMER = 0
|
2011-07-18 19:06:29 +00:00
|
|
|
USE_LIBVPX = 0
|
2010-12-19 22:29:01 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Debugging/Build options
|
2012-11-05 02:49:08 +00:00
|
|
|
# CPLUSPLUS - 1 = enable C++ building
|
2010-12-19 22:29:01 +00:00
|
|
|
# RELEASE - 1 = no debugging
|
|
|
|
# DEBUGANYWAY - 1 = include debug symbols even when generating release code
|
2012-11-05 02:49:08 +00:00
|
|
|
# DISABLEINLINING - 1 = compile inline functions as extern instead of static inline
|
2012-11-26 08:25:26 +00:00
|
|
|
# FORCEWARNINGS - 1 = do not disable any compiler warnings within the source
|
2010-12-19 22:29:01 +00:00
|
|
|
# KRANDDEBUG - 1 = include logging of krand() calls for debugging the demo system
|
|
|
|
# EFENCE - 1 = compile with Electric Fence for malloc() debugging
|
|
|
|
# OPTLEVEL - 0..3 = GCC optimization strategy
|
2011-03-25 11:42:07 +00:00
|
|
|
# LTO - 1 = enable link-time optimization, for GCC 4.5 and up
|
2010-12-19 22:29:01 +00:00
|
|
|
#
|
2012-11-05 02:49:08 +00:00
|
|
|
CPLUSPLUS?=0
|
2010-12-19 22:29:01 +00:00
|
|
|
RELEASE?=1
|
|
|
|
DEBUGANYWAY?=0
|
|
|
|
KRANDDEBUG?=0
|
2012-11-05 02:49:08 +00:00
|
|
|
DISABLEINLINING?=0
|
2012-11-26 08:25:26 +00:00
|
|
|
FORCEWARNINGS?=0
|
2010-12-19 22:29:01 +00:00
|
|
|
EFENCE?=0
|
2012-01-12 20:49:34 +00:00
|
|
|
DMALLOC?=0
|
2010-12-19 22:29:01 +00:00
|
|
|
PROFILER?=0
|
2011-03-19 17:59:09 +00:00
|
|
|
MUDFLAP?=0
|
2012-11-06 07:49:44 +00:00
|
|
|
|
2013-05-04 16:36:10 +00:00
|
|
|
# Select the default optimization level for release and debug builds.
|
2013-05-06 03:12:29 +00:00
|
|
|
ifeq ($(RELEASE),0)
|
2013-05-04 16:36:10 +00:00
|
|
|
OPTLEVEL?=0
|
|
|
|
else
|
|
|
|
OPTLEVEL?=2
|
|
|
|
endif
|
|
|
|
|
2013-01-20 21:17:36 +00:00
|
|
|
ifeq ($(RELEASE),0)
|
2013-01-21 21:18:10 +00:00
|
|
|
override STRIP=
|
2013-01-20 21:17:36 +00:00
|
|
|
endif
|
|
|
|
ifneq ($(DEBUGANYWAY),0)
|
2013-01-21 21:18:10 +00:00
|
|
|
override STRIP=
|
2013-01-20 21:17:36 +00:00
|
|
|
endif
|
|
|
|
|
2013-07-13 21:05:05 +00:00
|
|
|
ifneq ($(LUNATIC),0)
|
|
|
|
# FIXME: Lunatic builds with LTO don't start up properly as the required
|
|
|
|
# symbol names are apparently not exported.
|
|
|
|
override LTO=0
|
|
|
|
endif
|
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
ifndef LTO
|
|
|
|
LTO=1
|
|
|
|
ifneq (0,$(CLANG))
|
|
|
|
ifeq ($(PLATFORM), WINDOWS)
|
|
|
|
LTO=0
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4)))
|
2012-10-29 04:26:25 +00:00
|
|
|
F_NO_STACK_PROTECTOR := -fno-stack-protector
|
|
|
|
# there are some link-time issues with stack protectors, so make it possible to override
|
|
|
|
F_STACK_PROTECTOR_ALL ?= -fstack-protector-all
|
|
|
|
ifeq (0,$(CLANG))
|
|
|
|
F_JUMP_TABLES := -fjump-tables
|
|
|
|
endif
|
|
|
|
M_TUNE_GENERIC := -mtune=generic
|
|
|
|
M_STACKREALIGN := -mstackrealign
|
2013-07-18 18:08:16 +00:00
|
|
|
W_STRICT_OVERFLOW := -Wno-strict-overflow
|
2012-10-29 04:26:25 +00:00
|
|
|
endif
|
|
|
|
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
|
|
|
ifndef COMPILERTARGET
|
|
|
|
COMPILERTARGET:=$(strip $(shell $(CC) -dumpmachine))
|
|
|
|
endif
|
|
|
|
|
|
|
|
WINBITS=32
|
|
|
|
ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
|
|
|
|
SYSARCH:=x86_64
|
|
|
|
WINBITS=64
|
|
|
|
endif
|
|
|
|
|
|
|
|
WINLIB?=/$(WINBITS)
|
|
|
|
endif
|
|
|
|
|
2012-10-29 04:26:25 +00:00
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifndef DARWINVERSION
|
|
|
|
DARWINVERSION:=$(strip $(shell uname -r | cut -d . -f 1))
|
|
|
|
endif
|
2012-10-29 04:26:25 +00:00
|
|
|
ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10)))
|
|
|
|
DARWIN9 ?= 1
|
|
|
|
endif
|
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
# BASECOMMONFLAGS += -fno-leading-underscore
|
2012-10-29 04:26:25 +00:00
|
|
|
|
|
|
|
ifeq (1,$(DARWIN9))
|
|
|
|
F_JUMP_TABLES :=
|
|
|
|
W_STRICT_OVERFLOW :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (1,$(BUILD32_ON_64))
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS += $(F_NO_STACK_PROTECTOR)
|
2012-10-29 04:26:25 +00:00
|
|
|
else
|
|
|
|
ifeq ($(findstring ppc,$(ARCH)),ppc)
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS += $(F_NO_STACK_PROTECTOR)
|
2012-10-29 04:26:25 +00:00
|
|
|
endif
|
|
|
|
endif
|
2012-12-29 10:54:35 +00:00
|
|
|
ifneq (0,$(OSX_STARTUPWINDOW))
|
|
|
|
BASECOMMONFLAGS+= -DOSX_STARTUPWINDOW
|
|
|
|
endif
|
2012-10-29 04:26:25 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef OPTOPT
|
|
|
|
ifeq ($(PLATFORM), WII)
|
|
|
|
OPTOPT=
|
|
|
|
else
|
|
|
|
OPTOPTARCH=$(ARCH)
|
|
|
|
ifeq (,$(OPTOPTARCH))
|
|
|
|
OPTOPTARCH=$(SYSARCH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (i686,$(findstring i686, $(OPTOPTARCH)))
|
|
|
|
OPTOPT=-march=pentium3 $(M_TUNE_GENERIC) -mmmx
|
|
|
|
# -msse2 -mfpmath=sse,387 -malign-double $(M_STACKREALIGN)
|
|
|
|
else
|
|
|
|
OPTOPT=
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq (,$(CUSTOMOPT))
|
|
|
|
OPTOPT+= $(CUSTOMOPT)
|
|
|
|
endif
|
|
|
|
endif
|
2010-12-19 22:29:01 +00:00
|
|
|
|
|
|
|
ifneq (0,$(KRANDDEBUG))
|
|
|
|
RELEASE=0
|
|
|
|
endif
|
|
|
|
ifneq (0,$(PROFILER))
|
|
|
|
DEBUGANYWAY=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-03-12 04:49:16 +00:00
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
# compiler flags etc.
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
BASECFLAGS=
|
2012-10-29 04:28:10 +00:00
|
|
|
BASECONLYFLAGS=-Wimplicit -Wdeclaration-after-statement
|
2013-04-17 20:34:51 +00:00
|
|
|
BASECXXFLAGS= -fno-exceptions -fno-rtti -fpermissive -Wno-write-strings
|
2012-03-23 20:22:10 +00:00
|
|
|
BASEASFLAGS=-s #-g
|
|
|
|
BASELDFLAGS=
|
|
|
|
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
|
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4)))
|
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MINOR) \>= 1)))
|
|
|
|
BASECFLAGS+= -Wno-attributes
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-04-17 20:34:51 +00:00
|
|
|
# XXX: I (Helixhorned) only know that there's no -Wnarrowing on my OS X 10.6 using GCC 4.2.
|
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4)))
|
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MINOR) \>= 3)))
|
|
|
|
BASECXXFLAGS+= -Wno-narrowing
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2012-05-20 07:25:25 +00:00
|
|
|
ifeq ($(PLATFORM),WII)
|
|
|
|
override USE_LIBVPX = 0
|
|
|
|
endif
|
2013-07-20 03:36:54 +00:00
|
|
|
ifeq ($(PLATFORM),GCW)
|
|
|
|
override USE_LIBVPX = 0
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),DINGOO)
|
|
|
|
override USE_LIBVPX = 0
|
|
|
|
endif
|
2012-05-20 07:25:25 +00:00
|
|
|
|
2012-11-24 09:13:29 +00:00
|
|
|
BASELIBS=-lm
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
BASELIBDIRS=
|
2011-07-18 19:06:29 +00:00
|
|
|
ifneq (0,$(USE_LIBVPX))
|
2011-09-21 22:38:37 +00:00
|
|
|
# On Windows, we link statically to libvpx
|
2012-11-24 09:13:29 +00:00
|
|
|
BASELIBS+= -lvpx
|
2011-07-18 19:06:29 +00:00
|
|
|
endif
|
2011-03-19 18:07:12 +00:00
|
|
|
|
2012-01-28 14:36:52 +00:00
|
|
|
|
|
|
|
ifneq ($(RELEASE)$(DEBUGANYWAY),10)
|
|
|
|
# debug build or DEBUGANYWAY=1 --> -g flag
|
2012-05-18 21:40:38 +00:00
|
|
|
ifneq (0,$(CLANG))
|
2012-01-28 14:36:52 +00:00
|
|
|
debug=-g
|
2012-05-20 07:25:25 +00:00
|
|
|
else ifeq ($(PLATFORM), WII)
|
|
|
|
debug=-g
|
2012-01-28 14:36:52 +00:00
|
|
|
else
|
|
|
|
debug=-ggdb
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-05-04 16:36:10 +00:00
|
|
|
debug+= -O$(OPTLEVEL)
|
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
ifneq (0,$(RELEASE))
|
|
|
|
# Debugging disabled
|
2012-05-18 21:40:38 +00:00
|
|
|
ifeq (0,$(CLANG))
|
2012-01-28 14:36:52 +00:00
|
|
|
debug+= -funswitch-loops
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \< 4)))
|
|
|
|
LTO=0
|
|
|
|
endif
|
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) = 4)))
|
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MINOR) \< 6)))
|
|
|
|
LTO=0
|
|
|
|
endif
|
|
|
|
endif
|
2011-12-15 22:43:01 +00:00
|
|
|
endif
|
2011-09-22 16:52:55 +00:00
|
|
|
ifeq (0,$(DEBUGANYWAY))
|
2012-01-07 20:37:48 +00:00
|
|
|
debug+= -fomit-frame-pointer -DNDEBUG
|
2012-11-09 22:31:02 +00:00
|
|
|
else
|
|
|
|
debug+= -DDEBUGGINGAIDS
|
2011-09-22 16:52:55 +00:00
|
|
|
endif
|
2011-03-25 11:42:07 +00:00
|
|
|
ifneq (0,$(LTO))
|
2012-03-23 20:22:10 +00:00
|
|
|
BASELDFLAGS+= -flto
|
2011-11-10 21:47:03 +00:00
|
|
|
debug+= -DUSING_LTO -flto
|
2011-03-25 11:42:07 +00:00
|
|
|
endif
|
2010-12-19 22:29:01 +00:00
|
|
|
else
|
|
|
|
# Debugging enabled
|
Inreased debugging level for catching oob accesses to 'main' arrays.
If enabled, this makes the following arrays be allocated statically:
spriteext, spritesmooth, sector, wall, sprite, tsprite, while
necessarily disabling the clipshape feature (because it relies on
setting sector/wall to different malloc'd block temporarily).
To compile, pass DEBUGANYWAY=1 in addition to RELEASE=0 to 'make',
and it's really only useful with CC=clang, of course.
git-svn-id: https://svn.eduke32.com/eduke32@2270 1a8010ca-5511-0410-912e-c29ae57300e0
2012-01-19 23:17:34 +00:00
|
|
|
ifeq (0,$(DEBUGANYWAY))
|
|
|
|
debug+= -DDEBUGGINGAIDS
|
|
|
|
else
|
|
|
|
debug+= -DDEBUGGINGAIDS=2
|
|
|
|
endif
|
|
|
|
|
2012-05-18 21:40:38 +00:00
|
|
|
ifneq (0,$(CLANG))
|
2012-12-14 19:28:20 +00:00
|
|
|
# KEEPINSYNC with build/Makefile:
|
2013-04-29 19:24:15 +00:00
|
|
|
# Older Clang (2.9?)
|
|
|
|
# BASECFLAGS+= -Xclang -fcatch-undefined-behavior
|
|
|
|
# Clang 3.2
|
|
|
|
# debug+= -fsanitize=address
|
|
|
|
# Clang 3.3 or SVN
|
|
|
|
debug+= -fsanitize=address -fsanitize=undefined
|
2011-12-09 19:09:00 +00:00
|
|
|
endif
|
2012-12-13 02:32:59 +00:00
|
|
|
ifeq ($(SUBPLATFORM),LINUX)
|
2012-11-24 09:13:29 +00:00
|
|
|
BASELIBS+=-rdynamic
|
2011-01-16 07:19:29 +00:00
|
|
|
endif
|
2011-03-19 17:59:09 +00:00
|
|
|
ifneq (0,$(MUDFLAP))
|
2012-11-24 09:13:29 +00:00
|
|
|
BASELIBS+= -lmudflapth
|
2011-03-19 17:59:09 +00:00
|
|
|
debug+= -fmudflapth
|
|
|
|
endif
|
2010-12-19 22:29:01 +00:00
|
|
|
ifneq (0,$(PROFILER))
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifneq ($(PLATFORM),DARWIN)
|
|
|
|
BASELIBS+= -lprofiler
|
|
|
|
endif
|
2010-12-19 22:29:01 +00:00
|
|
|
debug+= -pg
|
|
|
|
endif
|
|
|
|
ifneq (0,$(KRANDDEBUG))
|
|
|
|
debug+=-DKRANDDEBUG=1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
W_NO_UNUSED_RESULT :=
|
2012-05-18 21:40:38 +00:00
|
|
|
ifeq (0,$(CLANG))
|
2012-08-27 03:48:27 +00:00
|
|
|
# W_NO_UNUSED_RESULT := $(shell echo '' | $(CC) -E -Wno-unused-result - 2>/dev/null && echo -Wno-unused-result)
|
|
|
|
# W_NO_UNUSED_RESULT := $(findstring -Wno-unused-result,$(W_NO_UNUSED_RESULT))
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) \>= 4)))
|
|
|
|
ifeq (1,$(strip $(shell expr $(GCC_MINOR) \>= 4)))
|
|
|
|
W_NO_UNUSED_RESULT := -Wno-unused-result
|
|
|
|
endif
|
|
|
|
endif
|
2011-12-09 19:08:47 +00:00
|
|
|
endif
|
2011-02-12 13:25:24 +00:00
|
|
|
|
2012-10-29 04:28:10 +00:00
|
|
|
CWARNS := -W -Wall -Werror-implicit-function-declaration \
|
2012-07-01 22:11:35 +00:00
|
|
|
-Wpointer-arith \
|
|
|
|
-Wextra \
|
|
|
|
#-Wstrict-prototypes \
|
|
|
|
#-Waggregate-return \
|
|
|
|
#-Wwrite-strings \
|
|
|
|
#-Wcast-qual -Wcast-align \
|
|
|
|
#-Waddress -Wlogical-op
|
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS=$(debug) $(OPTOPT) $(CWARNS) \
|
2010-12-19 22:29:01 +00:00
|
|
|
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \
|
2012-07-01 22:11:35 +00:00
|
|
|
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH)
|
2012-05-18 21:40:38 +00:00
|
|
|
ifneq (0,$(CLANG))
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -Wno-unused-value -Wno-parentheses
|
2011-12-09 19:08:47 +00:00
|
|
|
endif
|
2013-02-18 08:50:08 +00:00
|
|
|
BASECOMMONFLAGS+= -Wno-char-subscripts
|
2011-12-09 19:08:47 +00:00
|
|
|
|
2012-12-09 13:24:44 +00:00
|
|
|
ifeq (0,$(NETCODE))
|
|
|
|
BASECOMMONFLAGS+= -DNETCODE_DISABLE
|
|
|
|
endif
|
|
|
|
|
2012-11-10 20:59:00 +00:00
|
|
|
|
2012-12-13 02:34:30 +00:00
|
|
|
# Set up target-specific headers and libs that work across all Makefiles
|
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2013-08-11 15:28:42 +00:00
|
|
|
BASELIBDIRS+= -L$(abspath $(MAKEFILE_COMMON_DIR)/platform/Windows/lib$(WINLIB))
|
|
|
|
BASECOMMONFLAGS+= -I$(abspath $(MAKEFILE_COMMON_DIR)/platform/Windows/include)
|
2012-12-13 02:34:30 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
# include port and brew
|
2013-08-11 15:28:42 +00:00
|
|
|
BASELIBDIRS+= -L$(abspath $(MAKEFILE_COMMON_DIR)/platform/Apple/lib) \
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
-L/opt/local/lib -L/usr/local/lib
|
2013-08-11 15:28:42 +00:00
|
|
|
BASECOMMONFLAGS+= -I$(abspath $(MAKEFILE_COMMON_DIR)/platform/Apple/include) \
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
-I/opt/local/include -I/sw/include -I/usr/local/include
|
2012-12-13 02:34:30 +00:00
|
|
|
endif
|
2013-07-20 03:36:54 +00:00
|
|
|
ifeq ($(PLATFORM),GCW)
|
|
|
|
BASECOMMONFLAGS += -D__OPENDINGUX__
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),DINGOO)
|
|
|
|
BASECOMMONFLAGS += -D__OPENDINGUX__
|
|
|
|
endif
|
2012-12-13 02:34:30 +00:00
|
|
|
|
2013-07-13 21:05:05 +00:00
|
|
|
#### Lunatic development
|
|
|
|
# LuaJIT standalone interpreter executable:
|
2013-08-11 15:28:42 +00:00
|
|
|
LUAJIT:=luajit
|
2012-11-10 20:59:00 +00:00
|
|
|
|
|
|
|
ifneq ($(LUNATIC),0)
|
|
|
|
# FIXME: Lunatic doesn't build with inlining because of wacky include
|
|
|
|
# chains!
|
|
|
|
override DISABLEINLINING=1
|
|
|
|
|
2013-08-11 15:28:42 +00:00
|
|
|
BASECOMMONFLAGS+= -I$(MAKEFILE_COMMON_DIR)/source/lunatic -DLUNATIC
|
2012-11-10 20:59:00 +00:00
|
|
|
|
2013-05-17 10:41:57 +00:00
|
|
|
# Determine size of defs.ilua bytecode once.
|
|
|
|
ifndef DEFS_BC_SIZE
|
2013-08-11 15:28:42 +00:00
|
|
|
DEFS_BC_SIZE := $(shell $(LUAJIT) -bg -t h $(MAKEFILE_COMMON_DIR)/source/lunatic/defs.ilua -)
|
2013-05-17 10:41:57 +00:00
|
|
|
DEFS_BC_SIZE := $(word 3, $(DEFS_BC_SIZE))
|
|
|
|
# Pass the bytecode size to the sub-makes, too.
|
|
|
|
export DEFS_BC_SIZE
|
|
|
|
endif
|
|
|
|
BASECOMMONFLAGS+= -DLUNATIC_DEFS_BC_SIZE=$(DEFS_BC_SIZE)
|
2013-02-24 16:05:31 +00:00
|
|
|
|
2012-11-10 20:59:00 +00:00
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2012-12-13 02:34:30 +00:00
|
|
|
BASELIBS+= -lluajit
|
2012-11-10 20:59:00 +00:00
|
|
|
else
|
2012-11-24 09:13:29 +00:00
|
|
|
BASELIBS+= -lluajit-5.1
|
2012-11-10 20:59:00 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
####
|
|
|
|
|
2012-11-05 02:49:08 +00:00
|
|
|
ifneq (0,$(DISABLEINLINING))
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -DDISABLE_INLINING
|
2012-11-05 02:49:08 +00:00
|
|
|
endif
|
2012-11-26 08:25:26 +00:00
|
|
|
ifneq (0,$(FORCEWARNINGS))
|
|
|
|
BASECOMMONFLAGS+= -DFORCE_WARNINGS
|
|
|
|
endif
|
2012-11-05 02:49:08 +00:00
|
|
|
|
2012-10-29 04:26:25 +00:00
|
|
|
BASELDFLAGS+= $(OPTOPT)
|
|
|
|
|
2012-06-01 20:09:27 +00:00
|
|
|
# This should come from the environment:
|
|
|
|
ifdef EDUKE32_MY_DEVELOPER_ID
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -DMY_DEVELOPER_ID=$(EDUKE32_MY_DEVELOPER_ID)
|
2012-06-01 20:09:27 +00:00
|
|
|
endif
|
|
|
|
|
2011-03-19 18:07:12 +00:00
|
|
|
ifneq (0,$(USE_LIBPNG))
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -DUSE_LIBPNG
|
2011-03-19 18:07:12 +00:00
|
|
|
endif
|
2011-07-18 19:06:29 +00:00
|
|
|
ifneq (0,$(USE_LIBVPX))
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -DUSE_LIBVPX
|
2011-07-18 19:06:29 +00:00
|
|
|
endif
|
2010-12-19 22:29:01 +00:00
|
|
|
|
2011-10-02 07:16:57 +00:00
|
|
|
ifneq (0,$(EFENCE))
|
2012-11-24 09:13:29 +00:00
|
|
|
BASELIBS+= -lefence
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -DEFENCE
|
2011-10-02 07:16:57 +00:00
|
|
|
endif
|
2012-01-12 20:49:34 +00:00
|
|
|
ifneq (0,$(DMALLOC))
|
2012-11-24 09:13:29 +00:00
|
|
|
BASELIBS+= -ldmalloc
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -DDMALLOC
|
2012-01-12 20:49:34 +00:00
|
|
|
endif
|
2011-10-02 07:16:57 +00:00
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
# Misc. stuff that is constant between Makefiles
|
|
|
|
EROOT:=build
|
|
|
|
|
|
|
|
# will be potentially overridden in build/Makefile.shared
|
|
|
|
EXESUFFIX=
|