aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-06 18:21:10 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-06 18:21:10 +0000
commit4e64b0a1b82badbf25bb32bd96290f96668c2290 (patch)
treeb6712eb8ada4742f54b84a507ce48070ed668b39 /Makefile
parented3c9635a68e03c1448e64ff49824b65fa1f4776 (diff)
downloadioquake3-aero-4e64b0a1b82badbf25bb32bd96290f96668c2290.tar.gz
ioquake3-aero-4e64b0a1b82badbf25bb32bd96290f96668c2290.zip
* Compile time and runtime checks for SDL >= 1.2.7
* Modified versioning to play nice with the reverted Makefile change git-svn-id: svn://svn.icculus.org/quake3/trunk@1168 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 27 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 6e38dc6..aa10e38 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,5 @@
#
-# Quake3 Unix Makefile
-#
-# Nov '98 by Zoid <zoid@idsoftware.com>
-#
-# Loki Hacking by Bernd Kreimeier
-# and a little more by Ryan C. Gordon.
-# and a little more by Rafael Barrero
-# and a little more by the ioq3 cr3w
+# ioq3 Makefile
#
# GNU Make required
#
@@ -144,8 +137,8 @@ SDLHDIR=$(MOUNT_DIR)/SDL12
LIBSDIR=$(MOUNT_DIR)/libs
# extract version info
-VERSION=$(shell grep "\#define Q3_VERSION" $(CMDIR)/q_shared.h | \
- sed -e 's/.*".* \([^ ]*\)"/\1/')
+VERSION=$(shell grep "\#define *PRODUCT_VERSION" $(CMDIR)/q_shared.h | \
+ sed -e 's/[^"]*"\(.*\)"/\1/')
USE_SVN=
ifeq ($(wildcard .svn),.svn)
@@ -738,7 +731,7 @@ echo_cmd=@echo
Q=@
endif
-define DO_CC
+define DO_CC
$(echo_cmd) "CC $<"
$(Q)$(CC) $(NOTSHLIBCFLAGS) $(CFLAGS) -o $@ -c $<
endef
@@ -800,7 +793,7 @@ release:
# Create the build directories and tools, print out
# an informational message, then start building
-targets: makedirs tools
+targets: makedirs tools libversioncheck
@echo ""
@echo "Building ioquake3 in $(B):"
@echo " PLATFORM: $(PLATFORM)"
@@ -870,6 +863,28 @@ endef
#############################################################################
+# LIBRARY VERSION CHECKS
+#############################################################################
+
+MINSDL_MAJOR = 1
+MINSDL_MINOR = 2
+MINSDL_PATCH = 7
+
+BASE_CFLAGS += -DMINSDL_MAJOR=$(MINSDL_MAJOR) \
+ -DMINSDL_MINOR=$(MINSDL_MINOR) \
+ -DMINSDL_PATCH=$(MINSDL_PATCH)
+
+libversioncheck:
+ @echo "#include \"SDL_version.h\"\n" \
+ "#if SDL_VERSION_ATLEAST(" \
+ "$(MINSDL_MAJOR),$(MINSDL_MINOR),$(MINSDL_PATCH)" \
+ ")\nMINSDL_PASSED\n#endif" | \
+ $(CC) $(BASE_CFLAGS) -E - | grep -q MINSDL_PASSED || \
+ ( echo "SDL version $(MINSDL_MAJOR).$(MINSDL_MINOR).$(MINSDL_PATCH)" \
+ "or greater required" && exit 1 )
+
+
+#############################################################################
# CLIENT/SERVER
#############################################################################