2008-08-20 22:58:09 +00:00
|
|
|
#
|
2006-04-13 20:47:06 +00:00
|
|
|
# EDuke32 Makefile for GNU Make
|
2008-08-20 22:58:09 +00:00
|
|
|
#
|
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
include Makefile.common
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2008-10-19 12:14:04 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# Build locations
|
2012-11-15 06:42:37 +00:00
|
|
|
#
|
2006-08-31 01:54:23 +00:00
|
|
|
SRC=source
|
|
|
|
RSRC=rsrc
|
|
|
|
ESRC=$(EROOT)/src
|
|
|
|
EINC=$(EROOT)/include
|
2006-04-13 20:47:06 +00:00
|
|
|
INC=$(SRC)
|
|
|
|
o=o
|
2008-11-12 04:16:41 +00:00
|
|
|
# ENETROOT=$(ESRC)/enet
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
ifneq (0,$(RELEASE))
|
2010-08-12 21:06:51 +00:00
|
|
|
# Debugging disabled
|
2010-12-19 22:29:01 +00:00
|
|
|
debug+= $(F_NO_STACK_PROTECTOR)
|
2006-04-13 20:47:06 +00:00
|
|
|
else
|
2010-08-12 21:06:51 +00:00
|
|
|
# Debugging enabled
|
2010-07-03 08:53:57 +00:00
|
|
|
ifneq (0,$(KRANDDEBUG))
|
2010-12-19 22:29:01 +00:00
|
|
|
debug+= -fno-inline -fno-inline-functions -fno-inline-functions-called-once
|
2010-07-03 08:53:57 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCOMMONFLAGS=$(BASECOMMONFLAGS) \
|
2012-11-16 15:40:28 +00:00
|
|
|
-I$(INC) -I$(EINC) -I$(SRC)/jmact -I$(JAUDIOLIBDIR)/include -I$(ENETDIR)/include
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCFLAGS=$(OURCOMMONFLAGS) $(BASECFLAGS)
|
2010-12-19 22:29:01 +00:00
|
|
|
OURCXXFLAGS=$(BASECXXFLAGS)
|
2012-03-12 04:48:42 +00:00
|
|
|
OURCONLYFLAGS=$(BASECONLYFLAGS)
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS=$(BASEASFLAGS)
|
2012-11-06 07:49:44 +00:00
|
|
|
PRINTLDFLAGS=$(BASELDFLAGS)
|
|
|
|
OURLDFLAGS=$(OURCOMMONFLAGS) $(PRINTLDFLAGS)
|
2011-09-20 19:12:24 +00:00
|
|
|
|
2012-10-07 15:25:58 +00:00
|
|
|
# Game/editor-specific linker options
|
|
|
|
GAMELDFLAGS=
|
|
|
|
EDITORLDFLAGS=
|
2009-04-07 18:56:22 +00:00
|
|
|
|
2012-11-24 09:13:29 +00:00
|
|
|
LIBS=
|
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
|
|
|
LIBDIRS=
|
2012-11-24 09:13:29 +00:00
|
|
|
|
2009-07-27 05:34:05 +00:00
|
|
|
JAUDIOLIBDIR=$(SRC)/jaudiolib
|
|
|
|
JAUDIOLIB=libjfaudiolib.a
|
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
ENETDIR=$(SRC)/enet
|
|
|
|
ENETLIB=libenet.a
|
|
|
|
|
2012-12-09 13:24:44 +00:00
|
|
|
ifeq ($(NETCODE),0)
|
|
|
|
ENET_TARGET=
|
|
|
|
else
|
|
|
|
ENET_TARGET=$(ENETDIR)/$(ENETLIB)
|
|
|
|
endif
|
|
|
|
|
2011-09-21 22:38:24 +00:00
|
|
|
|
2010-12-19 22:29:01 +00:00
|
|
|
include $(EROOT)/Makefile.shared
|
2006-04-15 03:12:08 +00:00
|
|
|
|
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
|
|
|
# The reasoning for this order is so SDL_mixer can link to SDL, etc.
|
|
|
|
OURLIBS=$(LIBDIRS) $(BASELIBDIRS) $(BUILDLIBDIRS) $(LIBS) $(BASELIBS) $(BUILDLIBS)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-10-29 04:26:25 +00:00
|
|
|
|
|
|
|
EDUKE32 ?= eduke32$(EXESUFFIX)
|
|
|
|
MAPSTER32 ?= mapster32$(EXESUFFIX)
|
|
|
|
|
|
|
|
EDUKE32_TARGET:=$(EDUKE32)
|
2013-03-21 09:49:12 +00:00
|
|
|
MAPSTER32_TARGET:=$(MAPSTER32)
|
2012-10-29 04:26:25 +00:00
|
|
|
|
2012-12-16 05:45:29 +00:00
|
|
|
ifndef EBACKTRACEDLL
|
|
|
|
EBACKTRACEDLL = ebacktrace1.dll
|
|
|
|
ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
|
|
|
|
EBACKTRACEDLL = ebacktrace1-64.dll
|
|
|
|
endif
|
|
|
|
endif
|
2012-11-26 08:24:54 +00:00
|
|
|
EBACKTRACEDLL_TARGET:=$(EBACKTRACEDLL)
|
2012-10-29 04:26:25 +00:00
|
|
|
|
2010-05-03 08:30:25 +00:00
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2013-03-04 04:14:19 +00:00
|
|
|
OBJ=$(SRC)/obj_win
|
|
|
|
EOBJ=$(SRC)/eobj_win
|
2010-05-03 08:30:25 +00:00
|
|
|
else
|
2012-12-13 02:32:59 +00:00
|
|
|
ifeq ($(SUBPLATFORM),LINUX)
|
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
|
|
|
LIBS+= -lrt
|
2007-08-17 03:16:46 +00:00
|
|
|
endif
|
2013-03-04 04:14:19 +00:00
|
|
|
OBJ=$(SRC)/obj
|
|
|
|
EOBJ=$(SRC)/eobj
|
2010-05-03 08:30:25 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2010-07-19 15:14:00 +00:00
|
|
|
JMACTOBJ=$(OBJ)/file_lib.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/control.$o \
|
|
|
|
$(OBJ)/keyboard.$o \
|
|
|
|
$(OBJ)/mouse.$o \
|
2012-06-03 16:11:22 +00:00
|
|
|
$(OBJ)/joystick.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/mathutil.$o \
|
2008-10-20 03:09:19 +00:00
|
|
|
$(OBJ)/scriplib.$o \
|
|
|
|
$(OBJ)/animlib.$o
|
2006-08-31 01:54:23 +00:00
|
|
|
|
|
|
|
GAMEOBJS=$(OBJ)/game.$o \
|
|
|
|
$(OBJ)/actors.$o \
|
|
|
|
$(OBJ)/anim.$o \
|
2012-03-26 22:03:20 +00:00
|
|
|
$(OBJ)/common.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/config.$o \
|
2010-08-02 08:13:51 +00:00
|
|
|
$(OBJ)/demo.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/gamedef.$o \
|
|
|
|
$(OBJ)/gameexec.$o \
|
2006-12-10 19:32:44 +00:00
|
|
|
$(OBJ)/gamevars.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/global.$o \
|
2012-06-03 16:11:22 +00:00
|
|
|
$(OBJ)/input.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/menus.$o \
|
|
|
|
$(OBJ)/namesdyn.$o \
|
2010-08-02 08:13:51 +00:00
|
|
|
$(OBJ)/net.$o \
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/player.$o \
|
|
|
|
$(OBJ)/premap.$o \
|
|
|
|
$(OBJ)/savegame.$o \
|
|
|
|
$(OBJ)/sector.$o \
|
|
|
|
$(OBJ)/rts.$o \
|
|
|
|
$(OBJ)/osdfuncs.$o \
|
|
|
|
$(OBJ)/osdcmds.$o \
|
2006-11-16 03:02:42 +00:00
|
|
|
$(OBJ)/grpscan.$o \
|
2009-07-27 05:34:05 +00:00
|
|
|
$(OBJ)/sounds.$o \
|
2013-06-01 06:55:30 +00:00
|
|
|
$(OBJ)/soundsdyn.$o \
|
2006-04-13 20:47:06 +00:00
|
|
|
$(JMACTOBJ)
|
|
|
|
|
2009-03-15 22:58:20 +00:00
|
|
|
EDITOROBJS=$(OBJ)/astub.$o \
|
2012-03-26 22:03:20 +00:00
|
|
|
$(OBJ)/common.$o \
|
2009-09-12 23:03:15 +00:00
|
|
|
$(OBJ)/m32def.$o \
|
|
|
|
$(OBJ)/m32exec.$o \
|
|
|
|
$(OBJ)/m32vars.$o \
|
2010-12-19 22:29:01 +00:00
|
|
|
$(OBJ)/mathutil.$o \
|
|
|
|
$(OBJ)/sounds_mapster32.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2011-07-18 19:06:29 +00:00
|
|
|
ifneq ($(USE_LIBVPX),0)
|
|
|
|
GAMEOBJS+= $(OBJ)/animvpx.$o
|
|
|
|
endif
|
2011-09-20 19:12:24 +00:00
|
|
|
|
2012-11-05 02:49:08 +00:00
|
|
|
ifneq (0,$(DISABLEINLINING))
|
|
|
|
GAMEOBJS+= $(OBJ)/game_inline.$o \
|
|
|
|
$(OBJ)/actors_inline.$o \
|
|
|
|
$(OBJ)/sector_inline.$o
|
|
|
|
endif
|
|
|
|
|
2011-12-04 18:09:50 +00:00
|
|
|
MISCGAMEDEPS=
|
2012-11-30 18:57:50 +00:00
|
|
|
MISCEDITORDEPS=
|
2011-12-04 18:09:50 +00:00
|
|
|
|
2011-12-03 13:12:51 +00:00
|
|
|
|
|
|
|
## Lunatic devel
|
2011-09-20 19:12:24 +00:00
|
|
|
ifneq (0,$(LUNATIC))
|
2013-05-06 19:43:34 +00:00
|
|
|
LUNATIC_COMMON_OBJS = $(OBJ)/luaJIT_BC_defs_common.$o $(OBJ)/luaJIT_BC_engine_maptext.$o
|
|
|
|
EDITOROBJS+= $(OBJ)/lunatic_m32.$o $(LUNATIC_COMMON_OBJS)
|
|
|
|
GAMEOBJS+= $(OBJ)/lunatic_game.$o $(LUNATIC_COMMON_OBJS)
|
2011-12-03 13:12:51 +00:00
|
|
|
|
2013-07-07 20:59:14 +00:00
|
|
|
ifneq ($(PLATFORM),WINDOWS)
|
|
|
|
# On non-Windows, we expect to have liblpeg.a (or a symlink to it) in source/.
|
|
|
|
# On Windows, it will reside in platform/Windows/lib32 or lib64.
|
2013-07-09 18:23:43 +00:00
|
|
|
LIBDIRS+= -L$(OBJ)/..
|
2013-07-07 20:59:14 +00:00
|
|
|
ifeq ($(realpath $(OBJ)/../liblpeg.a),)
|
|
|
|
# XXX: This cripples "make clean" etc. too, but IMO it's better than warning.
|
|
|
|
$(error "liblpeg.a not found in $(realpath $(OBJ)/..)")
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
LIBS+= -llpeg
|
2012-05-13 16:05:16 +00:00
|
|
|
GAMEOBJS+= $(OBJ)/luaJIT_BC_con_lang.$o \
|
2012-08-02 10:52:21 +00:00
|
|
|
$(OBJ)/luaJIT_BC_lunacon.$o \
|
2012-08-02 10:52:32 +00:00
|
|
|
$(OBJ)/luaJIT_BC_randgen.$o \
|
2012-08-02 10:52:44 +00:00
|
|
|
$(OBJ)/luaJIT_BC_stat.$o \
|
2012-08-06 20:00:29 +00:00
|
|
|
$(OBJ)/luaJIT_BC_bitar.$o \
|
2013-01-26 17:07:44 +00:00
|
|
|
$(OBJ)/luaJIT_BC_control.$o \
|
2013-02-01 13:04:56 +00:00
|
|
|
$(OBJ)/luaJIT_BC_bcarray.$o \
|
2013-02-16 18:53:15 +00:00
|
|
|
$(OBJ)/luaJIT_BC_bcheck.$o \
|
2013-02-24 16:05:31 +00:00
|
|
|
$(OBJ)/luaJIT_BC_xmath.$o \
|
|
|
|
$(OBJ)/luaJIT_BC_defs.$o \
|
2013-02-28 17:30:04 +00:00
|
|
|
$(OBJ)/luaJIT_BC_v.$o \
|
2013-03-24 18:54:14 +00:00
|
|
|
$(OBJ)/luaJIT_BC_dump.$o \
|
|
|
|
$(OBJ)/luaJIT_BC_dis_x86.$o \
|
|
|
|
$(OBJ)/luaJIT_BC_dis_x64.$o \
|
2013-05-20 19:31:42 +00:00
|
|
|
$(OBJ)/luaJIT_BC_savegame.$o \
|
2013-03-24 18:54:14 +00:00
|
|
|
# TODO: remove debugging modules from release build
|
2012-05-13 16:05:16 +00:00
|
|
|
|
2011-12-03 13:12:51 +00:00
|
|
|
# now, take care of having the necessary symbols (sector, wall, etc.) in the
|
|
|
|
# executable no matter what the debugging level
|
|
|
|
|
2011-10-11 16:53:15 +00:00
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
2011-12-03 13:12:51 +00:00
|
|
|
# strip on OSX says: removing global symbols from a final linked no longer supported.
|
|
|
|
# Use -exported_symbols_list at link time when building
|
|
|
|
# But, following _their_ directions does not give us the symbols! wtf?
|
2013-01-20 21:17:36 +00:00
|
|
|
ifneq ($(STRIP),0)
|
|
|
|
STRIP+= -s $(SRC)/lunatic/dynsymlist_osx
|
|
|
|
endif
|
2011-12-03 13:12:51 +00:00
|
|
|
|
2011-12-04 18:09:50 +00:00
|
|
|
MISCGAMEDEPS+= $(SRC)/lunatic/dynsymlist_osx
|
2012-11-06 07:49:44 +00:00
|
|
|
PRINTLDFLAGS+= -pagezero_size 10000 -image_base 100000000 #-Wl,-alias_list -Wl,$(SRC)/lunatic/aliases_list #-exported_symbols_list $(SRC)/lunatic/dynsymlist_osx
|
2011-12-03 13:12:51 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2013-01-21 21:18:10 +00:00
|
|
|
override STRIP=
|
2011-12-04 18:09:50 +00:00
|
|
|
MISCGAMEDEPS+= $(SRC)/lunatic/eduke32.def
|
2012-11-30 18:57:50 +00:00
|
|
|
GAMELDFLAGS+= $(SRC)/lunatic/eduke32.def
|
|
|
|
MISCEDITORDEPS+= $(SRC)/lunatic/mapster32.def
|
|
|
|
EDITORLDFLAGS+= $(SRC)/lunatic/mapster32.def
|
2011-12-03 13:12:51 +00:00
|
|
|
endif
|
2012-12-13 02:32:59 +00:00
|
|
|
ifeq ($(SUBPLATFORM),LINUX)
|
2013-01-21 21:18:10 +00:00
|
|
|
override STRIP=
|
2012-10-07 15:25:58 +00:00
|
|
|
GAMELDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist
|
|
|
|
EDITORLDFLAGS+= -Wl,--dynamic-list=$(SRC)/lunatic/dynsymlist_m32
|
2011-10-11 16:53:15 +00:00
|
|
|
endif
|
2011-09-20 19:12:24 +00:00
|
|
|
endif
|
|
|
|
|
2011-12-03 13:12:51 +00:00
|
|
|
|
2008-08-20 22:58:09 +00:00
|
|
|
# PLATFORM SPECIFIC SETTINGS
|
|
|
|
|
2012-12-13 02:32:59 +00:00
|
|
|
ifeq ($(SUBPLATFORM),LINUX)
|
2012-05-18 21:40:38 +00:00
|
|
|
ifeq (0,$(CLANG))
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCOMMONFLAGS += -fno-pic
|
2011-12-09 19:08:47 +00:00
|
|
|
endif
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS += -f elf
|
2012-12-29 10:57:24 +00:00
|
|
|
LIBS += -lFLAC -lvorbisfile -lvorbis -logg
|
2008-08-20 22:58:09 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
2012-12-13 02:34:30 +00:00
|
|
|
OURCOMMONFLAGS += -fno-pic
|
2012-12-29 10:54:35 +00:00
|
|
|
LIBDIRS += -L$(abspath $(JAUDIOLIBDIR)/third-party/Apple/lib)
|
2012-03-26 05:04:21 +00:00
|
|
|
|
|
|
|
ifneq ($(findstring x86_64,$(ARCH)),x86_64)
|
|
|
|
ifeq (,$(ARCH))
|
|
|
|
ifneq ($(findstring x86_64,$(SYSARCH)),x86_64)
|
|
|
|
LIBS += -read_only_relocs suppress
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
LIBS += -read_only_relocs suppress
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2010-08-12 21:06:51 +00:00
|
|
|
ifeq (1,$(SDL_FRAMEWORK))
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCOMMONFLAGS += -I$(APPLE_FRAMEWORKS)/SDL.framework/Headers \
|
2012-03-04 09:31:37 +00:00
|
|
|
-I$(APPLE_FRAMEWORKS)/SDL_mixer.framework/Headers
|
2012-03-26 05:04:21 +00:00
|
|
|
|
2012-12-29 10:57:24 +00:00
|
|
|
LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \
|
2013-03-04 04:14:19 +00:00
|
|
|
-Wl,-framework,SDL -Wl,-framework,SDL_mixer platform/Apple/lib/libSDLmain.a \
|
2010-08-12 21:06:51 +00:00
|
|
|
-Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
|
|
|
|
-Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
|
|
|
|
-Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
|
2012-03-08 06:06:00 +00:00
|
|
|
-Wl,-framework,QuickTime -lm \
|
2012-03-04 09:32:06 +00:00
|
|
|
-Wl,-rpath -Wl,"@loader_path/../Frameworks"
|
2011-06-17 11:53:41 +00:00
|
|
|
# We have SDLMain.m from the OSX SDL package in the Apple/ subdir:
|
|
|
|
EDITOROBJS+=$(OBJ)/SDLMain.$o
|
|
|
|
GAMEOBJS+=$(OBJ)/SDLMain.$o
|
2010-08-12 21:06:51 +00:00
|
|
|
else
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
|
2012-12-29 10:57:24 +00:00
|
|
|
LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm -lSDL_mixer \
|
2010-08-12 21:06:51 +00:00
|
|
|
-Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
|
|
|
|
-Wl,-framework,CoreMidi -Wl,-framework,AudioUnit \
|
|
|
|
-Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL \
|
|
|
|
-Wl,-framework,QuickTime -lm
|
|
|
|
endif
|
2012-03-26 05:04:21 +00:00
|
|
|
|
2012-03-08 06:07:10 +00:00
|
|
|
ifneq (0,$(OSX_STARTUPWINDOW))
|
2012-12-29 10:54:35 +00:00
|
|
|
GAMEOBJS+=$(OBJ)/GrpFile.game.$o $(OBJ)/GameListSource.game.$o $(OBJ)/startosx.game.$o
|
2012-03-08 06:07:10 +00:00
|
|
|
endif
|
2012-03-26 05:04:21 +00:00
|
|
|
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS += -f macho
|
2008-08-20 22:58:09 +00:00
|
|
|
endif
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2012-11-24 09:13:29 +00:00
|
|
|
OURCOMMONFLAGS += -fno-pic -DUNDERSCORES
|
2012-03-23 20:22:10 +00:00
|
|
|
OURASFLAGS+= -DUNDERSCORES -f win32
|
2012-12-29 10:57:24 +00:00
|
|
|
LIBS += -lFLAC -lvorbisfile -lvorbis -logg
|
2012-12-29 10:54:35 +00:00
|
|
|
LIBDIRS += -L$(abspath $(JAUDIOLIBDIR)/third-party/Windows/lib$(WINLIB))
|
2012-11-24 09:13:29 +00:00
|
|
|
GAMEOBJS+= $(OBJ)/gameres.$o $(OBJ)/winbits.$o $(OBJ)/startwin.game.$o
|
2010-08-12 21:06:51 +00:00
|
|
|
EDITOROBJS+= $(OBJ)/buildres.$o
|
2009-07-27 05:34:05 +00:00
|
|
|
JAUDIOLIB=libjfaudiolib_win32.a
|
2009-12-05 09:22:43 +00:00
|
|
|
ENETLIB=libenet_win32.a
|
2012-11-24 09:13:29 +00:00
|
|
|
ifeq ($(RENDERTYPE),WIN)
|
2012-12-13 02:34:30 +00:00
|
|
|
OURCOMMONFLAGS += -I$(DXROOT) -I$(DXROOT)/include
|
2012-11-24 09:13:29 +00:00
|
|
|
LIBS+= -ldsound
|
|
|
|
GAMEOBJS+= $(OBJ)/music.$o $(OBJ)/midi.$o $(OBJ)/mpu401.$o
|
|
|
|
endif
|
|
|
|
endif
|
2010-08-12 21:06:51 +00:00
|
|
|
# -lGLU to build with gluBuild2DMipmaps
|
2012-11-24 09:13:29 +00:00
|
|
|
ifeq ($(RENDERTYPE),SDL)
|
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
2012-12-13 02:34:30 +00:00
|
|
|
OURCOMMONFLAGS += -I$(SDLROOT)/include -I$(SDLROOT)/include/SDL
|
2013-03-04 04:14:19 +00:00
|
|
|
LIBS+= platform/Windows/lib$(WINLIB)/SDL_mixer.lib
|
Win64 support! (Meaning it works, not that we recommend it for everyday use.)
This includes a complete Windows header and library refresh, including the addition of 64-bit compiled libs:
*libogg 1.3.0
*libvorbis 1.3.3
*zlib 1.2.7
*libpng 1.5.13
*libvpx 9a3de881c0e681ba1a79a166a86308bbc84b4acd
*SDL_mixer 1.2.12 (for RENDERTYPE=SDL)
*DirectX import libraries: dsound and dxguid (now included)
To build in 64-bit, you essentially need MinGW's MSYS (but not MinGW itself) and MinGW-w64 at the top of your PATH. The target is automatically detected using `$(CC) -dumpmachine`. The EDukeWiki will get detailed instrucitons.
All compiler and linker warnings when building in 64-bit mode have been fixed.
Remaining 64-bit to-do:
- The ebacktrace dll does not build under 64-bit. It uses code specific to the format of 32-bit executables and will have to be ported to work with 64-bit executables. A future 64-bit version will be named ebacktrace1-64.dll.
- RENDERTYPE=SDL crashes in SDL_mixer's Mix_Linked_Version().
- DirectInput gives an error and does not function. This only affects joysticks, and the error never happens without any plugged in.
- Port the classic renderer ASM to 64-bit. (Just kidding, this is way out of my league.)
This commit includes a fair bit of Makefile development spanning all platforms, including simplifying the SDLCONFIG code, fixing build on Mac OS X (thanks rhoenie!), globally factoring Apple brew/port inclusion, enforcing that all -L come before all -l, and ensuring that $(shell ) is always :='d.
In addition, I have resurrected the old GCC_MAJOR and GCC_MINOR detection using `$(CC) -dumpversion`, but I have made it failsafe in case the command fails or the version is manually specified. I have applied this new fine-grained detection where applicable, including allowing LTO, and restraining -W's to versions that support them.
git-svn-id: https://svn.eduke32.com/eduke32@3278 1a8010ca-5511-0410-912e-c29ae57300e0
2012-12-13 02:37:20 +00:00
|
|
|
LIBDIRS+= -L$(SDLROOT)/lib
|
2012-11-24 09:13:29 +00:00
|
|
|
else
|
|
|
|
ifneq ($(PLATFORM),DARWIN)
|
Add prototypical SDL 2.X support.
Doesn't work: indexed-color modes, gamma (at least for X11), mouse wheel,
special keys like ENTER or BACKSPACE in the OSD, probably more...
In build/Makefile.shared, we now have logic to autodetect an SDL2 installed
in /usr/local, however OS X and Wii builds follow other Makefile code paths,
it seems. Note that the matching SDL2_mixer must be used then, too.
In source/jaudiolib/src/driver_sdl.c, change the #includes from <SDL/SDL_xxx.h>
to "SDL_xxx.h". SDL wiki says this is the most portable way, hopefully this
doesn't break builds for anyone.
git-svn-id: https://svn.eduke32.com/eduke32@2777 1a8010ca-5511-0410-912e-c29ae57300e0
2012-06-22 21:39:53 +00:00
|
|
|
LIBS+= -l$(SDLNAME)_mixer
|
2010-08-12 21:06:51 +00:00
|
|
|
endif
|
2012-11-24 09:13:29 +00:00
|
|
|
endif
|
2010-08-12 21:06:51 +00:00
|
|
|
|
2012-11-24 09:13:29 +00:00
|
|
|
ifeq (1,$(HAVE_GTK2))
|
|
|
|
OURCOMMONFLAGS+= -DHAVE_GTK2 $(shell pkg-config --cflags gtk+-2.0)
|
|
|
|
GAMEOBJS+= $(OBJ)/game_banner.$o $(OBJ)/startgtk.game.$o
|
|
|
|
EDITOROBJS+= $(OBJ)/editor_banner.$o
|
2009-07-28 06:32:58 +00:00
|
|
|
endif
|
2012-11-24 09:13:29 +00:00
|
|
|
|
|
|
|
GAMEOBJS+= $(OBJ)/game_icon.$o $(OBJ)/sdlmusic.$o
|
|
|
|
EDITOROBJS+= $(OBJ)/build_icon.$o
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
OURCOMMONFLAGS+= $(BUILDCOMMONFLAGS)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2011-01-03 23:50:20 +00:00
|
|
|
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
|
|
|
ifneq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
|
|
|
|
PRINTLDFLAGS+= -Wl,--large-address-aware
|
|
|
|
endif
|
2011-01-03 22:04:20 +00:00
|
|
|
endif
|
2011-10-27 13:14:06 +00:00
|
|
|
#ifneq (0,$(KRANDDEBUG))
|
2011-11-17 21:10:18 +00:00
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
2012-11-06 07:49:44 +00:00
|
|
|
PRINTLDFLAGS+=-Wl,-map -Wl,$@.memmap
|
2011-11-17 21:10:18 +00:00
|
|
|
else
|
2012-11-06 07:49:44 +00:00
|
|
|
PRINTLDFLAGS+=-Wl,-Map=$@.memmap
|
2011-11-17 21:10:18 +00:00
|
|
|
endif
|
2011-10-27 13:14:06 +00:00
|
|
|
#endif
|
2010-08-12 21:06:51 +00:00
|
|
|
ifneq (0,$(PROFILER))
|
2012-11-06 07:49:44 +00:00
|
|
|
PRINTLDFLAGS+=-pg
|
2010-01-24 23:33:17 +00:00
|
|
|
endif
|
2012-05-01 12:37:53 +00:00
|
|
|
ifeq ($(PLATFORM),WII)
|
2012-11-06 07:49:44 +00:00
|
|
|
PRINTLDFLAGS+= -mrvl -meabi -mhard-float -Wl,--gc-sections -Wl,-Map,$(notdir $@).map
|
2012-05-20 07:25:25 +00:00
|
|
|
# -msdata=eabi
|
2012-05-01 12:37:53 +00:00
|
|
|
endif
|
2010-01-24 23:33:17 +00:00
|
|
|
|
2012-11-06 07:49:44 +00:00
|
|
|
COMPILER=$(CC) $(OURCONLYFLAGS)
|
|
|
|
LINKER=$(L_CC)
|
2012-11-05 02:49:08 +00:00
|
|
|
ifneq ($(CPLUSPLUS),0)
|
2012-11-06 07:49:44 +00:00
|
|
|
COMPILER=$(CXX) $(OURCXXFLAGS)
|
|
|
|
LINKER=$(L_CXX)
|
2012-11-05 02:49:08 +00:00
|
|
|
endif
|
|
|
|
|
2008-10-19 12:14:04 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
2008-10-18 12:37:26 +00:00
|
|
|
.SILENT:
|
2008-10-19 12:14:04 +00:00
|
|
|
endif
|
2009-12-05 09:22:43 +00:00
|
|
|
.PHONY: clean all engine $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENETDIR)/$(ENETLIB)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
# TARGETS
|
|
|
|
|
2012-11-15 06:42:37 +00:00
|
|
|
UTILOBJS=$(OBJ)/ivfrate.$o
|
|
|
|
UTILS=ivfrate$(EXESUFFIX)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-11-26 08:24:54 +00:00
|
|
|
all: start $(EDUKE32_TARGET) $(MAPSTER32_TARGET) finish
|
2012-05-20 07:25:25 +00:00
|
|
|
ifneq (,$(EDUKE32_TARGET))
|
2012-10-29 04:26:25 +00:00
|
|
|
@ls -l $(EDUKE32)
|
2012-05-20 07:25:25 +00:00
|
|
|
endif
|
|
|
|
ifneq (,$(MAPSTER32_TARGET))
|
2012-10-29 04:26:25 +00:00
|
|
|
@ls -l $(MAPSTER32)
|
2012-05-20 07:25:25 +00:00
|
|
|
endif
|
2012-11-26 08:24:54 +00:00
|
|
|
|
|
|
|
ebacktrace: start $(EBACKTRACEDLL_TARGET) finish
|
2012-11-15 06:42:37 +00:00
|
|
|
ifneq (,$(EBACKTRACEDLL_TARGET))
|
|
|
|
@ls -l $(EBACKTRACEDLL)
|
|
|
|
endif
|
2008-10-18 12:37:26 +00:00
|
|
|
|
2012-11-15 06:42:37 +00:00
|
|
|
utils: start $(UTILS) finish
|
|
|
|
@ls -l $(UTILS)
|
|
|
|
|
|
|
|
start:
|
2008-10-18 13:25:23 +00:00
|
|
|
$(BUILD_STARTED)
|
2010-01-24 23:33:17 +00:00
|
|
|
|
2012-11-15 06:42:37 +00:00
|
|
|
finish:
|
|
|
|
$(BUILD_FINISHED)
|
|
|
|
|
2012-10-29 04:26:25 +00:00
|
|
|
|
2012-12-09 13:24:44 +00:00
|
|
|
$(EDUKE32): $(GAMEOBJS) $(EOBJ)/$(ENGINELIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(ENET_TARGET) $(MISCGAMEDEPS)
|
2008-10-18 13:25:23 +00:00
|
|
|
$(LINK_STATUS)
|
2013-05-01 17:42:03 +00:00
|
|
|
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(GAMELDFLAGS) $(OURLIBS) $(STATICSTDCPP); then $(LINK_OK); else $(LINK_FAILED); fi
|
2013-01-20 21:17:36 +00:00
|
|
|
ifneq ($(STRIP),)
|
|
|
|
$(STRIP) $(EDUKE32)
|
2008-10-18 12:37:26 +00:00
|
|
|
endif
|
2012-02-25 02:59:51 +00:00
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
2013-03-04 04:14:19 +00:00
|
|
|
cp -RPf "platform/Apple/bundles/EDuke32.app" "./"
|
2012-02-26 17:32:53 +00:00
|
|
|
mkdir -p "EDuke32.app/Contents/MacOS"
|
2012-10-29 04:26:25 +00:00
|
|
|
cp -f "$(EDUKE32)" "EDuke32.app/Contents/MacOS/"
|
2012-02-25 02:59:51 +00:00
|
|
|
endif
|
2010-01-24 23:33:17 +00:00
|
|
|
|
2012-11-30 18:57:50 +00:00
|
|
|
$(MAPSTER32): $(EDITOROBJS) $(EOBJ)/$(ENGINELIB) $(EOBJ)/$(EDITORLIB) $(JAUDIOLIBDIR)/$(JAUDIOLIB) $(MISCEDITORDEPS)
|
2008-10-18 13:25:23 +00:00
|
|
|
$(LINK_STATUS)
|
2013-05-01 17:42:03 +00:00
|
|
|
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(EDITORLDFLAGS) $(OURLIBS) $(STATICSTDCPP); then $(LINK_OK); else $(LINK_FAILED); fi
|
2013-01-20 21:17:36 +00:00
|
|
|
ifneq ($(STRIP),)
|
|
|
|
$(STRIP) $(MAPSTER32)
|
2010-08-12 21:06:51 +00:00
|
|
|
endif
|
2012-02-25 02:59:51 +00:00
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
2013-03-04 04:14:19 +00:00
|
|
|
cp -RPf "platform/Apple/bundles/Mapster32.app" "./"
|
2012-02-26 17:32:53 +00:00
|
|
|
mkdir -p "Mapster32.app/Contents/MacOS"
|
2012-10-29 04:26:25 +00:00
|
|
|
cp -f "$(MAPSTER32)" "Mapster32.app/Contents/MacOS/"
|
2012-02-25 02:59:51 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
include Makefile.deps
|
|
|
|
|
|
|
|
.PHONY: enginelib editorlib
|
|
|
|
enginelib editorlib:
|
2006-11-19 07:09:43 +00:00
|
|
|
-mkdir -p $(EOBJ)
|
2008-10-20 12:33:29 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
2008-11-20 14:06:36 +00:00
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(EROOT)\033[0;35m \033[0m\n"
|
2010-12-19 22:29:01 +00:00
|
|
|
endif
|
2011-12-04 18:09:50 +00:00
|
|
|
$(MAKE) -C $(EROOT)/ "OBJ=../$(EOBJ)" $@ LUNATIC=$(LUNATIC)
|
2010-08-12 21:06:51 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
2008-11-20 14:06:36 +00:00
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
2008-10-20 12:33:29 +00:00
|
|
|
endif
|
2010-01-24 23:33:17 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(EOBJ)/$(ENGINELIB): enginelib
|
|
|
|
$(EOBJ)/$(EDITORLIB): editorlib
|
2009-07-27 05:34:05 +00:00
|
|
|
$(JAUDIOLIBDIR)/$(JAUDIOLIB):
|
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(JAUDIOLIBDIR)\033[0;35m \033[0m\n"
|
|
|
|
endif
|
2012-05-01 12:41:35 +00:00
|
|
|
$(MAKE) -C $(JAUDIOLIBDIR)
|
2009-07-27 05:34:05 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2009-12-05 09:22:43 +00:00
|
|
|
$(ENETDIR)/$(ENETLIB):
|
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)/$(ENETDIR)\033[0;35m \033[0m\n"
|
|
|
|
endif
|
2012-05-01 12:41:35 +00:00
|
|
|
$(MAKE) -C $(ENETDIR)
|
2009-12-05 09:22:43 +00:00
|
|
|
ifeq ($(PRETTY_OUTPUT),1)
|
|
|
|
printf "\033[K\033[0;35mChanging dir to \033[1;35m$(CURDIR)\033[0;35m \033[0m\n"
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
# RULES
|
2012-10-07 15:25:58 +00:00
|
|
|
|
2013-03-04 04:14:19 +00:00
|
|
|
$(EBACKTRACEDLL): platform/Windows/src/backtrace.c
|
2012-11-15 06:42:37 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-05 02:49:08 +00:00
|
|
|
if $(CC) $(OURCONLYFLAGS) -O2 -shared -Wall -Wextra -I$(EINC) -o $@ $^ -lbfd -liberty -limagehlp; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2011-09-21 22:38:24 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.nasm
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-03-23 20:22:10 +00:00
|
|
|
$(AS) $(OURASFLAGS) $< -o $@
|
2010-08-12 21:06:51 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2008-10-18 12:37:26 +00:00
|
|
|
|
2012-11-08 20:17:23 +00:00
|
|
|
#### Utilities
|
|
|
|
|
2012-11-15 06:42:37 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/util/%.c
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
|
|
|
|
|
|
|
ivfrate$(EXESUFFIX): $(OBJ)/ivfrate.$o
|
|
|
|
$(ONESTEP_STATUS)
|
2012-11-24 09:13:29 +00:00
|
|
|
if $(LINKER) -o $@ $^ $(OURLDFLAGS) $(OURLIBS); then $(ONESTEP_OK); else $(ONESTEP_FAILED); fi
|
2012-11-08 20:17:23 +00:00
|
|
|
|
2012-10-07 15:25:58 +00:00
|
|
|
#### Lunatic
|
|
|
|
|
2012-05-13 16:05:16 +00:00
|
|
|
# Create object files directly with luajit
|
|
|
|
$(OBJ)/luaJIT_BC_%.$o: $(SRC)/lunatic/%.lua
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(LUAJIT) -bg $< $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
|
|
|
|
2013-02-24 16:05:31 +00:00
|
|
|
# Same thing for defs.ilua which I'm too reluctant to rename now:
|
|
|
|
$(OBJ)/luaJIT_BC_%.$o: $(SRC)/lunatic/%.ilua
|
|
|
|
if $(LUAJIT) -bg $< $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
|
|
|
|
2011-09-20 19:12:24 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/lunatic/%.c
|
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2011-09-20 19:12:24 +00:00
|
|
|
|
2012-10-07 15:25:58 +00:00
|
|
|
# TODO: _m32
|
|
|
|
# List of exported symbols, OS X
|
2011-10-11 16:53:15 +00:00
|
|
|
$(SRC)/lunatic/dynsymlist_osx: $(SRC)/lunatic/dynsymlist
|
|
|
|
sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
|
|
|
|
|
2012-10-07 15:25:58 +00:00
|
|
|
#$(SRC)/lunatic/aliases_list: $(SRC)/lunatic/dynsymlist_osx
|
|
|
|
# sed 's/_\([A-Za-z_][A-Za-z_0-9]*\)/_\1 \1/g' $< > $@
|
2011-10-11 16:53:15 +00:00
|
|
|
|
2012-10-07 15:25:58 +00:00
|
|
|
# List of exported symbols, Windows
|
2011-12-03 13:12:51 +00:00
|
|
|
$(SRC)/lunatic/eduke32.def: $(SRC)/lunatic/dynsymlist
|
|
|
|
echo EXPORTS > $@
|
|
|
|
sed 's/[{};]//g' $< >> $@
|
|
|
|
|
2012-11-30 18:57:50 +00:00
|
|
|
$(SRC)/lunatic/mapster32.def: $(SRC)/lunatic/dynsymlist_m32
|
|
|
|
echo EXPORTS > $@
|
|
|
|
sed 's/[{};]//g' $< >> $@
|
|
|
|
|
2012-10-07 15:25:58 +00:00
|
|
|
####
|
|
|
|
|
2013-03-04 04:14:19 +00:00
|
|
|
$(OBJ)/%.$o: platform/Apple/%.m
|
2011-06-17 11:53:41 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
|
2012-12-29 10:54:35 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.m
|
|
|
|
$(COMPILE_STATUS)
|
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
|
|
|
|
2012-03-12 04:48:42 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.cc
|
|
|
|
$(COMPILE_STATUS)
|
2012-11-15 06:42:37 +00:00
|
|
|
if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2011-06-17 11:53:41 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.cpp
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-15 06:42:37 +00:00
|
|
|
if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2008-10-18 12:37:26 +00:00
|
|
|
|
2012-03-12 04:48:42 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/%.cxx
|
|
|
|
$(COMPILE_STATUS)
|
2012-11-15 06:42:37 +00:00
|
|
|
if $(CXX) $(OURCXXFLAGS) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2012-03-12 04:48:42 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/jmact/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-07-14 07:28:32 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(SRC)/misc/%.rc
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2009-09-29 23:27:48 +00:00
|
|
|
if $(RC) -i $< -o $@ --include-dir=$(EINC) --include-dir=$(SRC) -DPOLYMER=$(POLYMER); then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2006-07-14 07:28:32 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/%.$o: $(RSRC)/%.c
|
2008-10-18 13:25:23 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2010-01-24 23:33:17 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/game_banner.$o: $(RSRC)/game_banner.c
|
2011-01-16 03:43:48 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2011-02-12 13:25:24 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(OBJ)/editor_banner.$o: $(RSRC)/editor_banner.c
|
2011-01-16 03:43:48 +00:00
|
|
|
$(COMPILE_STATUS)
|
2012-11-06 07:49:44 +00:00
|
|
|
if $(COMPILER) $(OURCFLAGS) -Wno-pointer-sign -c $< -o $@; then $(COMPILE_OK); else $(COMPILE_FAILED); fi
|
2011-01-16 03:43:48 +00:00
|
|
|
|
2006-08-31 01:54:23 +00:00
|
|
|
$(RSRC)/game_banner.c: $(RSRC)/game.bmp
|
2006-04-13 20:47:06 +00:00
|
|
|
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
2012-11-09 18:05:21 +00:00
|
|
|
echo "extern const GdkPixdata startbanner_pixdata;" >> $@
|
2006-04-13 20:47:06 +00:00
|
|
|
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
2006-08-31 01:54:23 +00:00
|
|
|
$(RSRC)/editor_banner.c: $(RSRC)/build.bmp
|
2006-04-13 20:47:06 +00:00
|
|
|
echo "#include <gdk-pixbuf/gdk-pixdata.h>" > $@
|
2012-11-09 18:05:21 +00:00
|
|
|
echo "extern const GdkPixdata startbanner_pixdata;" >> $@
|
2006-04-13 20:47:06 +00:00
|
|
|
gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
|
|
|
|
|
2012-11-15 06:42:37 +00:00
|
|
|
# PHONIES
|
2008-08-20 22:58:09 +00:00
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
clean:
|
2012-12-16 04:04:16 +00:00
|
|
|
-rm -f $(OBJ)/* $(EDUKE32) $(EDUKE32).memmap $(MAPSTER32) $(MAPSTER32).memmap core* && $(MAKE) -C $(JAUDIOLIBDIR) clean && $(MAKE) -C $(ENETDIR) clean
|
2012-02-26 17:32:53 +00:00
|
|
|
ifeq ($(PLATFORM),DARWIN)
|
|
|
|
-rm -rf EDuke32.app Mapster32.app
|
|
|
|
endif
|
2011-07-21 23:40:01 +00:00
|
|
|
echo -n "" > $(OBJ)/keep.me
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-11-15 06:42:37 +00:00
|
|
|
cleanutils:
|
|
|
|
-rm -f $(UTILS) $(UTILOBJS) $(addsuffix .memmap, $(UTILS))
|
|
|
|
|
|
|
|
veryclean: clean cleanutils
|
2011-09-22 16:53:10 +00:00
|
|
|
-rm -f $(EOBJ)/* $(RSRC)/*banner* $(EBACKTRACEDLL)
|
2011-07-21 23:40:01 +00:00
|
|
|
echo -n "" > $(EOBJ)/keep.me
|
2012-11-15 06:42:37 +00:00
|
|
|
|
|
|
|
printutils:
|
|
|
|
echo "$(UTILS)"
|