2009-02-28 14:41:18 +00:00
|
|
|
# ------------------------------------------------------ #
|
|
|
|
# Makefile for the "Yamagi Quake 2 Client" #
|
|
|
|
# #
|
|
|
|
# Just type "make" to compile the #
|
|
|
|
# - SDL Client (quake2) #
|
2010-10-18 15:08:13 +00:00
|
|
|
# - Server (q2ded) #
|
2011-10-09 16:55:23 +00:00
|
|
|
# - Quake II Game (baseq2) #
|
2009-02-28 14:41:18 +00:00
|
|
|
# #
|
2012-04-25 09:32:11 +00:00
|
|
|
# Base dependencies: #
|
2013-10-12 10:32:32 +00:00
|
|
|
# - SDL 1.2 or SDL 2.0 #
|
2009-02-28 14:41:18 +00:00
|
|
|
# - libGL #
|
|
|
|
# #
|
2014-01-27 16:32:12 +00:00
|
|
|
# Further dependencies: #
|
|
|
|
# - libogg #
|
|
|
|
# - libvorbis #
|
|
|
|
# - OpenAL #
|
|
|
|
# - zlib #
|
|
|
|
# #
|
2009-02-28 14:41:18 +00:00
|
|
|
# Platforms: #
|
|
|
|
# - FreeBSD #
|
2012-08-22 15:58:00 +00:00
|
|
|
# - Linux #
|
|
|
|
# - OpenBSD #
|
2015-03-21 07:39:55 +00:00
|
|
|
# - OS X #
|
2012-06-05 08:37:34 +00:00
|
|
|
# - Windows (MinGW) #
|
2012-04-29 13:57:33 +00:00
|
|
|
# ------------------------------------------------------ #
|
2009-02-28 14:41:18 +00:00
|
|
|
|
2012-04-25 09:32:11 +00:00
|
|
|
# User configurable options
|
|
|
|
# -------------------------
|
|
|
|
|
|
|
|
# Enables CD audio playback. CD audio playback is used
|
|
|
|
# for the background music and doesn't add any further
|
|
|
|
# dependencies. It should work on all platforms where
|
|
|
|
# CD playback is supported by SDL.
|
2013-08-26 21:55:34 +00:00
|
|
|
WITH_CDA:=yes
|
2012-04-25 09:32:11 +00:00
|
|
|
|
|
|
|
# Enables OGG/Vorbis support. OGG/Vorbis files can be
|
|
|
|
# used as a substitute of CD audio playback. Adds
|
|
|
|
# dependencies to libogg, libvorbis and libvorbisfile.
|
2012-04-28 19:38:07 +00:00
|
|
|
WITH_OGG:=yes
|
2012-04-25 09:32:11 +00:00
|
|
|
|
2012-04-29 13:54:15 +00:00
|
|
|
# Enables the optional OpenAL sound system.
|
2012-06-05 07:56:37 +00:00
|
|
|
# To use it your system needs libopenal.so.1
|
2012-09-14 09:21:02 +00:00
|
|
|
# or openal32.dll (we recommend openal-soft)
|
2012-06-05 07:56:37 +00:00
|
|
|
# installed
|
|
|
|
WITH_OPENAL:=yes
|
2012-04-25 10:09:30 +00:00
|
|
|
|
2013-10-12 09:52:49 +00:00
|
|
|
# Use SDL2 instead of SDL1.2. Disables CD audio support,
|
|
|
|
# because SDL2 has none. Use OGG/Vorbis music instead :-)
|
|
|
|
# On Windows sdl-config isn't used, so make sure that
|
|
|
|
# you've got the SDL2 headers and libs installed.
|
2013-10-12 09:55:04 +00:00
|
|
|
WITH_SDL2:=yes
|
2013-08-27 19:04:55 +00:00
|
|
|
|
2012-04-25 09:32:11 +00:00
|
|
|
# Set the gamma via X11 and not via SDL. This works
|
|
|
|
# around problems in some SDL version. Adds dependencies
|
2012-06-05 08:37:34 +00:00
|
|
|
# to pkg-config, libX11 and libXxf86vm. Unsupported on
|
2012-09-14 09:21:02 +00:00
|
|
|
# Windows and OS X.
|
2012-04-28 19:38:07 +00:00
|
|
|
WITH_X11GAMMA:=no
|
2012-04-25 09:32:11 +00:00
|
|
|
|
2012-06-05 08:37:34 +00:00
|
|
|
# Enables opening of ZIP files (also known as .pk3 paks).
|
2012-04-25 09:32:11 +00:00
|
|
|
# Adds a dependency to libz
|
2012-04-28 19:38:07 +00:00
|
|
|
WITH_ZIP:=yes
|
2012-04-25 09:32:11 +00:00
|
|
|
|
2012-04-29 13:54:15 +00:00
|
|
|
# Enable systemwide installation of game assets
|
|
|
|
WITH_SYSTEMWIDE:=no
|
2012-06-04 07:51:17 +00:00
|
|
|
|
2012-09-14 09:21:02 +00:00
|
|
|
# This will set the default SYSTEMDIR, a non-empty string
|
2012-06-05 09:12:23 +00:00
|
|
|
# would actually be used. On Windows normals slashes (/)
|
2014-01-01 09:32:27 +00:00
|
|
|
# instead of backslashed (\) should be used! The string
|
|
|
|
# MUST NOT be surrounded by quotation marks!
|
|
|
|
WITH_SYSTEMDIR:=""
|
2012-04-29 13:54:15 +00:00
|
|
|
|
2015-03-21 07:39:55 +00:00
|
|
|
# This will set the architectures of the OSX-binaries.
|
|
|
|
# You have to make sure your libs/frameworks supports
|
|
|
|
# these architectures! To build an universal ppc-compatible
|
|
|
|
# one would add -arch ppc for example.
|
2015-03-29 03:19:16 +00:00
|
|
|
OSX_ARCH:=-arch $(shell uname -m | sed -e s/i.86/i386/)
|
2015-03-21 07:39:55 +00:00
|
|
|
|
|
|
|
# This will set the build options to create an MacOS .app-bundle.
|
|
|
|
# The app-bundle itself will not be created, but the runtime paths
|
|
|
|
# will be set to expect the game-data in *.app/
|
|
|
|
# Contents/Resources
|
|
|
|
OSX_APP:=yes
|
|
|
|
|
2014-02-16 19:03:10 +00:00
|
|
|
# This is an optional configuration file, it'll be used in
|
|
|
|
# case of presence.
|
|
|
|
CONFIG_FILE := config.mk
|
|
|
|
|
2014-02-26 19:40:17 +00:00
|
|
|
# ----------
|
|
|
|
|
2014-02-16 19:03:10 +00:00
|
|
|
# In case a of a configuration file being present, we'll just use it
|
|
|
|
ifeq ($(wildcard $(CONFIG_FILE)), $(CONFIG_FILE))
|
|
|
|
include $(CONFIG_FILE)
|
|
|
|
endif
|
2012-04-25 09:32:11 +00:00
|
|
|
|
2012-06-03 09:18:26 +00:00
|
|
|
# Detect the OS
|
|
|
|
ifdef SystemRoot
|
2012-06-03 11:06:48 +00:00
|
|
|
OSTYPE := Windows
|
2012-06-03 09:18:26 +00:00
|
|
|
else
|
2009-02-28 14:41:18 +00:00
|
|
|
OSTYPE := $(shell uname -s)
|
2012-06-03 09:18:26 +00:00
|
|
|
endif
|
2009-02-28 14:41:18 +00:00
|
|
|
|
2014-01-27 16:32:12 +00:00
|
|
|
# Special case for MinGW
|
|
|
|
ifneq (,$(findstring MINGW,$(OSTYPE)))
|
|
|
|
OSTYPE := Windows
|
|
|
|
endif
|
|
|
|
|
2012-06-03 09:18:26 +00:00
|
|
|
# Detect the architecture
|
2012-06-03 11:06:48 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
2012-06-03 09:18:26 +00:00
|
|
|
# At this time only i386 is supported on Windows
|
2012-08-22 15:58:00 +00:00
|
|
|
# (amd64 works, but building an 64 bit executable
|
2012-09-14 09:21:02 +00:00
|
|
|
# is not that easy. Especially SDL and OpenAL are
|
|
|
|
# somewhat problematic)
|
2013-12-31 08:57:07 +00:00
|
|
|
ARCH ?= i386
|
2012-06-03 09:18:26 +00:00
|
|
|
else
|
2012-02-09 17:01:29 +00:00
|
|
|
# Some platforms call it "amd64" and some "x86_64"
|
2009-02-28 14:41:18 +00:00
|
|
|
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/amd64/x86_64/)
|
2012-06-03 09:18:26 +00:00
|
|
|
endif
|
2009-02-28 14:41:18 +00:00
|
|
|
|
2012-02-09 17:01:29 +00:00
|
|
|
# Refuse all other platforms as a firewall against PEBKAC
|
2011-10-09 16:55:23 +00:00
|
|
|
# (You'll need some #ifdef for your unsupported plattform!)
|
2012-12-01 04:22:38 +00:00
|
|
|
ifeq ($(findstring $(ARCH), i386 x86_64 sparc64 ia64),)
|
2009-02-28 14:41:18 +00:00
|
|
|
$(error arch $(ARCH) is currently not supported)
|
|
|
|
endif
|
|
|
|
|
2013-08-26 21:55:34 +00:00
|
|
|
# Disable CDA for SDL2
|
|
|
|
ifeq ($(WITH_SDL2),yes)
|
|
|
|
ifeq ($(WITH_CDA),yes)
|
|
|
|
WITH_CDA:=no
|
2013-08-27 19:04:55 +00:00
|
|
|
|
|
|
|
# Evil hack to tell the "all" target
|
|
|
|
# that CDA was disabled because SDL2
|
|
|
|
# is enabled.
|
2013-12-31 09:02:58 +00:00
|
|
|
CDA_DISABLED:=yes
|
2013-08-26 21:55:34 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-02-28 14:41:18 +00:00
|
|
|
# ----------
|
|
|
|
|
2012-04-29 13:57:33 +00:00
|
|
|
# Base CFLAGS.
|
2011-10-09 16:55:23 +00:00
|
|
|
#
|
|
|
|
# -O2 are enough optimizations.
|
2012-04-29 13:57:33 +00:00
|
|
|
#
|
2011-10-09 16:55:23 +00:00
|
|
|
# -fno-strict-aliasing since the source doesn't comply
|
|
|
|
# with strict aliasing rules and it's next to impossible
|
|
|
|
# to get it there...
|
|
|
|
#
|
|
|
|
# -fomit-frame-pointer since the framepointer is mostly
|
|
|
|
# useless for debugging Quake II and slows things down.
|
|
|
|
#
|
2012-02-09 17:01:29 +00:00
|
|
|
# -g to build always with debug symbols. Please DO NOT
|
|
|
|
# CHANGE THIS, since it's our only chance to debug this
|
2011-10-09 16:55:23 +00:00
|
|
|
# crap when random crashes happen!
|
|
|
|
#
|
2012-09-14 09:21:02 +00:00
|
|
|
# -MMD to generate header dependencies. (They cannot be
|
|
|
|
# generated if building universal binaries on OSX)
|
2015-03-21 07:39:55 +00:00
|
|
|
ifeq ($(OSTYPE), Darwin)
|
|
|
|
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
|
|
|
|
-Wall -pipe -g
|
|
|
|
#-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.5.sdk
|
|
|
|
CFLAGS += $(OSX_ARCH)
|
|
|
|
else
|
2011-10-09 16:55:23 +00:00
|
|
|
CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
|
2015-03-19 15:56:30 +00:00
|
|
|
-Wall -pipe -g -ggdb -MMD
|
2015-03-21 07:39:55 +00:00
|
|
|
endif
|
2011-10-09 16:55:23 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2012-04-29 13:54:15 +00:00
|
|
|
# Systemwide installation
|
|
|
|
ifeq ($(WITH_SYSTEMWIDE),yes)
|
|
|
|
CFLAGS += -DSYSTEMWIDE
|
|
|
|
ifneq ($(WITH_SYSTEMDIR),"")
|
|
|
|
CFLAGS += -DSYSTEMDIR=\"$(WITH_SYSTEMDIR)\"
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2014-01-27 16:32:12 +00:00
|
|
|
# On Windows / MinGW $(CC) is
|
|
|
|
# undefined by default.
|
|
|
|
ifeq ($(OSTYPE),Windows)
|
|
|
|
CC := gcc
|
|
|
|
endif
|
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2011-10-09 16:55:23 +00:00
|
|
|
# Extra CFLAGS for SDL
|
2013-08-25 22:55:31 +00:00
|
|
|
ifeq ($(WITH_SDL2),yes)
|
2014-01-27 16:32:12 +00:00
|
|
|
ifeq ($(OSTYPE),Windows)
|
|
|
|
SDLCFLAGS := $(shell /custom/bin/sdl2-config --cflags)
|
|
|
|
else
|
2013-08-25 22:55:31 +00:00
|
|
|
SDLCFLAGS := $(shell sdl2-config --cflags)
|
2014-01-27 16:32:12 +00:00
|
|
|
endif
|
2013-08-25 22:55:31 +00:00
|
|
|
else # not SDL2
|
2014-01-27 16:32:12 +00:00
|
|
|
ifeq ($(OSTYPE),Windows)
|
|
|
|
SDLCFLAGS :=
|
|
|
|
else
|
2012-11-05 19:16:35 +00:00
|
|
|
SDLCFLAGS := $(shell sdl-config --cflags)
|
2014-01-27 16:32:12 +00:00
|
|
|
endif
|
2013-08-25 22:55:31 +00:00
|
|
|
endif # SDL2
|
2011-10-09 16:55:23 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2012-04-29 13:57:33 +00:00
|
|
|
# Extra CFLAGS for X11
|
2012-06-03 11:06:48 +00:00
|
|
|
ifneq ($(OSTYPE), Windows)
|
2015-03-21 07:39:55 +00:00
|
|
|
ifneq ($(OSTYPE), Darwin)
|
2012-04-25 09:32:11 +00:00
|
|
|
ifeq ($(WITH_X11GAMMA),yes)
|
2012-04-29 13:57:33 +00:00
|
|
|
X11CFLAGS := $(shell pkg-config x11 --cflags)
|
2012-04-25 09:32:11 +00:00
|
|
|
X11CFLAGS += $(shell pkg-config xxf86vm --cflags)
|
|
|
|
endif
|
2012-06-03 09:18:26 +00:00
|
|
|
endif
|
2015-03-21 07:39:55 +00:00
|
|
|
endif
|
2012-06-03 09:18:26 +00:00
|
|
|
|
2012-04-25 09:32:11 +00:00
|
|
|
# ----------
|
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# Base include path.
|
2009-02-28 14:41:18 +00:00
|
|
|
ifeq ($(OSTYPE),Linux)
|
2010-11-26 12:28:00 +00:00
|
|
|
INCLUDE := -I/usr/include
|
|
|
|
else ifeq ($(OSTYPE),FreeBSD)
|
|
|
|
INCLUDE := -I/usr/local/include
|
2012-08-12 03:59:40 +00:00
|
|
|
else ifeq ($(OSTYPE),OpenBSD)
|
|
|
|
INCLUDE := -I/usr/local/include
|
2014-01-27 16:32:12 +00:00
|
|
|
else ifeq ($(OSTYPE),Windows)
|
|
|
|
INCLUDE := -I/custom/include
|
2012-04-29 13:57:33 +00:00
|
|
|
endif
|
2009-04-10 13:11:49 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2011-10-09 16:55:23 +00:00
|
|
|
# Base LDFLAGS.
|
2010-11-26 12:28:00 +00:00
|
|
|
ifeq ($(OSTYPE),Linux)
|
2013-04-19 16:53:12 +00:00
|
|
|
LDFLAGS := -L/usr/lib -lm -ldl -rdynamic
|
2010-11-26 12:28:00 +00:00
|
|
|
else ifeq ($(OSTYPE),FreeBSD)
|
|
|
|
LDFLAGS := -L/usr/local/lib -lm
|
2012-08-12 03:59:40 +00:00
|
|
|
else ifeq ($(OSTYPE),OpenBSD)
|
|
|
|
LDFLAGS := -L/usr/local/lib -lm
|
2012-06-03 13:20:59 +00:00
|
|
|
else ifeq ($(OSTYPE),Windows)
|
2014-01-27 16:32:12 +00:00
|
|
|
LDFLAGS := -L/custom/lib -static -lws2_32 -lwinmm
|
2015-03-21 07:39:55 +00:00
|
|
|
else ifeq ($(OSTYPE), Darwin)
|
|
|
|
LDFLAGS := $(OSX_ARCH) -lm
|
2012-04-29 13:57:33 +00:00
|
|
|
endif
|
2009-03-04 15:12:31 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2011-10-09 16:55:23 +00:00
|
|
|
# Extra LDFLAGS for SDL
|
2012-06-03 11:06:48 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
2013-09-01 12:19:33 +00:00
|
|
|
ifeq ($(WITH_SDL2),yes)
|
2014-01-27 16:32:12 +00:00
|
|
|
SDLLDFLAGS := $(shell /custom/bin/sdl2-config --static-libs)
|
2013-09-01 12:19:33 +00:00
|
|
|
else # not SDL2
|
2012-06-04 08:02:01 +00:00
|
|
|
SDLLDFLAGS := -lSDL
|
2013-09-01 12:19:33 +00:00
|
|
|
endif # SDL2
|
2015-03-21 07:39:55 +00:00
|
|
|
else ifeq ($(OSTYPE), Darwin)
|
|
|
|
ifeq ($(WITH_SDL2),yes)
|
|
|
|
SDLLDFLAGS := -lSDL2 -framework OpenGL -framework Cocoa
|
|
|
|
else # not SDL2
|
|
|
|
SDLLDFLAGS := -lSDL -framework OpenGL -framework Cocoa
|
|
|
|
endif # SDL2
|
|
|
|
else # not Darwin/Win
|
2013-08-25 22:55:31 +00:00
|
|
|
ifeq ($(WITH_SDL2),yes)
|
|
|
|
SDLLDFLAGS := $(shell sdl2-config --libs)
|
2013-09-01 12:19:33 +00:00
|
|
|
else # not SDL2
|
2011-10-09 16:55:23 +00:00
|
|
|
SDLLDFLAGS := $(shell sdl-config --libs)
|
2013-09-01 12:19:33 +00:00
|
|
|
endif # SDL2
|
2015-03-21 07:39:55 +00:00
|
|
|
endif # Darwin/Win
|
2011-10-09 16:55:23 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2012-04-29 13:57:33 +00:00
|
|
|
# Extra LDFLAGS for X11
|
2012-06-03 11:06:48 +00:00
|
|
|
ifneq ($(OSTYPE), Windows)
|
2015-03-21 07:39:55 +00:00
|
|
|
ifneq ($(OSTYPE), Darwin)
|
2012-04-25 09:32:11 +00:00
|
|
|
ifeq ($(WITH_X11GAMMA),yes)
|
2012-04-29 13:57:33 +00:00
|
|
|
X11LDFLAGS := $(shell pkg-config x11 --libs)
|
2012-04-25 09:32:11 +00:00
|
|
|
X11LDFLAGS += $(shell pkg-config xxf86vm --libs)
|
2013-08-27 19:54:48 +00:00
|
|
|
X11LDFLAGS += $(shell pkg-config xrandr --libs)
|
2012-04-25 09:32:11 +00:00
|
|
|
endif
|
2012-06-03 09:18:26 +00:00
|
|
|
endif
|
2015-03-21 07:39:55 +00:00
|
|
|
endif
|
2012-04-25 09:32:11 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2011-12-08 11:15:38 +00:00
|
|
|
# When make is invoked by "make VERBOSE=1" print
|
|
|
|
# the compiler and linker commands.
|
|
|
|
|
|
|
|
ifdef VERBOSE
|
|
|
|
Q :=
|
|
|
|
else
|
|
|
|
Q := @
|
2012-04-29 13:57:33 +00:00
|
|
|
endif
|
2011-12-08 11:15:38 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2012-06-11 09:13:10 +00:00
|
|
|
# Phony targets
|
2013-04-27 19:11:45 +00:00
|
|
|
.PHONY : all client game icon server
|
2012-06-11 09:13:10 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# Builds everything
|
2013-04-27 19:11:45 +00:00
|
|
|
all: config client server game
|
|
|
|
|
|
|
|
# Print config values
|
|
|
|
config:
|
|
|
|
@echo "Build configuration"
|
|
|
|
@echo "============================"
|
|
|
|
@echo "WITH_CDA = $(WITH_CDA)"
|
|
|
|
@echo "WITH_OPENAL = $(WITH_OPENAL)"
|
2013-08-27 19:04:55 +00:00
|
|
|
@echo "WITH_SDL2 = $(WITH_SDL2)"
|
2013-04-27 19:11:45 +00:00
|
|
|
@echo "WITH_X11GAMMA = $(WITH_X11GAMMA)"
|
|
|
|
@echo "WITH_ZIP = $(WITH_ZIP)"
|
|
|
|
@echo "WITH_SYSTEMWIDE = $(WITH_SYSTEMWIDE)"
|
|
|
|
@echo "WITH_SYSTEMDIR = $(WITH_SYSTEMDIR)"
|
|
|
|
@echo "============================"
|
2013-08-25 22:55:31 +00:00
|
|
|
@echo ""
|
2013-08-27 19:04:55 +00:00
|
|
|
ifeq ($(WITH_SDL2),yes)
|
2013-12-31 09:02:58 +00:00
|
|
|
ifeq ($(CDA_DISABLED),yes)
|
2013-08-27 19:04:55 +00:00
|
|
|
@echo "WARNING: CDA disabled because SDL2 doesn't support it!"
|
|
|
|
@echo ""
|
|
|
|
endif
|
|
|
|
endif
|
2013-04-27 19:11:45 +00:00
|
|
|
|
2011-10-09 16:55:23 +00:00
|
|
|
# ----------
|
2009-03-04 15:12:31 +00:00
|
|
|
|
2012-06-11 09:13:10 +00:00
|
|
|
# Special target to compile
|
|
|
|
# the icon on Windows
|
|
|
|
ifeq ($(OSTYPE), Windows)
|
|
|
|
icon:
|
|
|
|
@echo "===> WR build/icon/icon.res"
|
2014-02-08 09:08:20 +00:00
|
|
|
${Q}mkdir -p build/icon
|
2012-06-11 09:13:10 +00:00
|
|
|
${Q}windres stuff\icon\icon.rc -O COFF -o build\icon\icon.res
|
|
|
|
endif
|
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# Cleanup
|
|
|
|
clean:
|
|
|
|
@echo "===> CLEAN"
|
2011-12-08 11:15:38 +00:00
|
|
|
${Q}rm -Rf build release
|
2012-04-29 13:57:33 +00:00
|
|
|
|
2009-03-05 11:28:58 +00:00
|
|
|
# ----------
|
|
|
|
|
2012-04-29 13:57:33 +00:00
|
|
|
# The client
|
2012-06-04 07:51:17 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
|
|
|
client:
|
|
|
|
@echo "===> Building quake2.exe"
|
2014-01-27 16:32:12 +00:00
|
|
|
${Q}mkdir -p release
|
2012-06-04 07:51:17 +00:00
|
|
|
$(MAKE) release/quake2.exe
|
|
|
|
|
|
|
|
build/client/%.o: %.c
|
|
|
|
@echo "===> CC $<"
|
2014-02-08 09:08:20 +00:00
|
|
|
${Q}mkdir -p $(@D)
|
2012-06-04 07:51:17 +00:00
|
|
|
${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(INCLUDE) -o $@ $<
|
|
|
|
|
|
|
|
ifeq ($(WITH_CDA),yes)
|
|
|
|
release/quake2.exe : CFLAGS += -DCDA
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WITH_OGG),yes)
|
|
|
|
release/quake2.exe : CFLAGS += -DOGG
|
2012-06-04 08:02:01 +00:00
|
|
|
release/quake2.exe : LDFLAGS += -lvorbisfile -lvorbis -logg
|
2012-06-04 07:51:17 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WITH_OPENAL),yes)
|
2012-06-05 07:56:37 +00:00
|
|
|
release/quake2.exe : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"openal32.dll"'
|
2012-06-04 07:51:17 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WITH_ZIP),yes)
|
2012-07-21 10:02:39 +00:00
|
|
|
release/quake2.exe : CFLAGS += -DZIP -DNOUNCRYPT
|
2012-06-04 07:51:17 +00:00
|
|
|
release/quake2.exe : LDFLAGS += -lz
|
|
|
|
endif
|
2012-06-05 09:02:48 +00:00
|
|
|
|
2013-09-01 12:19:33 +00:00
|
|
|
ifeq ($(WITH_SDL2),yes)
|
|
|
|
release/quake2.exe : CFLAGS += -DSDL2
|
|
|
|
endif
|
|
|
|
|
2013-06-15 07:23:02 +00:00
|
|
|
release/quake2.exe : LDFLAGS += -mwindows -lopengl32
|
2015-03-20 15:59:29 +00:00
|
|
|
else # not Windows
|
2010-11-26 12:28:00 +00:00
|
|
|
client:
|
2012-06-04 07:51:17 +00:00
|
|
|
@echo "===> Building quake2"
|
2011-12-08 11:15:38 +00:00
|
|
|
${Q}mkdir -p release
|
2012-04-29 13:57:33 +00:00
|
|
|
$(MAKE) release/quake2
|
2010-11-26 12:28:00 +00:00
|
|
|
|
|
|
|
build/client/%.o: %.c
|
2012-06-04 07:51:17 +00:00
|
|
|
@echo "===> CC $<"
|
2011-12-08 11:15:38 +00:00
|
|
|
${Q}mkdir -p $(@D)
|
2013-06-15 07:23:02 +00:00
|
|
|
${Q}$(CC) -c $(CFLAGS) $(SDLCFLAGS) $(X11CFLAGS) $(INCLUDE) -o $@ $<
|
2011-10-09 16:55:23 +00:00
|
|
|
|
2015-03-21 07:39:55 +00:00
|
|
|
ifeq ($(OSTYPE), Darwin)
|
|
|
|
build/client/%.o : %.m
|
|
|
|
@echo "===> CC $<"
|
|
|
|
${Q}mkdir -p $(@D)
|
|
|
|
${Q}$(CC) $(OSX_ARCH) -x objective-c -c $< -o $@
|
|
|
|
endif
|
|
|
|
|
2012-04-25 09:32:11 +00:00
|
|
|
ifeq ($(WITH_CDA),yes)
|
|
|
|
release/quake2 : CFLAGS += -DCDA
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WITH_OGG),yes)
|
|
|
|
release/quake2 : CFLAGS += -DOGG
|
|
|
|
release/quake2 : LDFLAGS += -lvorbis -lvorbisfile -logg
|
|
|
|
endif
|
|
|
|
|
2012-04-25 10:09:30 +00:00
|
|
|
ifeq ($(WITH_OPENAL),yes)
|
2012-08-12 03:59:40 +00:00
|
|
|
ifeq ($(OSTYPE), OpenBSD)
|
|
|
|
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so"'
|
2015-03-21 07:39:55 +00:00
|
|
|
else ifeq ($(OSTYPE), Darwin)
|
|
|
|
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.dylib"'
|
2012-08-12 03:59:40 +00:00
|
|
|
else
|
2012-04-25 10:09:30 +00:00
|
|
|
release/quake2 : CFLAGS += -DUSE_OPENAL -DDEFAULT_OPENAL_DRIVER='"libopenal.so.1"'
|
|
|
|
endif
|
2012-08-12 03:59:40 +00:00
|
|
|
endif
|
2012-04-25 10:09:30 +00:00
|
|
|
|
2012-04-25 09:32:11 +00:00
|
|
|
ifeq ($(WITH_ZIP),yes)
|
2012-07-21 10:02:39 +00:00
|
|
|
release/quake2 : CFLAGS += -DZIP -DNOUNCRYPT
|
2012-04-25 09:32:11 +00:00
|
|
|
release/quake2 : LDFLAGS += -lz
|
|
|
|
endif
|
2013-06-15 07:23:02 +00:00
|
|
|
|
|
|
|
ifeq ($(WITH_X11GAMMA),yes)
|
|
|
|
release/quake2 : CFLAGS += -DX11GAMMA
|
2012-06-04 07:51:17 +00:00
|
|
|
endif
|
2012-09-14 09:21:02 +00:00
|
|
|
|
2013-09-01 12:19:33 +00:00
|
|
|
ifeq ($(WITH_SDL2),yes)
|
|
|
|
release/quake2 : CFLAGS += -DSDL2
|
|
|
|
endif
|
2013-06-15 07:23:02 +00:00
|
|
|
|
2015-03-21 07:39:55 +00:00
|
|
|
ifneq ($(OSTYPE), Darwin)
|
2013-06-15 07:23:02 +00:00
|
|
|
release/quake2 : LDFLAGS += -lGL
|
2015-03-21 07:39:55 +00:00
|
|
|
endif
|
2013-11-09 12:47:04 +00:00
|
|
|
|
|
|
|
ifeq ($(OSTYPE), FreeBSD)
|
|
|
|
release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$$ORIGIN/lib'
|
|
|
|
else ifeq ($(OSTYPE), Linux)
|
|
|
|
release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$$ORIGIN/lib'
|
|
|
|
endif
|
2014-01-01 09:32:27 +00:00
|
|
|
|
|
|
|
ifeq ($(WITH_SYSTEMWIDE),yes)
|
|
|
|
ifneq ($(WITH_SYSTEMDIR),"")
|
|
|
|
ifeq ($(OSTYPE), FreeBSD)
|
|
|
|
release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$(WITH_SYSTEMDIR)/lib'
|
|
|
|
else ifeq ($(OSTYPE), Linux)
|
|
|
|
release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='$(WITH_SYSTEMDIR)/lib'
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifeq ($(OSTYPE), FreeBSD)
|
|
|
|
release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='/usr/share/games/quake2/lib'
|
|
|
|
else ifeq ($(OSTYPE), Linux)
|
|
|
|
release/quake2 : LDFLAGS += -Wl,-z,origin,-rpath='/usr/share/games/quake2/lib'
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
2013-06-15 07:23:02 +00:00
|
|
|
endif
|
2012-09-14 09:21:02 +00:00
|
|
|
|
2009-03-05 09:47:10 +00:00
|
|
|
# ----------
|
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# The server
|
2012-06-03 11:06:48 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
2010-11-26 12:28:00 +00:00
|
|
|
server:
|
2012-06-03 11:06:48 +00:00
|
|
|
@echo "===> Building q2ded"
|
2014-01-27 16:32:12 +00:00
|
|
|
${Q}mkdir -p release
|
2012-06-04 07:32:35 +00:00
|
|
|
$(MAKE) release/q2ded.exe
|
2012-06-03 11:06:48 +00:00
|
|
|
|
|
|
|
build/server/%.o: %.c
|
|
|
|
@echo "===> CC $<"
|
2014-01-27 16:32:12 +00:00
|
|
|
${Q}mkdir -p $(@D)
|
2012-06-03 11:06:48 +00:00
|
|
|
${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
|
2012-06-04 07:32:35 +00:00
|
|
|
|
|
|
|
release/q2ded.exe : CFLAGS += -DDEDICATED_ONLY
|
|
|
|
release/q2ded.exe : LDFLAGS += -lz
|
|
|
|
|
|
|
|
ifeq ($(WITH_ZIP),yes)
|
2012-09-14 09:21:02 +00:00
|
|
|
release/q2ded.exe : CFLAGS += -DZIP -DNOUNCRYPT
|
2012-06-04 07:32:35 +00:00
|
|
|
release/q2ded.exe : LDFLAGS += -lz
|
|
|
|
endif
|
2015-03-20 15:59:29 +00:00
|
|
|
else # not Windows
|
2012-06-03 11:06:48 +00:00
|
|
|
server:
|
|
|
|
@echo "===> Building q2ded"
|
2011-12-08 11:15:38 +00:00
|
|
|
${Q}mkdir -p release
|
2010-11-26 12:28:00 +00:00
|
|
|
$(MAKE) release/q2ded
|
2009-03-05 16:34:42 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
build/server/%.o: %.c
|
2012-06-03 11:06:48 +00:00
|
|
|
@echo "===> CC $<"
|
2011-12-08 11:15:38 +00:00
|
|
|
${Q}mkdir -p $(@D)
|
2012-09-14 09:21:02 +00:00
|
|
|
${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
|
2009-03-05 16:34:42 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
release/q2ded : CFLAGS += -DDEDICATED_ONLY
|
2009-03-09 16:10:05 +00:00
|
|
|
|
2012-04-25 09:32:11 +00:00
|
|
|
ifeq ($(WITH_ZIP),yes)
|
2012-07-21 10:02:39 +00:00
|
|
|
release/q2ded : CFLAGS += -DZIP -DNOUNCRYPT
|
2012-04-25 09:32:11 +00:00
|
|
|
release/q2ded : LDFLAGS += -lz
|
|
|
|
endif
|
2012-06-04 07:32:35 +00:00
|
|
|
endif
|
2012-04-25 09:32:11 +00:00
|
|
|
|
2009-03-09 16:10:05 +00:00
|
|
|
# ----------
|
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# The baseq2 game
|
2012-06-04 07:32:35 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
|
|
|
game:
|
|
|
|
@echo "===> Building baseq2/game.dll"
|
2014-01-27 16:32:12 +00:00
|
|
|
${Q}mkdir -p release/baseq2
|
2012-06-04 07:32:35 +00:00
|
|
|
$(MAKE) release/baseq2/game.dll
|
|
|
|
|
|
|
|
build/baseq2/%.o: %.c
|
|
|
|
@echo "===> CC $<"
|
2014-01-27 16:32:12 +00:00
|
|
|
${Q}mkdir -p $(@D)
|
2012-06-04 07:32:35 +00:00
|
|
|
${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
|
|
|
|
|
|
|
|
release/baseq2/game.dll : LDFLAGS += -shared
|
2015-03-20 15:59:29 +00:00
|
|
|
else # not Windows
|
2011-10-09 16:55:23 +00:00
|
|
|
game:
|
2012-06-04 07:32:35 +00:00
|
|
|
@echo "===> Building baseq2/game.so"
|
2011-12-08 11:15:38 +00:00
|
|
|
${Q}mkdir -p release/baseq2
|
2010-11-26 12:28:00 +00:00
|
|
|
$(MAKE) release/baseq2/game.so
|
2009-02-28 14:41:18 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
build/baseq2/%.o: %.c
|
2012-06-04 07:32:35 +00:00
|
|
|
@echo "===> CC $<"
|
2011-12-08 11:15:38 +00:00
|
|
|
${Q}mkdir -p $(@D)
|
|
|
|
${Q}$(CC) -c $(CFLAGS) $(INCLUDE) -o $@ $<
|
2009-02-28 14:41:18 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
release/baseq2/game.so : CFLAGS += -fPIC
|
|
|
|
release/baseq2/game.so : LDFLAGS += -shared
|
2012-06-04 07:32:35 +00:00
|
|
|
endif
|
2012-09-14 09:21:02 +00:00
|
|
|
|
2009-03-03 14:10:08 +00:00
|
|
|
# ----------
|
|
|
|
|
2011-10-09 16:55:23 +00:00
|
|
|
# Used by the game
|
|
|
|
GAME_OBJS_ = \
|
|
|
|
src/common/shared/flash.o \
|
2012-06-02 09:32:45 +00:00
|
|
|
src/common/shared/rand.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/shared/shared.o \
|
2012-11-05 19:16:35 +00:00
|
|
|
src/game/g_ai.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/game/g_chase.o \
|
|
|
|
src/game/g_cmds.o \
|
|
|
|
src/game/g_combat.o \
|
|
|
|
src/game/g_func.o \
|
|
|
|
src/game/g_items.o \
|
|
|
|
src/game/g_main.o \
|
|
|
|
src/game/g_misc.o \
|
|
|
|
src/game/g_monster.o \
|
|
|
|
src/game/g_phys.o \
|
|
|
|
src/game/g_spawn.o \
|
|
|
|
src/game/g_svcmds.o \
|
|
|
|
src/game/g_target.o \
|
|
|
|
src/game/g_trigger.o \
|
|
|
|
src/game/g_turret.o \
|
|
|
|
src/game/g_utils.o \
|
|
|
|
src/game/g_weapon.o \
|
|
|
|
src/game/monster/berserker/berserker.o \
|
|
|
|
src/game/monster/boss2/boss2.o \
|
|
|
|
src/game/monster/boss3/boss3.o \
|
|
|
|
src/game/monster/boss3/boss31.o \
|
|
|
|
src/game/monster/boss3/boss32.o \
|
|
|
|
src/game/monster/brain/brain.o \
|
|
|
|
src/game/monster/chick/chick.o \
|
|
|
|
src/game/monster/flipper/flipper.o \
|
|
|
|
src/game/monster/float/float.o \
|
|
|
|
src/game/monster/flyer/flyer.o \
|
|
|
|
src/game/monster/gladiator/gladiator.o \
|
|
|
|
src/game/monster/gunner/gunner.o \
|
|
|
|
src/game/monster/hover/hover.o \
|
|
|
|
src/game/monster/infantry/infantry.o \
|
|
|
|
src/game/monster/insane/insane.o \
|
|
|
|
src/game/monster/medic/medic.o \
|
|
|
|
src/game/monster/misc/move.o \
|
|
|
|
src/game/monster/mutant/mutant.o \
|
|
|
|
src/game/monster/parasite/parasite.o \
|
|
|
|
src/game/monster/soldier/soldier.o \
|
|
|
|
src/game/monster/supertank/supertank.o \
|
|
|
|
src/game/monster/tank/tank.o \
|
|
|
|
src/game/player/client.o \
|
|
|
|
src/game/player/hud.o \
|
|
|
|
src/game/player/trail.o \
|
|
|
|
src/game/player/view.o \
|
|
|
|
src/game/player/weapon.o \
|
2012-11-05 19:16:35 +00:00
|
|
|
src/game/savegame/savegame.o
|
2012-04-29 13:57:33 +00:00
|
|
|
|
2009-04-10 13:11:49 +00:00
|
|
|
# ----------
|
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# Used by the client
|
|
|
|
CLIENT_OBJS_ := \
|
2015-04-11 18:11:19 +00:00
|
|
|
src/backends/generic/misc.o \
|
2012-08-01 12:54:18 +00:00
|
|
|
src/backends/generic/qal.o \
|
2012-11-05 19:16:35 +00:00
|
|
|
src/backends/generic/vid.o \
|
2013-06-15 07:23:02 +00:00
|
|
|
src/backends/generic/qgl.o \
|
2012-08-01 11:47:32 +00:00
|
|
|
src/backends/sdl/cd.o \
|
2013-06-15 07:23:02 +00:00
|
|
|
src/backends/sdl/input.o \
|
|
|
|
src/backends/sdl/refresh.o \
|
2012-08-01 11:47:32 +00:00
|
|
|
src/backends/sdl/sound.o \
|
2010-11-26 12:28:00 +00:00
|
|
|
src/client/cl_cin.o \
|
|
|
|
src/client/cl_console.o \
|
|
|
|
src/client/cl_download.o \
|
|
|
|
src/client/cl_effects.o \
|
|
|
|
src/client/cl_entities.o \
|
|
|
|
src/client/cl_input.o \
|
|
|
|
src/client/cl_inventory.o \
|
|
|
|
src/client/cl_keyboard.o \
|
|
|
|
src/client/cl_lights.o \
|
|
|
|
src/client/cl_main.o \
|
|
|
|
src/client/cl_network.o \
|
|
|
|
src/client/cl_parse.o \
|
|
|
|
src/client/cl_particles.o \
|
|
|
|
src/client/cl_prediction.o \
|
|
|
|
src/client/cl_screen.o \
|
|
|
|
src/client/cl_tempentities.o \
|
|
|
|
src/client/cl_view.o \
|
2013-06-15 07:23:02 +00:00
|
|
|
src/client/refresh/r_draw.o \
|
|
|
|
src/client/refresh/r_image.o \
|
|
|
|
src/client/refresh/r_light.o \
|
|
|
|
src/client/refresh/r_lightmap.o \
|
|
|
|
src/client/refresh/r_main.o \
|
|
|
|
src/client/refresh/r_mesh.o \
|
|
|
|
src/client/refresh/r_misc.o \
|
|
|
|
src/client/refresh/r_model.o \
|
|
|
|
src/client/refresh/r_scrap.o \
|
|
|
|
src/client/refresh/r_surf.o \
|
|
|
|
src/client/refresh/r_warp.o \
|
|
|
|
src/client/refresh/files/md2.o \
|
|
|
|
src/client/refresh/files/pcx.o \
|
|
|
|
src/client/refresh/files/sp2.o \
|
2015-03-19 15:56:30 +00:00
|
|
|
src/client/refresh/files/stb.o \
|
2013-06-15 07:23:02 +00:00
|
|
|
src/client/refresh/files/wal.o \
|
2010-11-26 12:28:00 +00:00
|
|
|
src/client/menu/menu.o \
|
|
|
|
src/client/menu/qmenu.o \
|
|
|
|
src/client/menu/videomenu.o \
|
2013-04-21 09:30:07 +00:00
|
|
|
src/client/sound/ogg.o \
|
2013-04-21 09:18:32 +00:00
|
|
|
src/client/sound/openal.o \
|
2013-04-20 13:09:57 +00:00
|
|
|
src/client/sound/sound.o \
|
2013-04-21 09:32:20 +00:00
|
|
|
src/client/sound/wave.o \
|
2012-06-07 11:54:08 +00:00
|
|
|
src/common/argproc.o \
|
|
|
|
src/common/clientserver.o \
|
2012-06-07 13:04:45 +00:00
|
|
|
src/common/collision.o \
|
2010-11-26 12:28:00 +00:00
|
|
|
src/common/crc.o \
|
2012-06-07 11:35:33 +00:00
|
|
|
src/common/cmdparser.o \
|
2010-11-26 12:28:00 +00:00
|
|
|
src/common/cvar.o \
|
|
|
|
src/common/filesystem.o \
|
2012-06-03 13:26:31 +00:00
|
|
|
src/common/glob.o \
|
2010-11-26 12:28:00 +00:00
|
|
|
src/common/md4.o \
|
2012-06-07 12:33:09 +00:00
|
|
|
src/common/movemsg.o \
|
2010-11-26 12:28:00 +00:00
|
|
|
src/common/misc.o \
|
|
|
|
src/common/netchan.o \
|
|
|
|
src/common/pmove.o \
|
|
|
|
src/common/szone.o \
|
|
|
|
src/common/zone.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/shared/flash.o \
|
2012-06-02 09:32:45 +00:00
|
|
|
src/common/shared/rand.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/shared/shared.o \
|
2010-11-26 12:28:00 +00:00
|
|
|
src/common/unzip/ioapi.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/unzip/unzip.o \
|
|
|
|
src/server/sv_cmd.o \
|
|
|
|
src/server/sv_conless.o \
|
|
|
|
src/server/sv_entities.o \
|
|
|
|
src/server/sv_game.o \
|
|
|
|
src/server/sv_init.o \
|
|
|
|
src/server/sv_main.o \
|
|
|
|
src/server/sv_save.o \
|
|
|
|
src/server/sv_send.o \
|
|
|
|
src/server/sv_user.o \
|
2012-06-04 07:51:17 +00:00
|
|
|
src/server/sv_world.o
|
|
|
|
|
|
|
|
ifeq ($(OSTYPE), Windows)
|
|
|
|
CLIENT_OBJS_ += \
|
2012-08-01 12:12:05 +00:00
|
|
|
src/backends/windows/network.o \
|
2012-11-06 19:47:13 +00:00
|
|
|
src/backends/windows/system.o \
|
|
|
|
src/backends/windows/shared/mem.o
|
2012-06-04 07:51:17 +00:00
|
|
|
else
|
|
|
|
CLIENT_OBJS_ += \
|
2012-08-01 11:58:10 +00:00
|
|
|
src/backends/unix/main.o \
|
2012-11-05 19:16:35 +00:00
|
|
|
src/backends/unix/network.o \
|
|
|
|
src/backends/unix/signalhandler.o \
|
2012-11-06 19:47:13 +00:00
|
|
|
src/backends/unix/system.o \
|
|
|
|
src/backends/unix/shared/hunk.o
|
2012-06-04 07:51:17 +00:00
|
|
|
endif
|
2011-10-09 16:55:23 +00:00
|
|
|
|
|
|
|
# ----------
|
|
|
|
|
|
|
|
# Used by the server
|
|
|
|
SERVER_OBJS_ := \
|
2012-06-07 11:54:08 +00:00
|
|
|
src/common/argproc.o \
|
|
|
|
src/common/clientserver.o \
|
2012-06-07 13:04:45 +00:00
|
|
|
src/common/collision.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/crc.o \
|
2012-06-07 11:35:33 +00:00
|
|
|
src/common/cmdparser.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/cvar.o \
|
|
|
|
src/common/filesystem.o \
|
2012-06-03 13:26:31 +00:00
|
|
|
src/common/glob.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/md4.o \
|
|
|
|
src/common/misc.o \
|
2012-06-07 12:33:09 +00:00
|
|
|
src/common/movemsg.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/netchan.o \
|
|
|
|
src/common/pmove.o \
|
|
|
|
src/common/szone.o \
|
|
|
|
src/common/zone.o \
|
2012-06-02 09:32:45 +00:00
|
|
|
src/common/shared/rand.o \
|
2011-10-09 16:55:23 +00:00
|
|
|
src/common/shared/shared.o \
|
|
|
|
src/common/unzip/ioapi.o \
|
|
|
|
src/common/unzip/unzip.o \
|
|
|
|
src/server/sv_cmd.o \
|
|
|
|
src/server/sv_conless.o \
|
|
|
|
src/server/sv_entities.o \
|
|
|
|
src/server/sv_game.o \
|
|
|
|
src/server/sv_init.o \
|
|
|
|
src/server/sv_main.o \
|
|
|
|
src/server/sv_save.o \
|
|
|
|
src/server/sv_send.o \
|
|
|
|
src/server/sv_user.o \
|
2015-04-11 18:11:19 +00:00
|
|
|
src/server/sv_world.o \
|
|
|
|
src/backends/generic/misc.o
|
2012-06-03 09:18:26 +00:00
|
|
|
|
2012-06-03 11:06:48 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
2012-06-03 10:14:05 +00:00
|
|
|
SERVER_OBJS_ += \
|
2012-08-01 12:12:05 +00:00
|
|
|
src/backends/windows/network.o \
|
2012-11-06 19:47:13 +00:00
|
|
|
src/backends/windows/system.o \
|
|
|
|
src/backends/windows/shared/mem.o
|
2015-03-20 15:59:29 +00:00
|
|
|
else # not Windows
|
2012-06-03 09:18:26 +00:00
|
|
|
SERVER_OBJS_ += \
|
2012-08-01 11:58:10 +00:00
|
|
|
src/backends/unix/main.o \
|
2012-11-05 19:16:35 +00:00
|
|
|
src/backends/unix/network.o \
|
|
|
|
src/backends/unix/signalhandler.o \
|
2012-11-06 19:47:13 +00:00
|
|
|
src/backends/unix/system.o \
|
|
|
|
src/backends/unix/shared/hunk.o
|
2012-06-03 09:18:26 +00:00
|
|
|
endif
|
2012-04-29 13:57:33 +00:00
|
|
|
|
2011-10-09 16:55:23 +00:00
|
|
|
# ----------
|
2010-11-26 12:28:00 +00:00
|
|
|
|
|
|
|
# Rewrite pathes to our object directory
|
|
|
|
CLIENT_OBJS = $(patsubst %,build/client/%,$(CLIENT_OBJS_))
|
|
|
|
SERVER_OBJS = $(patsubst %,build/server/%,$(SERVER_OBJS_))
|
2011-10-09 16:55:23 +00:00
|
|
|
GAME_OBJS = $(patsubst %,build/baseq2/%,$(GAME_OBJS_))
|
2010-09-01 08:58:58 +00:00
|
|
|
|
2009-03-04 15:12:31 +00:00
|
|
|
# ----------
|
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# Generate header dependencies
|
2012-04-29 13:57:33 +00:00
|
|
|
CLIENT_DEPS= $(CLIENT_OBJS:.o=.d)
|
|
|
|
SERVER_DEPS= $(SERVER_OBJS:.o=.d)
|
|
|
|
GAME_DEPS= $(GAME_OBJS:.o=.d)
|
2009-03-05 11:28:58 +00:00
|
|
|
|
2009-03-05 09:47:10 +00:00
|
|
|
# ----------
|
2009-03-05 16:34:42 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# Suck header dependencies in
|
2012-04-29 13:57:33 +00:00
|
|
|
-include $(CLIENT_DEPS)
|
|
|
|
-include $(SERVER_DEPS)
|
|
|
|
-include $(GAME_DEPS)
|
2009-03-05 16:34:42 +00:00
|
|
|
|
|
|
|
# ----------
|
2009-03-09 16:10:05 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# release/quake2
|
2012-06-04 07:51:17 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
2013-06-15 07:23:02 +00:00
|
|
|
release/quake2.exe : $(CLIENT_OBJS) icon
|
2012-06-04 07:51:17 +00:00
|
|
|
@echo "===> LD $@"
|
2013-06-15 07:23:02 +00:00
|
|
|
${Q}$(CC) build/icon/icon.res $(CLIENT_OBJS) $(LDFLAGS) $(SDLLDFLAGS) -o $@
|
2014-01-27 16:32:12 +00:00
|
|
|
$(Q)strip $@
|
2012-06-04 07:51:17 +00:00
|
|
|
else
|
2013-06-15 07:23:02 +00:00
|
|
|
release/quake2 : $(CLIENT_OBJS)
|
2012-06-04 07:51:17 +00:00
|
|
|
@echo "===> LD $@"
|
2013-06-15 07:23:02 +00:00
|
|
|
${Q}$(CC) $(CLIENT_OBJS) $(LDFLAGS) $(SDLLDFLAGS) $(X11LDFLAGS) -o $@
|
2012-06-04 07:51:17 +00:00
|
|
|
endif
|
2012-09-14 09:21:02 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# release/q2ded
|
2012-06-03 11:06:48 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
2012-06-11 09:13:10 +00:00
|
|
|
release/q2ded.exe : $(SERVER_OBJS) icon
|
2012-06-03 11:06:48 +00:00
|
|
|
@echo "===> LD $@.exe"
|
2012-06-11 09:13:10 +00:00
|
|
|
${Q}$(CC) build/icon/icon.res $(SERVER_OBJS) $(LDFLAGS) -o $@
|
2014-01-27 16:32:12 +00:00
|
|
|
$(Q)strip $@
|
2012-06-03 09:18:26 +00:00
|
|
|
else
|
2011-10-09 16:55:23 +00:00
|
|
|
release/q2ded : $(SERVER_OBJS)
|
2012-06-04 09:49:11 +00:00
|
|
|
@echo "===> LD $@"
|
2011-12-26 08:48:33 +00:00
|
|
|
${Q}$(CC) $(SERVER_OBJS) $(LDFLAGS) -o $@
|
2012-06-03 09:18:26 +00:00
|
|
|
endif
|
2010-11-26 12:28:00 +00:00
|
|
|
|
2011-10-09 16:55:23 +00:00
|
|
|
# release/baseq2/game.so
|
2012-06-04 07:32:35 +00:00
|
|
|
ifeq ($(OSTYPE), Windows)
|
|
|
|
release/baseq2/game.dll : $(GAME_OBJS)
|
|
|
|
@echo "===> LD $@"
|
|
|
|
${Q}$(CC) $(GAME_OBJS) $(LDFLAGS) -o $@
|
2014-01-27 16:32:12 +00:00
|
|
|
$(Q)strip $@
|
2012-06-04 07:32:35 +00:00
|
|
|
else
|
2011-10-09 16:55:23 +00:00
|
|
|
release/baseq2/game.so : $(GAME_OBJS)
|
2012-06-04 07:32:35 +00:00
|
|
|
@echo "===> LD $@"
|
2011-12-26 08:48:33 +00:00
|
|
|
${Q}$(CC) $(GAME_OBJS) $(LDFLAGS) -o $@
|
2012-06-04 07:32:35 +00:00
|
|
|
endif
|
2012-09-14 09:21:02 +00:00
|
|
|
|
2010-11-26 12:28:00 +00:00
|
|
|
# ----------
|