freebsd-ports/games/ezquake/files/patch-Makefile
2008-05-06 23:29:52 +00:00

95 lines
2.8 KiB
Text

--- Makefile.orig 2008-04-27 17:51:52.000000000 -0300
+++ Makefile 2008-04-29 22:27:42.000000000 -0300
@@ -6,7 +6,7 @@
# compilation tool and detection of targets/achitecture
_E = @
-CC = gcc
+CC ?= gcc
CC_BASEVERSION = $(shell $(CC) -dumpversion | sed -e 's/\..*//g')
# TYPE = release debug
@@ -19,17 +19,6 @@
ARCH = $(shell uname -m | sed -e 's/i.86/x86/g' -e 's/Power Macintosh/ppc/g')
OS = $(shell uname -s | tr A-Z a-z)
-# add special architecture based flags
-ifeq ($(ARCH),x86_64)
- ARCH_CFLAGS = -mtune=nocona -mmmx -msse -msse2 -m64
-endif
-ifeq ($(ARCH),x86)
- ARCH_CFLAGS = -march=i686 -mtune=generic -mmmx -Did386
-endif
-ifeq ($(ARCH),ppc)
- ARCH_CFLAGS = -arch ppc -faltivec -maltivec -mcpu=7450 -mtune=7450 -mpowerpc -mpowerpc-gfxopt
-endif
-
ifeq ($(OS),linux)
DEFAULT_TARGET = glx
OS_GL_CFLAGS = -DWITH_DGA -DWITH_EVDEV -DWITH_VMODE
@@ -55,19 +44,19 @@
# Directories for object files #
################################
-GLX_DIR = $(TYPE)-$(ARCH)/glx
-X11_DIR = $(TYPE)-$(ARCH)/x11
-SVGA_DIR = $(TYPE)-$(ARCH)/svga
-MAC_DIR = $(TYPE)-$(ARCH)/mac
+GLX_DIR = $(TYPE)/glx
+X11_DIR = $(TYPE)/x11
+SVGA_DIR = $(TYPE)/svga
+MAC_DIR = $(TYPE)/mac
################
# Binary files #
################
-GLX_TARGET = $(TYPE)-$(ARCH)/ezquake-gl.glx
-X11_TARGET = $(TYPE)-$(ARCH)/ezquake.x11
-SVGA_TARGET = $(TYPE)-$(ARCH)/ezquake.svga
-MAC_TARGET = $(TYPE)-$(ARCH)/ezquake-gl.mac
+GLX_TARGET = $(TYPE)/ezquake-gl.glx
+X11_TARGET = $(TYPE)/ezquake.x11
+SVGA_TARGET = $(TYPE)/ezquake.svga
+MAC_TARGET = $(TYPE)/ezquake-gl.mac
QUAKE_DIR="/opt/quake/"
################
@@ -89,7 +78,8 @@
# -DWITH_MPD for mpd MP3 player support
# -DWITH_WINAMP for winamp MP3 player support
PRJ_CFLAGS = -DWITH_ZLIB -DWITH_PNG -DEMBED_TCL -DJSS_CAM -DWITH_ZIP -DWITH_FTE_VFS
-BASE_CFLAGS = -pipe -Wall -funsigned-char $(ARCH_CFLAGS) $(PRJ_CFLAGS) -I./libs
+BASE_CFLAGS := $(CFLAGS) -pipe -Wall -funsigned-char $(ARCH_CFLAGS) $(PRJ_CFLAGS) `pcre-config --cflags` -I$(TCL_INCLUDEDIR) -I.. -DQ1DIR='"$(Q1DIR)"' -DDATADIR='"$(DATADIR)"'
+
########################
@@ -112,7 +102,9 @@
########################
+ifeq ($(USE_OPTIMIZED_CFLAGS),YES)
RELEASE_CFLAGS = -O2 -fno-strict-aliasing -ffast-math -funroll-loops
+endif
DEBUG_CFLAGS = -ggdb
# opengl builds
@@ -125,13 +117,13 @@
endif
ifeq ($(TYPE),release)
-LDFLAGS = -lm -lpthread
+LDFLAGS = -lm -pthread
else
-LDFLAGS = -ggdb -lm -lpthread
+LDFLAGS = -ggdb -lm -pthread
endif
-COMMON_LIBS = libs/$(LIB_PREFIX)/minizip.a libs/$(LIB_PREFIX)/libpng.a libs/$(LIB_PREFIX)/libz.a libs/$(LIB_PREFIX)/libpcre.a libs/$(LIB_PREFIX)/libexpat.a libs/$(LIB_PREFIX)/libtcl.a
-GL_LIBS = libs/$(LIB_PREFIX)/libjpeg.a
+COMMON_LIBS = -lm -lpng -lz `pcre-config --libs` `glib-config --libs` -lexpat -ltcl$(TCL_SUFX)
+GL_LIBS = -ljpeg
ifeq ($(OS),freebsd)
X11BASE ?= /usr/X11R6