aboutsummaryrefslogtreecommitdiffstats
path: root/code/unix
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-09-27 16:35:25 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-09-27 16:35:25 +0000
commit900e3138de0d5732857f120786b46e688d43639c (patch)
treee69ddeeb0ae16aa630e292df12c127717b8273a0 /code/unix
parent86573f21d93853aac9fe6d026ceb6a35c859b02d (diff)
downloadioquake3-aero-900e3138de0d5732857f120786b46e688d43639c.tar.gz
ioquake3-aero-900e3138de0d5732857f120786b46e688d43639c.zip
* The Makefile now sources Makefile.local, so you shouldn't need to change the Makefile itself any more
* The Makefile now inherits CFLAGS from the shell environment * The Makefile now generates dependancies by default, it can be disabled by setting GENERATE_DEPENDANCIES=0 in Makefile.local * Removed -Werror from the linux build since it's not GCC 4 clean yet. Again, it can be added back via Makefile.local git-svn-id: svn://svn.icculus.org/quake3/trunk@120 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/unix')
-rw-r--r--code/unix/Makefile56
1 files changed, 36 insertions, 20 deletions
diff --git a/code/unix/Makefile b/code/unix/Makefile
index 378f9eb..ff4f5f2 100644
--- a/code/unix/Makefile
+++ b/code/unix/Makefile
@@ -20,36 +20,40 @@
PLATFORM=$(shell uname|sed -e s/_.*//|tr A-Z a-z)
PLATFORM_RELEASE=$(shell uname -r)
ARCH:=$(shell uname -m | sed -e s/i.86/i386/)
+
+#############################################################################
+#
+# If you require a different configuration from the defaults below, create a
+# new file name "Makefile.local" in the same directory as this file and define
+# your parameters there. This allows you change configuration without causing
+# problems with keeping up to date with the repository.
+#
+#############################################################################
+-include Makefile.local
+
ifndef COPYDIR
COPYDIR="/usr/local/games/quake3"
endif
-###
-### These paths are where you probably want to change things
-###
-
# Where we are building from (where the source code should be!)
+ifndef MOUNT_DIR
MOUNT_DIR=..
+endif
-# Where we are building to, libMesaVoodooGL.so.3.3 should be here, etc.
-# the demo pk3 file should be here in demoq3/pak0.pk3 or baseq3/pak0.pk3
-BDIR=$(MOUNT_DIR)/../run
-
-
-# Build name
-# BUILD_NAME=$(BUILD_NAME)
-BUILD_NAME=quake3
-
+ifndef BUILD_FREETYPE
BUILD_FREETYPE=0
+endif
+
+ifndef GENERATE_DEPENDANCIES
+GENERATE_DEPENDANCIES=1
+endif
# Used for building with mingw
+ifndef DXSDK_DIR
DXSDK_DIR=C:/DXSDK
+endif
#############################################################################
-##
-## You shouldn't have to touch anything below here
-##
-#############################################################################
BD=debug$(ARCH)$(GLIBC)
BR=release$(ARCH)$(GLIBC)
@@ -114,7 +118,7 @@ ifeq ($(PLATFORM),linux)
# bk001205: no mo' -I/usr/include/glide, no FX
# bk001205: no mo' -Dstricmp=strcasecmp, see q_shared.h
- BASE_CFLAGS = -pipe -Wall -Wimplicit -Wstrict-prototypes -Werror
+ BASE_CFLAGS = -pipe -Wall -Wimplicit -Wstrict-prototypes
#BASE_CFLAGS += -Werror # Disabled due to #warning usage.
# rcg010216: DLL_ONLY for PPC
ifeq ($(strip $(DLL_ONLY)),true)
@@ -418,6 +422,12 @@ ifdef DEFAULT_BASEDIR
BASE_CFLAGS += -DDEFAULT_BASEDIR=\\\"$(DEFAULT_BASEDIR)\\\"
endif
+ifeq ($(GENERATE_DEPENDANCIES),1)
+ ifeq ($(CC),gcc)
+ DEPEND_CFLAGS=-MMD
+ endif
+endif
+
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
DO_CXX=$(CXX) $(CFLAGS) -o $@ -c $<
DO_SMP_CC=$(CC) $(CFLAGS) -DSMP -o $@ -c $<
@@ -439,11 +449,11 @@ release: build_release
build_debug: B=$(BD)
build_debug: makedirs
- $(MAKE) targets B=$(BD) CFLAGS="$(DEBUG_CFLAGS)"
+ $(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS) $(DEPEND_CFLAGS)"
build_release: B=$(BR)
build_release: makedirs
- $(MAKE) targets B=$(BR) CFLAGS="$(RELEASE_CFLAGS)"
+ $(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS) $(DEPEND_CFLAGS)"
#Build both debug and release builds
all:build_debug build_release
@@ -1574,6 +1584,7 @@ clean-bins:
rm -f $(B)/missionpack/vm/cgame.qvm
rm -f $(B)/missionpack/vm/qagame.qvm
rm -f $(B)/missionpack/vm/ui.qvm
+ if [ -d $(B) ];then (find $(B) -name '*.d' -exec rm {} \;)fi
clean-debug:
$(MAKE) clean2 B=$(BD) CFLAGS="$(DEBUG_CFLAGS)"
@@ -1581,3 +1592,8 @@ clean-debug:
clean-release:
$(MAKE) clean2 B=$(BR) CFLAGS="$(DEBUG_CFLAGS)"
+#############################################################################
+# DEPENDANCIES
+#############################################################################
+
+include $(shell find -name "*.d")