Makefile
branch0.4
changeset 9975 61857a49e8f7
parent 9973 72d7f7f30746
child 10050 53795ed4cdaf
--- a/Makefile	Tue May 02 12:17:16 2006 +0000
+++ b/Makefile	Tue May 02 12:28:35 2006 +0000
@@ -46,7 +46,6 @@
 # WITH_COCOA: Cocoa video driver support
 #
 # Summary of other defines:
-# MANUAL_CONFIG: do not use Makefile.config, config options set manually
 # DEBUG: build in debug mode
 # PROFILE: build in profile mode, disables -s and -fomit-frame-pointer
 # TRANSLATOR: build in translator mode (untranslated strings are prepended by
@@ -137,10 +136,6 @@
 # it checks if the version tag in Makefile.config is the same and force update outdated config files
 MAKEFILE_VERSION:=10
 
-# CONFIG_WRITER has to be found even for manual configuration
-CONFIG_WRITER=makefiledir/Makefile.config_writer
-
-ifndef MANUAL_CONFIG
 # Automatic configuration
 MAKE_CONFIG:=Makefile.config
 MAKEFILE:=Makefile
@@ -151,30 +146,10 @@
 # See target section for how this is built, suppress errors
 # since first time it isn't found but make reads this twice
 -include $(MAKE_CONFIG)
-else
-CONFIG_INCLUDED:=1
-endif
 
-ifndef LIBPNG-CONFIG
-LIBPNG-CONFIG :=libpng-config
-endif
 
 # updates Makefile.config if it's outdated
 ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION))
-	ifndef MANUAL_CONFIG	# manual config should not check this
-		UPDATECONFIG:=upgradeconf
-		CONFIG_INCLUDED:=
-	else
-		# this should define SDL-CONFIG for manual configuration
-		ifeq ($(shell uname),FreeBSD)
-			SDL-CONFIG:=sdl11-config
-		else
-			SDL-CONFIG:=sdl-config
-		endif
-	endif
-endif
-
-ifndef SDL-CONFIG
 	UPDATECONFIG:=upgradeconf
 	CONFIG_INCLUDED:=
 endif
@@ -251,6 +226,17 @@
 	LDFLAGS+=-framework Cocoa
 endif
 
+ifdef WITH_SDL
+	ifndef SDL_CONFIG
+$(error WITH_SDL can't be used when SDL_CONFIG is not set. Edit Makefile.config to correct this)
+	endif
+endif
+
+ifdef WITH_PNG
+	ifndef LIBPNG_CONFIG
+$(error WITH_PNG can't be used when LIBPNG_CONFIG is not set. Edit Makefile.config to correct this)
+	endif
+endif
 
 ##############################################################################
 #
@@ -416,42 +402,22 @@
 # SDL config
 ifdef WITH_SDL
 CDEFS += -DWITH_SDL
-CFLAGS += $(shell $(SDL-CONFIG) --cflags)
+CFLAGS += $(shell $(SDL_CONFIG) --cflags)
 ifdef STATIC
-LIBS += $(shell $(SDL-CONFIG) --static-libs)
+LIBS += $(shell $(SDL_CONFIG) --static-libs)
 else
-LIBS += $(shell $(SDL-CONFIG) --libs)
+LIBS += $(shell $(SDL_CONFIG) --libs)
 endif
 endif
 
 # zlib config
 ifdef WITH_ZLIB
-	CDEFS +=  -DWITH_ZLIB
+	CDEFS += -DWITH_ZLIB
 	ifdef STATIC
 		ifdef OSX
-# zlib is default on OSX, so everybody have it. No need for static linking
+		# OSX links dynamically to zlib, even in static builds since it's always present in the system
 			LIBS += -lz
 		else
-			ifndef STATIC_ZLIB_PATH
-				ifndef MANUAL_CONFIG
-					# updates Makefile.config with the zlib path
-					UPDATECONFIG:=upgradeconf
-				endif
-				TEMP:=$(shell ls /lib 2>/dev/null | grep "zlib.a")$(shell ls /lib 2>/dev/null | grep "libz.a")
-				ifdef TEMP
-					STATIC_ZLIB_PATH:=/lib/$(TEMP)
-				else
-					TEMP:=$(shell ls /usr/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/lib 2>/dev/null | grep "libz.a")
-					ifdef TEMP
-						STATIC_ZLIB_PATH:=/usr/lib/$(TEMP)
-					else
-						TEMP:=$(shell ls /usr/local/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/local/lib 2>/dev/null | grep "libz.a")
-						ifdef TEMP
-							STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP)
-						endif
-					endif
-				endif
-			endif
 			LIBS += $(STATIC_ZLIB_PATH)
 		endif
 	else
@@ -462,19 +428,19 @@
 # libpng config
 ifdef WITH_PNG
 CDEFS += -DWITH_PNG
-CFLAGS += $(shell $(LIBPNG-CONFIG) --cppflags --I_opts)
+CFLAGS += $(shell $(LIBPNG_CONFIG) --cppflags --I_opts)
 
 # seems like older libpng versions are broken and need this
 PNGCONFIG_FLAGS = --ldflags --libs
 ifdef STATIC
 ifdef OSX
 # Seems like we need a tiny hack for OSX static to work
-LIBS += $(shell $(LIBPNG-CONFIG) --prefix)/lib/libpng.a
+LIBS += $(shell $(LIBPNG_CONFIG) --prefix)/lib/libpng.a
 else
-LIBS += $(shell $(LIBPNG-CONFIG) --static $(PNGCONFIG_FLAGS))
+LIBS += $(shell $(LIBPNG_CONFIG) --static $(PNGCONFIG_FLAGS))
 endif
 else
-LIBS += $(shell $(LIBPNG-CONFIG)  --L_opts $(PNGCONFIG_FLAGS))
+LIBS += $(shell $(LIBPNG_CONFIG)  --L_opts $(PNGCONFIG_FLAGS))
 endif
 endif