mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
Makefile: Assignment operator cleanup.
git-svn-id: https://svn.eduke32.com/eduke32@6418 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
599a18fe0b
commit
b56255e774
2 changed files with 512 additions and 495 deletions
448
Common.mak
448
Common.mak
|
@ -3,56 +3,56 @@
|
|||
PACKAGE_REPOSITORY ?= 0
|
||||
|
||||
# Are we running from synthesis?
|
||||
SYNTHESIS ?= 0
|
||||
SYNTHESIS := 0
|
||||
|
||||
|
||||
##### Detect platform
|
||||
|
||||
ifndef HOSTPLATFORM
|
||||
HOSTPLATFORM=UNKNOWN
|
||||
HOSTPLATFORM := UNKNOWN
|
||||
ifeq ($(findstring Windows,$(OS)),Windows)
|
||||
HOSTPLATFORM=WINDOWS
|
||||
HOSTPLATFORM := WINDOWS
|
||||
else
|
||||
uname := $(strip $(shell uname -s))
|
||||
ifeq ($(findstring Linux,$(uname)),Linux)
|
||||
HOSTPLATFORM=LINUX
|
||||
HOSTPLATFORM := LINUX
|
||||
else ifeq ($(findstring BSD,$(uname)),BSD)
|
||||
HOSTPLATFORM=BSD
|
||||
HOSTPLATFORM := BSD
|
||||
else ifeq ($(findstring MINGW,$(uname)),MINGW)
|
||||
HOSTPLATFORM=WINDOWS
|
||||
HOSTPLATFORM := WINDOWS
|
||||
else ifeq ($(findstring MSYS,$(uname)),MSYS)
|
||||
HOSTPLATFORM=WINDOWS
|
||||
HOSTPLATFORM := WINDOWS
|
||||
else ifeq ($(findstring Darwin,$(uname)),Darwin)
|
||||
HOSTPLATFORM=DARWIN
|
||||
HOSTPLATFORM := DARWIN
|
||||
else ifeq ($(findstring BeOS,$(uname)),BeOS)
|
||||
HOSTPLATFORM=BEOS
|
||||
HOSTPLATFORM := BEOS
|
||||
else ifeq ($(findstring skyos,$(uname)),skyos)
|
||||
HOSTPLATFORM=SKYOS
|
||||
HOSTPLATFORM := SKYOS
|
||||
else ifeq ($(findstring QNX,$(uname)),QNX)
|
||||
HOSTPLATFORM=QNX
|
||||
HOSTPLATFORM := QNX
|
||||
else ifeq ($(findstring SunOS,$(uname)),SunOS)
|
||||
HOSTPLATFORM=SUNOS
|
||||
HOSTPLATFORM := SUNOS
|
||||
else ifeq ($(findstring syllable,$(uname)),syllable)
|
||||
HOSTPLATFORM=SYLLABLE
|
||||
HOSTPLATFORM := SYLLABLE
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifndef PLATFORM
|
||||
PLATFORM=$(HOSTPLATFORM)
|
||||
PLATFORM := $(HOSTPLATFORM)
|
||||
endif
|
||||
|
||||
ifndef SUBPLATFORM
|
||||
SUBPLATFORM=
|
||||
SUBPLATFORM :=
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),LINUX DINGOO GCW CAANOO))
|
||||
SUBPLATFORM=LINUX
|
||||
SUBPLATFORM := LINUX
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HOSTPLATFORM),DARWIN)
|
||||
DARWINVERSION:=$(strip $(shell uname -r | cut -d . -f 1))
|
||||
|
||||
DARWIN9 ?= 0
|
||||
DARWIN10 ?= 0
|
||||
DARWIN9 := 0
|
||||
DARWIN10 := 0
|
||||
ifeq (1,$(strip $(shell expr $(DARWINVERSION) \< 10)))
|
||||
override DARWIN9 := 1
|
||||
endif
|
||||
|
@ -61,89 +61,116 @@ ifeq ($(HOSTPLATFORM),DARWIN)
|
|||
endif
|
||||
endif
|
||||
|
||||
HOSTEXESUFFIX :=
|
||||
ifeq ($(HOSTPLATFORM),WINDOWS)
|
||||
HOSTEXESUFFIX := .exe
|
||||
endif
|
||||
|
||||
EXESUFFIX :=
|
||||
DLLSUFFIX := .so
|
||||
DOLSUFFIX := .dol
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
DLLSUFFIX := .dylib
|
||||
endif
|
||||
ifeq ($(PLATFORM),WII)
|
||||
EXESUFFIX := .elf
|
||||
endif
|
||||
ifeq ($(PLATFORM),SKYOS)
|
||||
EXESUFFIX := .app
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
EXESUFFIX := .exe
|
||||
DLLSUFFIX := .dll
|
||||
endif
|
||||
|
||||
|
||||
##### Makefile meta-settings
|
||||
|
||||
PRETTY_OUTPUT ?= 1
|
||||
PRETTY_OUTPUT := 1
|
||||
|
||||
NULLSTREAM = /dev/null
|
||||
DONT_PRINT = > $(NULLSTREAM) 2>&1
|
||||
DONT_PRINT_STDERR = 2> $(NULLSTREAM)
|
||||
DONT_FAIL = ; exit 0
|
||||
NULLSTREAM := /dev/null
|
||||
|
||||
ifeq ($(HOSTPLATFORM),WINDOWS)
|
||||
# MSYS2 lets you create files named NUL but has a /dev/null. Go figure.
|
||||
ifeq (,$(wildcard /dev/null))
|
||||
NULLSTREAM = NUL
|
||||
NULLSTREAM := NUL
|
||||
endif
|
||||
endif
|
||||
|
||||
DONT_PRINT := > $(NULLSTREAM) 2>&1
|
||||
DONT_PRINT_STDERR := 2> $(NULLSTREAM)
|
||||
DONT_FAIL := ; exit 0
|
||||
|
||||
HAVE_SH := 1
|
||||
# when no sh.exe is found in PATH on Windows, no path is prepended to it
|
||||
ifeq (sh.exe,$(SHELL))
|
||||
HAVE_SH := 0
|
||||
endif
|
||||
|
||||
ifeq (0,$(HAVE_SH))
|
||||
# if, printf, exit, and ; are unavailable without sh
|
||||
override PRETTY_OUTPUT := 0
|
||||
override DONT_FAIL :=
|
||||
endif
|
||||
|
||||
|
||||
##### Toolchain setup
|
||||
|
||||
CROSS=
|
||||
CROSS_SUFFIX=
|
||||
ifneq ($(CROSS)$(CROSS_SUFFIX),)
|
||||
undefine CC
|
||||
undefine CXX
|
||||
undefine AR
|
||||
undefine RC
|
||||
undefine RANLIB
|
||||
undefine STRIP
|
||||
endif
|
||||
CROSS :=
|
||||
CROSS_SUFFIX :=
|
||||
|
||||
CC=$(CROSS)gcc$(CROSS_SUFFIX)
|
||||
CXX=$(CROSS)g++$(CROSS_SUFFIX)
|
||||
COBJC=$(CC) -x objective-c
|
||||
COBJCXX=$(CXX) -x objective-c++
|
||||
L_CC=$(CC)
|
||||
L_CXX=$(CXX)
|
||||
CC := $(CROSS)gcc$(CROSS_SUFFIX)
|
||||
CXX := $(CROSS)g++$(CROSS_SUFFIX)
|
||||
COBJC := $(CC) -x objective-c
|
||||
COBJCXX := $(CXX) -x objective-c++
|
||||
L_CC := $(CC)
|
||||
L_CXX := $(CXX)
|
||||
|
||||
AR=$(CROSS)ar$(CROSS_SUFFIX)
|
||||
RC=$(CROSS)windres$(CROSS_SUFFIX)
|
||||
RANLIB=$(CROSS)ranlib$(CROSS_SUFFIX)
|
||||
STRIP=$(CROSS)strip$(CROSS_SUFFIX)
|
||||
AR := $(CROSS)ar$(CROSS_SUFFIX)
|
||||
RC := $(CROSS)windres$(CROSS_SUFFIX)
|
||||
RANLIB := $(CROSS)ranlib$(CROSS_SUFFIX)
|
||||
STRIP := $(CROSS)strip$(CROSS_SUFFIX)
|
||||
|
||||
AS=nasm
|
||||
AS := nasm
|
||||
|
||||
# LuaJIT standalone interpreter executable:
|
||||
LUAJIT=luajit$(EXESUFFIX)
|
||||
LUAJIT := luajit$(HOSTEXESUFFIX)
|
||||
|
||||
PKG_CONFIG=pkg-config
|
||||
PKG_CONFIG := pkg-config
|
||||
|
||||
ELF2DOL=elf2dol
|
||||
ELF2DOL := elf2dol
|
||||
|
||||
# Override defaults that absolutely will not work.
|
||||
ifeq ($(CC),cc)
|
||||
override CC=gcc
|
||||
override CC := gcc
|
||||
endif
|
||||
ifeq ($(AS),as)
|
||||
override AS=nasm
|
||||
override AS := nasm
|
||||
endif
|
||||
|
||||
CCFULLPATH=$(CC)
|
||||
CCFULLPATH := $(CC)
|
||||
|
||||
ifeq ($(PLATFORM),WII)
|
||||
ifeq ($(strip $(DEVKITPPC)),)
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC")
|
||||
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC := <path to>devkitPPC")
|
||||
endif
|
||||
|
||||
include $(DEVKITPPC)/wii_rules
|
||||
|
||||
CCFULLPATH=$(DEVKITPPC)/bin/$(CC)
|
||||
CCFULLPATH := $(DEVKITPPC)/bin/$(CC)
|
||||
|
||||
CROSS=powerpc-eabi-
|
||||
RANLIB=powerpc-eabi-ranlib
|
||||
STRIP=powerpc-eabi-strip
|
||||
CROSS := powerpc-eabi-
|
||||
RANLIB := powerpc-eabi-ranlib
|
||||
STRIP := powerpc-eabi-strip
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),$(filter $(PLATFORM),DINGOO GCW))
|
||||
CROSS=mipsel-linux-
|
||||
CROSS := mipsel-linux-
|
||||
endif
|
||||
|
||||
CLANG?=0
|
||||
CLANG := 0
|
||||
ifeq ($(findstring clang,$(CC) $(MAKECMDGOALS)),clang)
|
||||
override CLANG=1
|
||||
override CLANG := 1
|
||||
CLANGNAME := $(CC)
|
||||
else
|
||||
CLANGNAME := clang
|
||||
|
@ -151,17 +178,17 @@ endif
|
|||
# detect clang symlinked as gcc, as in OS X
|
||||
CLANG_POTENTIAL_VERSION := $(shell $(CCFULLPATH) --version)
|
||||
ifeq ($(findstring clang,$(CLANG_POTENTIAL_VERSION)),clang)
|
||||
override CLANG=1
|
||||
override CLANG := 1
|
||||
endif
|
||||
|
||||
ifneq (0,$(CLANG))
|
||||
CLANGXXNAME := $(subst clang,clang++,$(CLANGNAME))
|
||||
override CC=$(CLANGNAME) -x c
|
||||
override CXX=$(CLANGXXNAME) -x c++
|
||||
override COBJC=$(CLANGNAME) -x objective-c
|
||||
override COBJCXX=$(CLANGXXNAME) -x objective-c++
|
||||
override L_CC=$(CLANGNAME)
|
||||
override L_CXX=$(CLANGXXNAME)
|
||||
override CC := $(CLANGNAME) -x c
|
||||
override CXX := $(CLANGXXNAME) -x c++
|
||||
override COBJC := $(CLANGNAME) -x objective-c
|
||||
override COBJCXX := $(CLANGXXNAME) -x objective-c++
|
||||
override L_CC := $(CLANGNAME)
|
||||
override L_CXX := $(CLANGXXNAME)
|
||||
endif
|
||||
|
||||
ifndef GCC_MAJOR
|
||||
|
@ -192,185 +219,168 @@ endif
|
|||
|
||||
##### Detect machine architecture
|
||||
|
||||
BITS=32
|
||||
BITS := 32
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
ifndef COMPILERTARGET
|
||||
COMPILERTARGET := $(strip $(shell $(CC) -dumpmachine))
|
||||
endif
|
||||
|
||||
IMPLICIT_ARCH=i386
|
||||
IMPLICIT_ARCH := i386
|
||||
ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
|
||||
IMPLICIT_ARCH=x86_64
|
||||
BITS=64
|
||||
IMPLICIT_ARCH := x86_64
|
||||
BITS := 64
|
||||
endif
|
||||
else ifeq ($(PLATFORM),WII)
|
||||
IMPLICIT_ARCH=ppc
|
||||
IMPLICIT_ARCH := ppc
|
||||
else
|
||||
ifneq ($(ARCH),)
|
||||
override ARCH := $(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(strip $(ARCH)))))
|
||||
IMPLICIT_ARCH=$(ARCH)
|
||||
IMPLICIT_ARCH := $(ARCH)
|
||||
else
|
||||
IMPLICIT_ARCH := $(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(strip $(shell uname -m)))))
|
||||
endif
|
||||
|
||||
ifeq ($(findstring x86_64,$(IMPLICIT_ARCH)),x86_64)
|
||||
BITS=64
|
||||
BITS := 64
|
||||
endif
|
||||
endif
|
||||
|
||||
EXESUFFIX=
|
||||
DLLSUFFIX=.so
|
||||
DOLSUFFIX=.dol
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
DLLSUFFIX=.dylib
|
||||
endif
|
||||
ifeq ($(PLATFORM),WII)
|
||||
EXESUFFIX=.elf
|
||||
endif
|
||||
ifeq ($(PLATFORM),SKYOS)
|
||||
EXESUFFIX=.app
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
EXESUFFIX=.exe
|
||||
DLLSUFFIX=.dll
|
||||
endif
|
||||
|
||||
|
||||
##### Toggles
|
||||
|
||||
# CPLUSPLUS - 1 = enable C++ building
|
||||
# RELEASE - 1 = no debugging
|
||||
# CPLUSPLUS - 1 := enable C++ building
|
||||
# RELEASE - 1 := no debugging
|
||||
# DEBUGANYWAY:
|
||||
# 1 = Include debug symbols even when generating release code.
|
||||
# 2 = Also enable sanitizers with Clang. On the C side, make 'sprite' etc. be real arrays.
|
||||
# KRANDDEBUG - 1 = include logging of krand() calls for debugging the demo system
|
||||
# MEMMAP - 1 = produce .memmap file when linking
|
||||
# OPTLEVEL - 0..3 = GCC optimization strategy
|
||||
# LTO - 1 = enable link-time optimization
|
||||
# 1 := Include debug symbols even when generating release code.
|
||||
# 2 := Also enable sanitizers with Clang. On the C side, make 'sprite' etc. be real arrays.
|
||||
# KRANDDEBUG - 1 := include logging of krand() calls for debugging the demo system
|
||||
# MEMMAP - 1 := produce .memmap file when linking
|
||||
# OPTLEVEL - 0..3 := GCC optimization strategy
|
||||
# LTO - 1 := enable link-time optimization
|
||||
|
||||
# Optional overrides for text
|
||||
APPNAME=
|
||||
APPBASENAME=
|
||||
APPNAME :=
|
||||
APPBASENAME :=
|
||||
|
||||
# Build toggles
|
||||
RELEASE?=1
|
||||
NOASM = 0
|
||||
RELEASE := 1
|
||||
NOASM := 0
|
||||
# EXPERIMENTAL, unfinished x86_64 assembly routines. DO NOT ENABLE.
|
||||
USE_ASM64 ?= 0
|
||||
MEMMAP?=0
|
||||
CPLUSPLUS?=1
|
||||
USE_ASM64 := 0
|
||||
MEMMAP := 0
|
||||
CPLUSPLUS := 1
|
||||
|
||||
# Feature toggles
|
||||
STANDALONE ?= 0
|
||||
NETCODE ?= 1
|
||||
STARTUP_WINDOW ?= 1
|
||||
SIMPLE_MENU ?= 0
|
||||
POLYMER = 1
|
||||
USE_OPENGL = 1
|
||||
LUNATIC ?= 0
|
||||
USE_LUAJIT_2_1 ?= 0
|
||||
STANDALONE := 0
|
||||
NETCODE := 1
|
||||
STARTUP_WINDOW := 1
|
||||
SIMPLE_MENU := 0
|
||||
POLYMER := 1
|
||||
USE_OPENGL := 1
|
||||
LUNATIC := 0
|
||||
USE_LUAJIT_2_1 := 0
|
||||
|
||||
# Library toggles
|
||||
HAVE_GTK2 ?= 1
|
||||
USE_LIBVPX ?= 1
|
||||
HAVE_VORBIS ?= 1
|
||||
HAVE_FLAC ?= 1
|
||||
HAVE_XMP ?= 1
|
||||
RENDERTYPE=SDL
|
||||
MIXERTYPE=SDL
|
||||
SDL_TARGET ?= 2
|
||||
HAVE_GTK2 := 1
|
||||
USE_LIBVPX := 1
|
||||
HAVE_VORBIS := 1
|
||||
HAVE_FLAC := 1
|
||||
HAVE_XMP := 1
|
||||
RENDERTYPE := SDL
|
||||
MIXERTYPE := SDL
|
||||
SDL_TARGET := 2
|
||||
|
||||
# Debugging/Build options
|
||||
DEBUGANYWAY?=0
|
||||
KRANDDEBUG?=0
|
||||
PROFILER?=0
|
||||
DEBUGANYWAY := 0
|
||||
KRANDDEBUG := 0
|
||||
PROFILER := 0
|
||||
# Make allocache() a wrapper around malloc()? Useful for debugging
|
||||
# allocache()-allocated memory accesses with e.g. Valgrind.
|
||||
# For debugging with Valgrind + GDB, see
|
||||
# http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
|
||||
ALLOCACHE_AS_MALLOC?=0
|
||||
ALLOCACHE_AS_MALLOC := 0
|
||||
|
||||
|
||||
##### Settings overrides and implicit cascades
|
||||
|
||||
ifneq (0,$(KRANDDEBUG))
|
||||
RELEASE=0
|
||||
RELEASE := 0
|
||||
endif
|
||||
ifneq (100,$(RELEASE)$(PROFILER)$(ALLOCACHE_AS_MALLOC))
|
||||
# so that we have debug symbols
|
||||
DEBUGANYWAY=1
|
||||
DEBUGANYWAY := 1
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
MIXERTYPE=WIN
|
||||
MIXERTYPE := WIN
|
||||
ifneq ($(RENDERTYPE),SDL)
|
||||
ifeq ($(MIXERTYPE),SDL)
|
||||
override MIXERTYPE := WIN
|
||||
endif
|
||||
endif
|
||||
override HAVE_GTK2 = 0
|
||||
override HAVE_GTK2 := 0
|
||||
else ifeq ($(PLATFORM),DARWIN)
|
||||
HAVE_GTK2 = 0
|
||||
HAVE_GTK2 := 0
|
||||
else ifeq ($(PLATFORM),WII)
|
||||
override USE_OPENGL=0
|
||||
override NETCODE = 0
|
||||
override HAVE_GTK2 = 0
|
||||
override HAVE_FLAC = 0
|
||||
SDL_TARGET=1
|
||||
override USE_OPENGL := 0
|
||||
override NETCODE := 0
|
||||
override HAVE_GTK2 := 0
|
||||
override HAVE_FLAC := 0
|
||||
SDL_TARGET := 1
|
||||
else ifeq ($(PLATFORM),$(filter $(PLATFORM),DINGOO GCW QNX SUNOS SYLLABLE))
|
||||
override USE_OPENGL=0
|
||||
override NOASM=1
|
||||
override USE_OPENGL := 0
|
||||
override NOASM := 1
|
||||
else ifeq ($(PLATFORM),$(filter $(PLATFORM),BEOS SKYOS))
|
||||
override NOASM=1
|
||||
override NOASM := 1
|
||||
endif
|
||||
|
||||
ifneq (i386,$(strip $(IMPLICIT_ARCH)))
|
||||
override NOASM=1
|
||||
override NOASM := 1
|
||||
endif
|
||||
|
||||
ifeq (0,$(USE_OPENGL))
|
||||
override POLYMER = 0
|
||||
override USE_LIBVPX = 0
|
||||
override POLYMER := 0
|
||||
override USE_LIBVPX := 0
|
||||
endif
|
||||
|
||||
ifeq ($(RELEASE),0)
|
||||
override STRIP=
|
||||
override STRIP :=
|
||||
endif
|
||||
ifneq ($(DEBUGANYWAY),0)
|
||||
override STRIP=
|
||||
override STRIP :=
|
||||
endif
|
||||
|
||||
ifeq ($(RELEASE),0)
|
||||
OPTLEVEL?=0
|
||||
LTO=0
|
||||
OPTLEVEL := 0
|
||||
LTO := 0
|
||||
else
|
||||
OPTLEVEL?=2
|
||||
LTO=1
|
||||
OPTLEVEL := 2
|
||||
LTO := 1
|
||||
endif
|
||||
|
||||
ifneq (0,$(CLANG))
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
LTO=0
|
||||
LTO := 0
|
||||
endif
|
||||
endif
|
||||
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
|
||||
override LTO := 0
|
||||
endif
|
||||
ifeq (0,$(CLANG))
|
||||
ifeq (0,$(GCC_PREREQ_4))
|
||||
override LTO=0
|
||||
override LTO := 0
|
||||
endif
|
||||
ifeq (1,$(strip $(shell expr $(GCC_MAJOR) = 4)))
|
||||
ifeq ($(PLATFORM),WII)
|
||||
ifeq (1,$(strip $(shell expr $(GCC_MINOR) \< 8)))
|
||||
override LTO=0
|
||||
override LTO := 0
|
||||
endif
|
||||
else
|
||||
ifeq (1,$(strip $(shell expr $(GCC_MINOR) \< 6)))
|
||||
override LTO=0
|
||||
override LTO := 0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
@ -382,33 +392,33 @@ endif
|
|||
|
||||
##### Instantiate variables
|
||||
|
||||
COMMONFLAGS =
|
||||
COMPILERFLAGS = -funsigned-char
|
||||
COMMONFLAGS :=
|
||||
COMPILERFLAGS := -funsigned-char
|
||||
|
||||
CSTD := -std=gnu99
|
||||
CONLYFLAGS=$(CSTD)
|
||||
CXXSTD := -std=gnu++11
|
||||
CXXONLYFLAGS=$(CXXSTD) -fno-exceptions -fno-rtti
|
||||
ifneq (0,$(CLANG))
|
||||
CSTD := $(subst gnu,c,$(CSTD))
|
||||
CXXSTD := $(subst gnu,c,$(CXXSTD))
|
||||
endif
|
||||
CONLYFLAGS := $(CSTD)
|
||||
CXXONLYFLAGS := $(CXXSTD) -fno-exceptions -fno-rtti
|
||||
|
||||
ASFLAGS=-s #-g
|
||||
ASFLAGS := -s #-g
|
||||
|
||||
LUAJIT_BCOPTS :=
|
||||
|
||||
LINKERFLAGS=
|
||||
L_CXXONLYFLAGS=
|
||||
LINKERFLAGS :=
|
||||
L_CXXONLYFLAGS :=
|
||||
|
||||
LIBS=
|
||||
GUI_LIBS=
|
||||
LIBDIRS=
|
||||
LIBS :=
|
||||
GUI_LIBS :=
|
||||
LIBDIRS :=
|
||||
|
||||
|
||||
##### Mandatory platform parameters
|
||||
|
||||
ASFORMAT=elf$(BITS)
|
||||
ASFORMAT := elf$(BITS)
|
||||
# Options to "luajit -b" for synthesis. Since it runs on Linux, we need to tell
|
||||
# the native LuaJIT to emit PE object files.
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
|
@ -422,7 +432,7 @@ ifeq ($(PLATFORM),WINDOWS)
|
|||
endif
|
||||
|
||||
COMPILERFLAGS += -DUNDERSCORES
|
||||
ASFORMAT=win$(BITS)
|
||||
ASFORMAT := win$(BITS)
|
||||
ASFLAGS += -DUNDERSCORES
|
||||
|
||||
ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
|
||||
|
@ -450,7 +460,7 @@ else ifeq ($(PLATFORM),DARWIN)
|
|||
endif
|
||||
|
||||
COMPILERFLAGS += -DUNDERSCORES
|
||||
ASFORMAT=macho
|
||||
ASFORMAT := macho
|
||||
ASFLAGS += -DUNDERSCORES
|
||||
|
||||
ifeq ($(findstring x86_64,$(IMPLICIT_ARCH)),x86_64)
|
||||
|
@ -476,19 +486,19 @@ COMPILERFLAGS+= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
|
|||
ifndef OPTOPT
|
||||
ifeq ($(findstring x86_64, $(IMPLICIT_ARCH)),x86_64)
|
||||
ifeq ($(findstring x86_64h, $(IMPLICIT_ARCH)),x86_64h)
|
||||
OPTOPT=-march=haswell -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mpclmul -mavx -mrdrnd -mf16c -mfsgsbase -mavx2 -maes -mfma -mbmi -mbmi2
|
||||
OPTOPT := -march=haswell -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt -mpclmul -mavx -mrdrnd -mf16c -mfsgsbase -mavx2 -maes -mfma -mbmi -mbmi2
|
||||
# -mcrc32 -mmovbe
|
||||
else
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
OPTOPT=-march=core2 -mmmx -msse -msse2 -msse3 -mssse3
|
||||
OPTOPT := -march=core2 -mmmx -msse -msse2 -msse3 -mssse3
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($(findstring i386, $(IMPLICIT_ARCH)),i386)
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
OPTOPT=-march=nocona -mmmx -msse -msse2 -msse3
|
||||
OPTOPT := -march=nocona -mmmx -msse -msse2 -msse3
|
||||
else
|
||||
OPTOPT=-march=pentium3
|
||||
OPTOPT := -march=pentium3
|
||||
ifneq (0,$(GCC_PREREQ_4))
|
||||
OPTOPT += -mtune=generic
|
||||
# -mstackrealign
|
||||
|
@ -498,7 +508,7 @@ ifndef OPTOPT
|
|||
endif
|
||||
endif
|
||||
ifeq ($(PLATFORM),WII)
|
||||
OPTOPT=-mtune=750
|
||||
OPTOPT := -mtune=750
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -616,28 +626,11 @@ W_GCC_4_1 := -Wno-attributes
|
|||
W_GCC_4_2 := $(W_STRICT_OVERFLOW)
|
||||
W_GCC_4_4 := -Wno-unused-result
|
||||
W_GCC_4_5 := -Wlogical-op -Wcast-qual
|
||||
W_CLANG := -Wno-unused-value -Wno-parentheses -Wno-unknown-warning-option
|
||||
|
||||
CWARNS = -W -Wall \
|
||||
-Wextra \
|
||||
-Wpointer-arith \
|
||||
-Wno-char-subscripts \
|
||||
-Wno-missing-braces \
|
||||
-Wwrite-strings \
|
||||
$(W_UNINITIALIZED) \
|
||||
$(W_GCC_4_1) \
|
||||
$(W_GCC_4_2) \
|
||||
$(W_GCC_4_4) \
|
||||
$(W_GCC_4_5) \
|
||||
#-Wstrict-prototypes \
|
||||
#-Waggregate-return \
|
||||
#-Wcast-align \
|
||||
#-Waddress
|
||||
ifeq (0,$(CLANG))
|
||||
W_CLANG :=
|
||||
|
||||
CONLYWARNS = -Wimplicit -Werror-implicit-function-declaration
|
||||
|
||||
ifneq (0,$(CLANG))
|
||||
CWARNS+= -Wno-unused-value -Wno-parentheses -Wno-unknown-warning-option
|
||||
else
|
||||
ifeq (0,$(GCC_PREREQ_4))
|
||||
W_GCC_4_5 :=
|
||||
W_GCC_4_4 :=
|
||||
|
@ -667,6 +660,25 @@ else
|
|||
endif
|
||||
endif
|
||||
|
||||
CONLYWARNS := -Wimplicit -Werror-implicit-function-declaration
|
||||
|
||||
CWARNS := -W -Wall \
|
||||
-Wextra \
|
||||
-Wpointer-arith \
|
||||
-Wno-char-subscripts \
|
||||
-Wno-missing-braces \
|
||||
-Wwrite-strings \
|
||||
$(W_UNINITIALIZED) \
|
||||
$(W_GCC_4_1) \
|
||||
$(W_GCC_4_2) \
|
||||
$(W_GCC_4_4) \
|
||||
$(W_GCC_4_5) \
|
||||
$(W_CLANG) \
|
||||
#-Wstrict-prototypes \
|
||||
#-Waggregate-return \
|
||||
#-Wcast-align \
|
||||
#-Waddress
|
||||
|
||||
|
||||
##### Features
|
||||
|
||||
|
@ -769,36 +781,36 @@ ifneq (0,$(HAVE_XMP))
|
|||
endif
|
||||
|
||||
ifeq ($(RENDERTYPE),SDL)
|
||||
ifeq ($(PLATFORM),WII)
|
||||
SDLCONFIG=
|
||||
else ifeq ($(PLATFORM),SKYOS)
|
||||
COMPILERFLAGS+= -I/boot/programs/sdk/include/sdl
|
||||
SDLCONFIG=
|
||||
endif
|
||||
|
||||
ifeq ($(SDL_TARGET),2)
|
||||
SDLCONFIG ?= sdl2-config
|
||||
SDLNAME ?= SDL2
|
||||
SDLCONFIG := sdl2-config
|
||||
SDLNAME := SDL2
|
||||
else ifeq ($(SDL_TARGET),1)
|
||||
SDLCONFIG ?= sdl-config
|
||||
SDLNAME ?= SDL
|
||||
SDLCONFIG := sdl-config
|
||||
SDLNAME := SDL
|
||||
ifeq (0,$(RELEASE))
|
||||
COMPILERFLAGS += -DNOSDLPARACHUTE
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(PLATFORM),WII)
|
||||
SDLCONFIG :=
|
||||
else ifeq ($(PLATFORM),SKYOS)
|
||||
COMPILERFLAGS += -I/boot/programs/sdk/include/sdl
|
||||
SDLCONFIG :=
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(SDLCONFIG)),)
|
||||
ifeq ($(strip $(shell $(SDLCONFIG) --version $(DONT_PRINT_STDERR))),)
|
||||
override SDLCONFIG =
|
||||
override SDLCONFIG :=
|
||||
endif
|
||||
endif
|
||||
|
||||
COMPILERFLAGS += -DSDL_TARGET=$(SDL_TARGET)
|
||||
|
||||
SDL_FRAMEWORK ?= 0
|
||||
SDL_FRAMEWORK := 0
|
||||
ifneq ($(SDL_FRAMEWORK),0)
|
||||
ifeq ($(PLATFORM),DARWIN)
|
||||
APPLE_FRAMEWORKS ?=/Library/Frameworks
|
||||
APPLE_FRAMEWORKS := /Library/Frameworks
|
||||
LIBDIRS += -F$(APPLE_FRAMEWORKS)
|
||||
ifeq ($(MIXERTYPE),SDL)
|
||||
COMPILERFLAGS += -I$(APPLE_FRAMEWORKS)/$(SDLNAME)_mixer.framework/Headers
|
||||
|
@ -831,7 +843,7 @@ ifneq (0,$(HAVE_GTK2))
|
|||
ifneq (No,$(shell $(PKG_CONFIG) --exists gtk+-2.0 || echo No))
|
||||
COMPILERFLAGS += -DHAVE_GTK2 $(shell $(PKG_CONFIG) --cflags gtk+-2.0)
|
||||
else
|
||||
override HAVE_GTK2=0
|
||||
override HAVE_GTK2 := 0
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -892,19 +904,6 @@ ifneq (,$(VC_REV)$(VC_REV_CUSTOM))
|
|||
endif
|
||||
|
||||
|
||||
##### Final assembly of commands
|
||||
|
||||
COMPILER_C=$(CC) $(CONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(CONLYWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
COMPILER_CXX=$(CXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
COMPILER_OBJC=$(COBJC) $(CONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(CONLYWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
COMPILER_OBJCXX=$(COBJCXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
LINKER=$(L_CXX) $(CXXONLYFLAGS) $(L_CXXONLYFLAGS) $(COMMONFLAGS) $(LINKERFLAGS) $(CUSTOMOPT)
|
||||
ifneq ($(CPLUSPLUS),0)
|
||||
COMPILER_C=$(COMPILER_CXX)
|
||||
COMPILER_OBJC=$(COMPILER_OBJCXX)
|
||||
endif
|
||||
|
||||
|
||||
##### Allow standard environment variables to take precedence, to help package maintainers.
|
||||
|
||||
ifneq (,$(CFLAGS))
|
||||
|
@ -918,6 +917,19 @@ ifneq (,$(LDFLAGS))
|
|||
endif
|
||||
|
||||
|
||||
##### Final assembly of commands
|
||||
|
||||
COMPILER_C=$(CC) $(CONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(CONLYWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
COMPILER_CXX=$(CXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
COMPILER_OBJC=$(COBJC) $(CONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(CONLYWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
COMPILER_OBJCXX=$(COBJCXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(CWARNS) $(COMPILERFLAGS) $(CUSTOMOPT)
|
||||
LINKER=$(L_CXX) $(CXXONLYFLAGS) $(L_CXXONLYFLAGS) $(COMMONFLAGS) $(LINKERFLAGS) $(CUSTOMOPT)
|
||||
ifneq ($(CPLUSPLUS),0)
|
||||
COMPILER_C=$(COMPILER_CXX)
|
||||
COMPILER_OBJC=$(COMPILER_OBJCXX)
|
||||
endif
|
||||
|
||||
|
||||
##### Pretty-printing
|
||||
|
||||
ifeq ($(PRETTY_OUTPUT),1)
|
||||
|
|
313
GNUmakefile
313
GNUmakefile
|
@ -5,12 +5,12 @@
|
|||
include Common.mak
|
||||
|
||||
### File Extensions
|
||||
asm=nasm
|
||||
o=o
|
||||
asm := nasm
|
||||
o := o
|
||||
|
||||
### Directories
|
||||
source=source
|
||||
obj=obj
|
||||
source := source
|
||||
obj := obj
|
||||
|
||||
### Functions
|
||||
define parent
|
||||
|
@ -29,15 +29,14 @@ define getdeps
|
|||
$(call expanddeps,$1_$2 $(COMMON_$2_DEPS) ENGINE)
|
||||
endef
|
||||
|
||||
COMPILERFLAGS += -I$(ENGINE_INC) -I$(MACT_INC) -I$(AUDIOLIB_INC) -I$(ENET_INC)
|
||||
|
||||
##### External Library Definitions
|
||||
|
||||
#### libxmp-lite
|
||||
|
||||
LIBXMPLITE=libxmp-lite
|
||||
LIBXMPLITE := libxmp-lite
|
||||
|
||||
LIBXMPLITE_OBJS = \
|
||||
LIBXMPLITE_OBJS := \
|
||||
control.c \
|
||||
dataio.c \
|
||||
effects.c \
|
||||
|
@ -64,36 +63,36 @@ LIBXMPLITE_OBJS = \
|
|||
sample.c \
|
||||
xm_load.c \
|
||||
|
||||
LIBXMPLITE_ROOT=$(source)/$(LIBXMPLITE)
|
||||
LIBXMPLITE_SRC=$(LIBXMPLITE_ROOT)/src
|
||||
LIBXMPLITE_INC=$(LIBXMPLITE_ROOT)/include
|
||||
LIBXMPLITE_OBJ=$(obj)/$(LIBXMPLITE)
|
||||
LIBXMPLITE_ROOT := $(source)/$(LIBXMPLITE)
|
||||
LIBXMPLITE_SRC := $(LIBXMPLITE_ROOT)/src
|
||||
LIBXMPLITE_INC := $(LIBXMPLITE_ROOT)/include
|
||||
LIBXMPLITE_OBJ := $(obj)/$(LIBXMPLITE)
|
||||
|
||||
LIBXMPLITE_CFLAGS=-DHAVE_ROUND -DLIBXMP_CORE_PLAYER -DBUILDING_STATIC -I$(LIBXMPLITE_INC)/libxmp-lite -Wno-unused-parameter -Wno-sign-compare
|
||||
LIBXMPLITE_CFLAGS := -DHAVE_ROUND -DLIBXMP_CORE_PLAYER -DBUILDING_STATIC -I$(LIBXMPLITE_INC)/libxmp-lite -Wno-unused-parameter -Wno-sign-compare
|
||||
|
||||
|
||||
#### LPeg
|
||||
|
||||
LPEG=lpeg
|
||||
LPEG := lpeg
|
||||
|
||||
LPEG_OBJS = \
|
||||
LPEG_OBJS := \
|
||||
lpcap.c \
|
||||
lpcode.c \
|
||||
lpprint.c \
|
||||
lptree.c \
|
||||
lpvm.c \
|
||||
|
||||
LPEG_ROOT=$(source)/$(LPEG)
|
||||
LPEG_SRC=$(LPEG_ROOT)/src
|
||||
LPEG_INC=$(LPEG_ROOT)/include
|
||||
LPEG_OBJ=$(obj)/$(LPEG)
|
||||
LPEG_ROOT := $(source)/$(LPEG)
|
||||
LPEG_SRC := $(LPEG_ROOT)/src
|
||||
LPEG_INC := $(LPEG_ROOT)/include
|
||||
LPEG_OBJ := $(obj)/$(LPEG)
|
||||
|
||||
|
||||
#### ENet
|
||||
|
||||
ENET=enet
|
||||
ENET := enet
|
||||
|
||||
ENET_OBJS = \
|
||||
ENET_OBJS := \
|
||||
callbacks.c \
|
||||
host.c \
|
||||
list.c \
|
||||
|
@ -102,12 +101,12 @@ ENET_OBJS = \
|
|||
protocol.c \
|
||||
compress.c \
|
||||
|
||||
ENET_ROOT=$(source)/$(ENET)
|
||||
ENET_SRC=$(ENET_ROOT)/src
|
||||
ENET_INC=$(ENET_ROOT)/include
|
||||
ENET_OBJ=$(obj)/$(ENET)
|
||||
ENET_ROOT := $(source)/$(ENET)
|
||||
ENET_SRC := $(ENET_ROOT)/src
|
||||
ENET_INC := $(ENET_ROOT)/include
|
||||
ENET_OBJ := $(obj)/$(ENET)
|
||||
|
||||
ENET_CFLAGS=
|
||||
ENET_CFLAGS :=
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
ENET_OBJS += win32.c
|
||||
|
@ -121,26 +120,26 @@ endif
|
|||
|
||||
#### EBacktrace
|
||||
|
||||
ifndef EBACKTRACEDLL
|
||||
EBACKTRACEDLL = ebacktrace1.dll
|
||||
ifndef EBACKTRACE_DLL
|
||||
EBACKTRACE_DLL := ebacktrace1.dll
|
||||
ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
|
||||
EBACKTRACEDLL = ebacktrace1-64.dll
|
||||
EBACKTRACE_DLL := ebacktrace1-64.dll
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
#### BUILD Engine
|
||||
|
||||
ENGINE=build
|
||||
ENGINE := build
|
||||
|
||||
ENGINE_CFLAGS=-I$(ENGINE_SRC)
|
||||
ENGINE_ROOT := $(source)/$(ENGINE)
|
||||
ENGINE_SRC := $(ENGINE_ROOT)/src
|
||||
ENGINE_INC := $(ENGINE_ROOT)/include
|
||||
ENGINE_OBJ := $(obj)/$(ENGINE)
|
||||
|
||||
ENGINE_ROOT=$(source)/$(ENGINE)
|
||||
ENGINE_SRC=$(ENGINE_ROOT)/src
|
||||
ENGINE_INC=$(ENGINE_ROOT)/include
|
||||
ENGINE_OBJ=$(obj)/$(ENGINE)
|
||||
ENGINE_CFLAGS := -I$(ENGINE_SRC)
|
||||
|
||||
ENGINE_OBJS = \
|
||||
ENGINE_OBJS := \
|
||||
rev.cpp \
|
||||
baselayer.cpp \
|
||||
cache1d.cpp \
|
||||
|
@ -175,12 +174,12 @@ ENGINE_OBJS = \
|
|||
pngwrite.cpp \
|
||||
miniz.c \
|
||||
|
||||
ENGINE_EDITOR_OBJS = \
|
||||
ENGINE_EDITOR_OBJS := \
|
||||
build.cpp \
|
||||
config.cpp \
|
||||
defs.cpp \
|
||||
|
||||
ENGINE_TOOLS_OBJS = \
|
||||
ENGINE_TOOLS_OBJS := \
|
||||
compat.cpp \
|
||||
pragmas.cpp \
|
||||
kplib.cpp \
|
||||
|
@ -247,14 +246,14 @@ endif
|
|||
|
||||
#### MACT
|
||||
|
||||
MACT=mact
|
||||
MACT := mact
|
||||
|
||||
MACT_ROOT=$(source)/$(MACT)
|
||||
MACT_SRC=$(MACT_ROOT)/src
|
||||
MACT_INC=$(MACT_ROOT)/include
|
||||
MACT_OBJ=$(obj)/$(MACT)
|
||||
MACT_ROOT := $(source)/$(MACT)
|
||||
MACT_SRC := $(MACT_ROOT)/src
|
||||
MACT_INC := $(MACT_ROOT)/include
|
||||
MACT_OBJ := $(obj)/$(MACT)
|
||||
|
||||
MACT_OBJS = \
|
||||
MACT_OBJS := \
|
||||
file_lib.cpp \
|
||||
control.cpp \
|
||||
keyboard.cpp \
|
||||
|
@ -265,9 +264,9 @@ MACT_OBJS = \
|
|||
|
||||
#### AudioLib
|
||||
|
||||
AUDIOLIB=audiolib
|
||||
AUDIOLIB := audiolib
|
||||
|
||||
AUDIOLIB_OBJS = \
|
||||
AUDIOLIB_OBJS := \
|
||||
drivers.cpp \
|
||||
fx_man.cpp \
|
||||
multivoc.cpp \
|
||||
|
@ -281,10 +280,14 @@ AUDIOLIB_OBJS = \
|
|||
xmp.cpp \
|
||||
driver_nosound.cpp \
|
||||
|
||||
AUDIOLIB_ROOT=$(source)/$(AUDIOLIB)
|
||||
AUDIOLIB_SRC=$(AUDIOLIB_ROOT)/src
|
||||
AUDIOLIB_INC=$(AUDIOLIB_ROOT)/include
|
||||
AUDIOLIB_OBJ=$(obj)/$(AUDIOLIB)
|
||||
AUDIOLIB_ROOT := $(source)/$(AUDIOLIB)
|
||||
AUDIOLIB_SRC := $(AUDIOLIB_ROOT)/src
|
||||
AUDIOLIB_INC := $(AUDIOLIB_ROOT)/include
|
||||
AUDIOLIB_OBJ := $(obj)/$(AUDIOLIB)
|
||||
|
||||
AUDIOLIB_CFLAGS :=
|
||||
|
||||
AUDIOLIB_DEPS :=
|
||||
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
ifeq ($(MIXERTYPE),WIN)
|
||||
|
@ -299,29 +302,28 @@ ifeq ($(MIXERTYPE),SDL)
|
|||
AUDIOLIB_OBJS += driver_sdl.cpp
|
||||
endif
|
||||
|
||||
AUDIOLIB_CFLAGS=
|
||||
|
||||
AUDIOLIB_DEPS=
|
||||
|
||||
ifneq (0,$(HAVE_XMP))
|
||||
AUDIOLIB_CFLAGS += -I$(LIBXMPLITE_INC)
|
||||
AUDIOLIB_DEPS += LIBXMPLITE
|
||||
endif
|
||||
|
||||
|
||||
#### Tools
|
||||
|
||||
TOOLS=tools
|
||||
TOOLS := tools
|
||||
|
||||
TOOLS_OBJS = \
|
||||
TOOLS_OBJS := \
|
||||
compat_tools.cpp \
|
||||
|
||||
TOOLS_ROOT=$(source)/$(TOOLS)
|
||||
TOOLS_SRC=$(TOOLS_ROOT)/src
|
||||
TOOLS_OBJ=$(obj)/$(TOOLS)
|
||||
TOOLS_ROOT := $(source)/$(TOOLS)
|
||||
TOOLS_SRC := $(TOOLS_ROOT)/src
|
||||
TOOLS_OBJ := $(obj)/$(TOOLS)
|
||||
|
||||
TOOLS_CFLAGS=$(ENGINE_CFLAGS)
|
||||
TOOLS_CFLAGS := $(ENGINE_CFLAGS)
|
||||
|
||||
TOOLS_TARGETS= \
|
||||
TOOLS_DEPS := ENGINE_TOOLS
|
||||
|
||||
TOOLS_TARGETS := \
|
||||
kextract \
|
||||
kgroup \
|
||||
transpal \
|
||||
|
@ -350,41 +352,39 @@ ifeq ($(PLATFORM),DARWIN)
|
|||
TOOLS_OBJS += osxbits.mm
|
||||
endif
|
||||
|
||||
TOOLS_DEPS=ENGINE_TOOLS
|
||||
|
||||
|
||||
#### KenBuild (Test Game)
|
||||
|
||||
KENBUILD=kenbuild
|
||||
kenbuild=KENBUILD
|
||||
KENBUILD := kenbuild
|
||||
kenbuild := KENBUILD
|
||||
|
||||
KENBUILD_ROOT=$(source)/$(KENBUILD)
|
||||
KENBUILD_SRC=$(KENBUILD_ROOT)/src
|
||||
KENBUILD_RSRC=$(KENBUILD_ROOT)/rsrc
|
||||
KENBUILD_OBJ=$(obj)/$(KENBUILD)
|
||||
KENBUILD_ROOT := $(source)/$(KENBUILD)
|
||||
KENBUILD_SRC := $(KENBUILD_ROOT)/src
|
||||
KENBUILD_RSRC := $(KENBUILD_ROOT)/rsrc
|
||||
KENBUILD_OBJ := $(obj)/$(KENBUILD)
|
||||
|
||||
KENBUILD_CFLAGS=-I$(KENBUILD_SRC)
|
||||
KENBUILD_CFLAGS := -I$(KENBUILD_SRC)
|
||||
|
||||
KENBUILD_GAME ?= ekenbuild
|
||||
KENBUILD_EDITOR ?= ekenbuild-editor
|
||||
KENBUILD_GAME := ekenbuild
|
||||
KENBUILD_EDITOR := ekenbuild-editor
|
||||
|
||||
KENBUILD_GAME_PROPER ?= EKenBuild
|
||||
KENBUILD_EDITOR_PROPER ?= EKenBuild Editor
|
||||
KENBUILD_GAME_PROPER := EKenBuild
|
||||
KENBUILD_EDITOR_PROPER := EKenBuild Editor
|
||||
|
||||
KENBUILD_GAME_OBJS = \
|
||||
KENBUILD_GAME_OBJS := \
|
||||
game.cpp \
|
||||
sound_stub.cpp \
|
||||
common.cpp \
|
||||
config.cpp \
|
||||
|
||||
KENBUILD_EDITOR_OBJS = \
|
||||
KENBUILD_EDITOR_OBJS := \
|
||||
bstub.cpp \
|
||||
common.cpp \
|
||||
|
||||
KENBUILD_GAME_RSRC_OBJS =
|
||||
KENBUILD_EDITOR_RSRC_OBJS =
|
||||
KENBUILD_GAME_GEN_OBJS =
|
||||
KENBUILD_EDITOR_RSRC_OBJS =
|
||||
KENBUILD_GAME_RSRC_OBJS :=
|
||||
KENBUILD_EDITOR_RSRC_OBJS :=
|
||||
KENBUILD_GAME_GEN_OBJS :=
|
||||
KENBUILD_EDITOR_RSRC_OBJS :=
|
||||
|
||||
ifeq (1,$(HAVE_GTK2))
|
||||
KENBUILD_GAME_OBJS += startgtk.game.cpp
|
||||
|
@ -410,39 +410,53 @@ endif
|
|||
|
||||
#### Duke Nukem 3D
|
||||
|
||||
DUKE3D=duke3d
|
||||
duke3d=DUKE3D
|
||||
DUKE3D := duke3d
|
||||
duke3d := DUKE3D
|
||||
|
||||
DUKE3D_CFLAGS=-I$(DUKE3D_SRC)
|
||||
DUKE3D_GAME_LDFLAGS :=
|
||||
DUKE3D_EDITOR_LDFLAGS :=
|
||||
|
||||
DUKE3D_GAME_LDFLAGS=
|
||||
DUKE3D_EDITOR_LDFLAGS=
|
||||
DUKE3D_GAME_STRIPFLAGS :=
|
||||
DUKE3D_EDITOR_STRIPFLAGS :=
|
||||
|
||||
DUKE3D_GAME_STRIPFLAGS=
|
||||
DUKE3D_EDITOR_STRIPFLAGS=
|
||||
DUKE3D_ROOT := $(source)/$(DUKE3D)
|
||||
DUKE3D_SRC := $(DUKE3D_ROOT)/src
|
||||
DUKE3D_RSRC := $(DUKE3D_ROOT)/rsrc
|
||||
DUKE3D_OBJ := $(obj)/$(DUKE3D)
|
||||
|
||||
DUKE3D_ROOT=$(source)/$(DUKE3D)
|
||||
DUKE3D_SRC=$(DUKE3D_ROOT)/src
|
||||
DUKE3D_RSRC=$(DUKE3D_ROOT)/rsrc
|
||||
DUKE3D_OBJ=$(obj)/$(DUKE3D)
|
||||
DUKE3D_CFLAGS := -I$(DUKE3D_SRC)
|
||||
|
||||
DUKE3D_GAME ?= eduke32
|
||||
DUKE3D_EDITOR ?= mapster32
|
||||
COMMON_EDITOR_DEPS := DUKE3D_COMMON_EDITOR ENGINE_EDITOR
|
||||
|
||||
ifneq (,$(APPBASENAME))
|
||||
DUKE3D_GAME = $(APPBASENAME)
|
||||
DUKE3D_GAME_DEPS := DUKE3D_COMMON_MIDI AUDIOLIB MACT
|
||||
DUKE3D_EDITOR_DEPS := AUDIOLIB
|
||||
|
||||
ifneq (0,$(NETCODE))
|
||||
DUKE3D_GAME_DEPS += ENET
|
||||
endif
|
||||
|
||||
DUKE3D_GAME_PROPER ?= EDuke32
|
||||
DUKE3D_EDITOR_PROPER ?= Mapster32
|
||||
ifneq (0,$(LUNATIC))
|
||||
DUKE3D_GAME_DEPS += LUNATIC LUNATIC_GAME LPEG
|
||||
DUKE3D_EDITOR_DEPS += LUNATIC LUNATIC_EDITOR LPEG
|
||||
endif
|
||||
|
||||
DUKE3D_COMMON_EDITOR_OBJS = \
|
||||
DUKE3D_GAME := eduke32
|
||||
DUKE3D_EDITOR := mapster32
|
||||
|
||||
ifneq (,$(APPBASENAME))
|
||||
DUKE3D_GAME := $(APPBASENAME)
|
||||
endif
|
||||
|
||||
DUKE3D_GAME_PROPER := EDuke32
|
||||
DUKE3D_EDITOR_PROPER := Mapster32
|
||||
|
||||
DUKE3D_COMMON_EDITOR_OBJS := \
|
||||
m32common.cpp \
|
||||
m32def.cpp \
|
||||
m32exec.cpp \
|
||||
m32vars.cpp \
|
||||
|
||||
DUKE3D_GAME_OBJS = \
|
||||
DUKE3D_GAME_OBJS := \
|
||||
game.cpp \
|
||||
global.cpp \
|
||||
actors.cpp \
|
||||
|
@ -473,25 +487,25 @@ DUKE3D_GAME_OBJS = \
|
|||
screens.cpp \
|
||||
cmdline.cpp \
|
||||
|
||||
DUKE3D_EDITOR_OBJS = \
|
||||
DUKE3D_EDITOR_OBJS := \
|
||||
astub.cpp \
|
||||
common.cpp \
|
||||
grpscan.cpp \
|
||||
sounds_mapster32.cpp \
|
||||
|
||||
DUKE3D_GAME_RSRC_OBJS =
|
||||
DUKE3D_EDITOR_RSRC_OBJS =
|
||||
DUKE3D_GAME_GEN_OBJS =
|
||||
DUKE3D_EDITOR_GEN_OBJS =
|
||||
DUKE3D_GAME_RSRC_OBJS :=
|
||||
DUKE3D_EDITOR_RSRC_OBJS :=
|
||||
DUKE3D_GAME_GEN_OBJS :=
|
||||
DUKE3D_EDITOR_GEN_OBJS :=
|
||||
|
||||
DUKE3D_GAME_MISCDEPS=
|
||||
DUKE3D_EDITOR_MISCDEPS=
|
||||
DUKE3D_GAME_ORDERONLYDEPS=
|
||||
DUKE3D_EDITOR_ORDERONLYDEPS=
|
||||
DUKE3D_GAME_MISCDEPS :=
|
||||
DUKE3D_EDITOR_MISCDEPS :=
|
||||
DUKE3D_GAME_ORDERONLYDEPS :=
|
||||
DUKE3D_EDITOR_ORDERONLYDEPS :=
|
||||
|
||||
## Lunatic devel
|
||||
LUNATIC_SRC=$(DUKE3D_SRC)/lunatic
|
||||
LUNATIC_OBJ=$(DUKE3D_OBJ)
|
||||
LUNATIC_SRC := $(DUKE3D_SRC)/lunatic
|
||||
LUNATIC_OBJ := $(DUKE3D_OBJ)
|
||||
|
||||
ifneq (0,$(LUNATIC))
|
||||
COMPILERFLAGS += -I$(LUNATIC_SRC) -DLUNATIC
|
||||
|
@ -508,7 +522,7 @@ ifneq (0,$(LUNATIC))
|
|||
DUKE3D_CFLAGS += -DLUNATIC_DEFS_BC_SIZE=$(DEFS_BC_SIZE) -DLUNATIC_DEFS_M32_BC_SIZE=$(DEFS_M32_BC_SIZE)
|
||||
|
||||
# Lunatic object base names. These are not used in targets directly.
|
||||
LUNATIC_OBJS = \
|
||||
LUNATIC_OBJS := \
|
||||
defs_common.lua \
|
||||
engine_maptext.lua \
|
||||
engine.lua \
|
||||
|
@ -521,7 +535,7 @@ ifneq (0,$(LUNATIC))
|
|||
dis_x86.lua \
|
||||
dis_x64.lua \
|
||||
|
||||
LUNATIC_GAME_OBJS = \
|
||||
LUNATIC_GAME_OBJS := \
|
||||
lunatic_game.cpp \
|
||||
_defs_game.lua \
|
||||
con_lang.lua \
|
||||
|
@ -532,7 +546,7 @@ ifneq (0,$(LUNATIC))
|
|||
lunasave.lua \
|
||||
fs.lua \
|
||||
|
||||
LUNATIC_EDITOR_OBJS = \
|
||||
LUNATIC_EDITOR_OBJS := \
|
||||
lunatic_editor.cpp \
|
||||
_defs_editor.lua \
|
||||
|
||||
|
@ -554,12 +568,12 @@ ifneq (0,$(LUNATIC))
|
|||
LINKERFLAGS += -pagezero_size 10000 -image_base 100000000
|
||||
endif
|
||||
ifeq ($(PLATFORM),WINDOWS)
|
||||
override STRIP=
|
||||
override STRIP :=
|
||||
DUKE3D_GAME_MISCDEPS += $(DUKE3D_OBJ)/lunatic_dynsymlist_game.def
|
||||
DUKE3D_EDITOR_MISCDEPS += $(DUKE3D_OBJ)/lunatic_dynsymlist_editor.def
|
||||
endif
|
||||
ifeq ($(SUBPLATFORM),LINUX)
|
||||
override STRIP=
|
||||
override STRIP :=
|
||||
DUKE3D_GAME_LDFLAGS += -Wl,--dynamic-list=$(LUNATIC_SRC)/dynsymlist_game.lds
|
||||
DUKE3D_EDITOR_LDFLAGS += -Wl,--dynamic-list=$(LUNATIC_SRC)/dynsymlist_editor.lds
|
||||
endif
|
||||
|
@ -597,7 +611,7 @@ ifeq ($(PLATFORM),WINDOWS)
|
|||
endif
|
||||
ifeq ($(MIXERTYPE),WIN)
|
||||
LIBS += -ldsound
|
||||
DUKE3D_COMMON_MIDI_OBJS=music.cpp midi.cpp mpu401.cpp
|
||||
DUKE3D_COMMON_MIDI_OBJS := music.cpp midi.cpp mpu401.cpp
|
||||
endif
|
||||
endif
|
||||
|
||||
|
@ -615,43 +629,32 @@ ifeq ($(RENDERTYPE),SDL)
|
|||
DUKE3D_EDITOR_RSRC_OBJS += build_icon.c
|
||||
endif
|
||||
ifeq ($(MIXERTYPE),SDL)
|
||||
DUKE3D_COMMON_MIDI_OBJS=sdlmusic.cpp
|
||||
endif
|
||||
|
||||
COMMON_EDITOR_DEPS=DUKE3D_COMMON_EDITOR ENGINE_EDITOR
|
||||
|
||||
DUKE3D_GAME_DEPS=DUKE3D_COMMON_MIDI AUDIOLIB MACT
|
||||
DUKE3D_EDITOR_DEPS=AUDIOLIB
|
||||
|
||||
ifneq (0,$(NETCODE))
|
||||
DUKE3D_GAME_DEPS += ENET
|
||||
endif
|
||||
|
||||
ifneq (0,$(LUNATIC))
|
||||
DUKE3D_GAME_DEPS += LUNATIC LUNATIC_GAME LPEG
|
||||
DUKE3D_EDITOR_DEPS += LUNATIC LUNATIC_EDITOR LPEG
|
||||
DUKE3D_COMMON_MIDI_OBJS := sdlmusic.cpp
|
||||
endif
|
||||
|
||||
|
||||
#### Shadow Warrior
|
||||
|
||||
SW=sw
|
||||
sw=SW
|
||||
SW := sw
|
||||
sw := SW
|
||||
|
||||
SW_ROOT=$(source)/$(SW)
|
||||
SW_SRC=$(SW_ROOT)/src
|
||||
SW_RSRC=$(SW_ROOT)/rsrc
|
||||
SW_OBJ=$(obj)/$(SW)
|
||||
SW_ROOT := $(source)/$(SW)
|
||||
SW_SRC := $(SW_ROOT)/src
|
||||
SW_RSRC := $(SW_ROOT)/rsrc
|
||||
SW_OBJ := $(obj)/$(SW)
|
||||
|
||||
SW_CFLAGS=-I$(SW_SRC)
|
||||
SW_CFLAGS := -I$(SW_SRC)
|
||||
|
||||
SW_GAME ?= voidsw
|
||||
SW_EDITOR ?= voidsw-editor
|
||||
SW_GAME_DEPS := DUKE3D_COMMON_MIDI AUDIOLIB MACT
|
||||
SW_EDITOR_DEPS := AUDIOLIB
|
||||
|
||||
SW_GAME_PROPER ?= VoidSW
|
||||
SW_EDITOR_PROPER ?= VoidSW Editor
|
||||
SW_GAME := voidsw
|
||||
SW_EDITOR := voidsw-editor
|
||||
|
||||
SW_GAME_OBJS = \
|
||||
SW_GAME_PROPER := VoidSW
|
||||
SW_EDITOR_PROPER := VoidSW Editor
|
||||
|
||||
SW_GAME_OBJS := \
|
||||
actor.cpp \
|
||||
ai.cpp \
|
||||
anim.cpp \
|
||||
|
@ -724,7 +727,7 @@ SW_GAME_OBJS = \
|
|||
zombie.cpp \
|
||||
saveable.cpp \
|
||||
|
||||
SW_EDITOR_OBJS = \
|
||||
SW_EDITOR_OBJS := \
|
||||
jnstub.cpp \
|
||||
brooms.cpp \
|
||||
bldscript.cpp \
|
||||
|
@ -733,10 +736,10 @@ SW_EDITOR_OBJS = \
|
|||
grpscan.cpp \
|
||||
common.cpp \
|
||||
|
||||
SW_GAME_RSRC_OBJS =
|
||||
SW_EDITOR_RSRC_OBJS =
|
||||
SW_GAME_GEN_OBJS =
|
||||
SW_EDITOR_GEN_OBJS =
|
||||
SW_GAME_RSRC_OBJS :=
|
||||
SW_EDITOR_RSRC_OBJS :=
|
||||
SW_GAME_GEN_OBJS :=
|
||||
SW_EDITOR_GEN_OBJS :=
|
||||
|
||||
ifeq (1,$(HAVE_GTK2))
|
||||
SW_GAME_OBJS += startgtk.game.cpp
|
||||
|
@ -753,8 +756,10 @@ ifeq ($(PLATFORM),WINDOWS)
|
|||
SW_EDITOR_RSRC_OBJS += buildres.rc
|
||||
endif
|
||||
|
||||
SW_GAME_DEPS=DUKE3D_COMMON_MIDI AUDIOLIB MACT
|
||||
SW_EDITOR_DEPS=AUDIOLIB
|
||||
|
||||
#### Final setup
|
||||
|
||||
COMPILERFLAGS += -I$(ENGINE_INC) -I$(MACT_INC) -I$(AUDIOLIB_INC) -I$(ENET_INC)
|
||||
|
||||
|
||||
##### Recipes
|
||||
|
@ -772,12 +777,12 @@ LIBRARIES := \
|
|||
LIBXMPLITE \
|
||||
LPEG \
|
||||
|
||||
COMPONENTS = \
|
||||
COMPONENTS := \
|
||||
$(GAMES) \
|
||||
$(LIBRARIES) \
|
||||
TOOLS \
|
||||
|
||||
ROLES = \
|
||||
ROLES := \
|
||||
GAME \
|
||||
EDITOR \
|
||||
|
||||
|
@ -814,7 +819,7 @@ tools: $(addsuffix $(EXESUFFIX),$(TOOLS_TARGETS)) | start
|
|||
$(foreach i,$(GAMES),$($i)): $$(foreach i,$(ROLES),$$($$($$@)_$$i)$(EXESUFFIX)) | start
|
||||
@ls -l $^
|
||||
|
||||
ebacktrace: $(EBACKTRACEDLL) | start
|
||||
ebacktrace: $(EBACKTRACE_DLL) | start
|
||||
@ls -l $^
|
||||
|
||||
ifeq ($(PLATFORM),WII)
|
||||
|
@ -854,7 +859,7 @@ include $(SW_ROOT)/Dependencies.mak
|
|||
|
||||
#### Rules
|
||||
|
||||
$(EBACKTRACEDLL): platform/Windows/src/backtrace.c
|
||||
$(EBACKTRACE_DLL): platform/Windows/src/backtrace.c
|
||||
$(COMPILE_STATUS)
|
||||
$(RECIPE_IF) $(CC) $(CONLYFLAGS) -O2 -ggdb -shared -Wall -Wextra -static-libgcc -I$(ENGINE_INC) -o $@ $^ -lbfd -liberty -limagehlp $(RECIPE_RESULT_COMPILE)
|
||||
|
||||
|
@ -983,7 +988,7 @@ cleantools:
|
|||
|
||||
clean: cleanduke3d cleantools
|
||||
-rm -rf $(obj)/
|
||||
-rm -f $(EBACKTRACEDLL)
|
||||
-rm -f $(EBACKTRACE_DLL)
|
||||
|
||||
printtools:
|
||||
echo "$(addsuffix $(EXESUFFIX),$(TOOLS_TARGETS))"
|
||||
|
|
Loading…
Reference in a new issue