1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
--- Makefile.orig Fri Jan 4 11:28:34 2008
+++ Makefile Fri Jan 4 11:29:06 2008
@@ -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 i686 -arch ppc -msse2
-endif
-
ifeq ($(OS),linux)
DEFAULT_TARGET = glx
OS_GL_CFLAGS = -DWITH_DGA -DWITH_EVDEV -DWITH_VMODE
@@ -53,19 +42,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
################
@@ -81,9 +70,11 @@
# compiler flags
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.. -DDATADIR='"$(Q1DIR)"'
+ifeq ($(USE_OPTIMIZED_CFLAGS),YES)
RELEASE_CFLAGS = -O2 -fno-strict-aliasing -ffast-math -funroll-loops
+endif
DEBUG_CFLAGS = -ggdb
# opengl builds
@@ -96,13 +87,13 @@
endif
ifeq ($(TYPE),release)
-LDFLAGS = -lm -lpthread
+LDFLAGS = -lm -pthread
else
LDFLAGS = -ggdb -lm -lpthread
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)/libtcl8.4.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)
LOCALBASE ?= /usr/X11R6
|