r120 - trunk/code/unix

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Sep 27 12:35:25 EDT 2005


Author: tma
Date: 2005-09-27 12:35:25 -0400 (Tue, 27 Sep 2005)
New Revision: 120

Modified:
   trunk/code/unix/Makefile
Log:
* 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


Modified: trunk/code/unix/Makefile
===================================================================
--- trunk/code/unix/Makefile	2005-09-26 22:26:13 UTC (rev 119)
+++ trunk/code/unix/Makefile	2005-09-27 16:35:25 UTC (rev 120)
@@ -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
+ifndef BUILD_FREETYPE
+BUILD_FREETYPE=0
+endif
 
+ifndef GENERATE_DEPENDANCIES
+GENERATE_DEPENDANCIES=1
+endif
 
-# Build name
-# BUILD_NAME=$(BUILD_NAME)
-BUILD_NAME=quake3
-
-BUILD_FREETYPE=0
-
 # 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 @@
 
   # 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 @@
   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 @@
 
 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 @@
 	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-release:
 	$(MAKE) clean2 B=$(BR) CFLAGS="$(DEBUG_CFLAGS)"
 
+#############################################################################
+# DEPENDANCIES
+#############################################################################
+
+include $(shell find -name "*.d")




More information about the quake3-commits mailing list