2010-12-19 22:29:01 +00:00
|
|
|
|
|
|
|
## common definitions for Makefile, build/Makefile, source/enet/Makefile and
|
|
|
|
## source/jaudiolib/Makefile
|
|
|
|
|
2012-12-13 02:34:30 +00:00
|
|
|
MAKEFILE_COMMON:=$(lastword $(MAKEFILE_LIST))
|
|
|
|
|
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
|
|
|
|
CC=gcc
|
|
|
|
CXX=g++
|
|
|
|
AS=nasm
|
|
|
|
AR=ar
|
|
|
|
RC=windres
|
|
|
|
RANLIB=ranlib
|
|
|
|
STRIP=strip
|
|
|
|
|
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
|
|
|
# AR=llvm-ar
|
|
|
|
# RANLIB=llvm-ranlib
|
|
|
|
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
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),GCW)
|
|
|
|
SUBPLATFORM=LINUX
|
|
|
|
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
|
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
|
|
|
# Since the OS X startup window is generating errors, give it an off switch.
|
|
|
|
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
|
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
|
|
|
OPTLEVEL?=2
|
|
|
|
PROFILER?=0
|
2011-03-19 17:59:09 +00:00
|
|
|
MUDFLAP?=0
|
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
|
|
|
|
W_STRICT_OVERFLOW := -Wstrict-overflow=1
|
|
|
|
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
|
|
|
|
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
|
2012-11-15 14:27:49 +00:00
|
|
|
BASECXXFLAGS= -fno-exceptions -fno-rtti -fpermissive -Wno-write-strings -Wno-narrowing
|
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
|
|
|
|
|
2012-05-20 07:25:25 +00:00
|
|
|
ifeq ($(PLATFORM),WII)
|
|
|
|
override USE_LIBPNG = 0
|
|
|
|
override USE_LIBVPX = 0
|
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
ifneq (0,$(RELEASE))
|
|
|
|
# Debugging disabled
|
2012-01-28 14:36:52 +00:00
|
|
|
debug+= -O$(OPTLEVEL)
|
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
|
2012-01-28 14:36:52 +00:00
|
|
|
debug+= -O0
|
|
|
|
|
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-01-28 14:36:52 +00:00
|
|
|
# CLANG_MAJOR := $(shell clang -dM -E -x c /dev/null | grep __clang_major__ | awk '{ print $$3 }')
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECFLAGS+= -Xclang -fcatch-undefined-behavior
|
2012-01-28 14:36:52 +00:00
|
|
|
# ifeq ($(CLANG_MAJOR),3)
|
|
|
|
# debug+= -faddress-sanitizer
|
|
|
|
# endif
|
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
|
|
|
|
|
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)
|
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+= -L$(abspath $(dir $(MAKEFILE_COMMON))Windows/lib$(WINLIB))
|
2012-12-13 02:34:30 +00:00
|
|
|
BASECOMMONFLAGS+= -I$(abspath $(dir $(MAKEFILE_COMMON))Windows/include)
|
|
|
|
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
|
|
|
|
BASELIBDIRS+= -L$(abspath $(dir $(MAKEFILE_COMMON))Apple/lib) \
|
|
|
|
-L/opt/local/lib -L/usr/local/lib
|
|
|
|
BASECOMMONFLAGS+= -I$(abspath $(dir $(MAKEFILE_COMMON))Apple/include) \
|
|
|
|
-I/opt/local/include -I/sw/include -I/usr/local/include
|
2012-12-13 02:34:30 +00:00
|
|
|
endif
|
|
|
|
|
2012-11-10 20:59:00 +00:00
|
|
|
#### Lunatic development, do not touch!
|
|
|
|
LUNATIC=0
|
|
|
|
LUAJIT=luajit
|
|
|
|
|
|
|
|
# for LJ headers:
|
|
|
|
LUAJIT_WIN_SRC:= g:/mod/LuaJIT-2.0.0-beta8/src
|
|
|
|
|
|
|
|
ifneq ($(LUNATIC),0)
|
|
|
|
# FIXME: Lunatic doesn't build with inlining because of wacky include
|
|
|
|
# chains!
|
|
|
|
override DISABLEINLINING=1
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
|
|
|
BASECOMMONFLAGS+= -I$(LUAJIT_WIN_SRC)
|
|
|
|
else
|
|
|
|
BASECOMMONFLAGS+= -I/usr/local/include/luajit-2.0
|
|
|
|
endif
|
|
|
|
BASECOMMONFLAGS+= -I$(SRC)/lunatic -DLUNATIC
|
|
|
|
|
|
|
|
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
|
2012-03-08 06:07:10 +00:00
|
|
|
ifneq (0,$(OSX_STARTUPWINDOW))
|
2012-11-06 07:49:44 +00:00
|
|
|
BASECOMMONFLAGS+= -DOSX_STARTUPWINDOW
|
2012-03-08 06:07:10 +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=
|