aboutsummaryrefslogtreecommitdiffstats
path: root/games/fteqw/files/patch-Makefile
blob: c47d7a84c73c1dd767bc9e73b6f9a6f9df414ee1 (plain) (blame)
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
88
89
90
91
92
93
94
95
96
97
98
--- Makefile.orig   2014-02-05 16:57:36.000000000 -0500
+++ Makefile
@@ -1,6 +1,6 @@
-CC=gcc
+CC?=gcc
 WINDRES=windres
-STRIP=strip
+STRIP?=strip
 
 STRIPFLAGS=--strip-unneeded --remove-section=.comment
 
@@ -179,9 +179,9 @@ else
 endif
 
 #BASELDFLAGS=-lm  -lz
-GLXLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext $(IMAGELDFLAGS)
-GLSLDFLAGS=-L/usr/X11R6/lib -lMesaGL -lglide -lvga
-XLDFLAGS=-L/usr/X11R6/lib -lX11 -lXext $(IMAGELDFLAGS)
+GLXLDFLAGS=-L$(LOCALBASE)/lib -lX11 -lXext $(IMAGELDFLAGS)
+GLSLDFLAGS=-L$(LOCALBASE)/lib -lMesaGL -lglide -lvga
+XLDFLAGS=-L$(LOCALBASE)/lib -lX11 -lXext $(IMAGELDFLAGS)
 SLDFLAGS=-lvga
 
 ifeq ($(USEASM),true)
@@ -212,18 +212,20 @@ else
    BASE_ASM_CFLAGS = -DNOASM
 endif
 
-BASE_CFLAGS=$(BASE_ASM_CFLAGS) -Wall -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp -I$(CLIENT_DIR) -I$(SERVER_DIR) -I$(COMMON_DIR) -I$(SW_DIR) -I$(GL_DIR) -I$(D3D9_DIR) -I$(D3D7_DIR) -I$(PROGS_DIR) -I$(LIBS_DIR) -I$(LIBS_DIR)/dxsdk7/include -I$(LIBS_DIR)/sdl/include -I$(LIBS_DIR)/sdl/include/SDL -D_vsnprintf=vsnprintf -D_snprintf=snprintf
+BASE_CFLAGS=$(BASE_ASM_CFLAGS) -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp -I$(CLIENT_DIR) -I$(SERVER_DIR) -I$(COMMON_DIR) -I$(SW_DIR) -I$(GL_DIR) -I$(D3D9_DIR) -I$(D3D7_DIR) -I$(PROGS_DIR) -I$(LIBS_DIR) -I$(LIBS_DIR)/dxsdk7/include -I$(LIBS_DIR)/sdl/include -I$(LIBS_DIR)/sdl/include/SDL -D_vsnprintf=vsnprintf -D_snprintf=snprintf
 CLIENT_ONLY_CFLAGS=-DCLIENTONLY
 SERVER_ONLY_CFLAGS=-DSERVERONLY
 JOINT_CFLAGS=
 DEBUG_CFLAGS=-ggdb -g
 
+ifeq ($(OPTIMIZED_CFLAGS),true)
 ifeq ($(FTE_TARGET),win32)
    RELEASE_CFLAGS=-fno-strict-aliasing -ffast-math -fexpensive-optimizations $(CPUOPTIMIZATIONS)
 else
    RELEASE_CFLAGS=-O2 -fno-strict-aliasing $(CPUOPTIMIZATIONS)
    #RELEASE_CFLAGS=-O6 -fno-strict-aliasing -ffast-math -funroll-loops -fexpensive-optimizations $(CPUOPTIMIZATIONS)
 endif
+endif
 
 GLCFLAGS=-DGLQUAKE
 SWCFLAGS=-DSWQUAKE
@@ -469,7 +471,7 @@ ifdef windir
 SW_LDFLAGS=$(SWLDFLAGS) -lmingw32 -lwsock32 -lSDLmain -lSDL
 else
 #pthread is needed because of SDL.
-SW_LDFLAGS=$(SWLDFLAGS) `sdl-config --libs` $(IMAGELDFLAGS)
+SW_LDFLAGS=$(SWLDFLAGS) `sdl-config --libs` $(IMAGELDFLAGS) -lz
 endif
 SW_CFLAGS=$(SWCFLAGS) `sdl-config --cflags`
 SWB_DIR=sw_sdl$(BITS)
@@ -550,7 +552,7 @@ ifeq ($(FTE_TARGET),bsd)
    #oss, X, etc.
 
    SV_DIR=sv_linux
-   SV_LDFLAGS=-lz -ldl
+   SV_LDFLAGS=-lz
 
 ifeq ($(USEASM),true)
    GLCL_OBJS=$(GL_OBJS) $(GLQUAKE_OBJS) gl_vidlinuxglx.o snd_linux.o cd_null.o sys_linux.o sys_dosa.o
@@ -559,20 +561,13 @@ else
 endif
    GL_EXE_NAME=../fteqw.gl
    GLCL_EXE_NAME=../fteqwcl.gl
-   GL_LDFLAGS= -L/usr/local/lib $(GLLDFLAGS) $(GLXLDFLAGS) -lXxf86vm -lpthread
-   GL_CFLAGS=$(GLCFLAGS) -I/usr/local/include -I/usr/X11R6/include
+   GL_LDFLAGS= -L/usr/local/lib $(GLLDFLAGS) $(GLXLDFLAGS) -lXxf86vm -lpthread -lz
+   GL_CFLAGS=$(GLCFLAGS) -I$(LOCALBASE)/include
    GLB_DIR=gl_bsd
    GLCL_DIR=glcl_bsd
 
-ifeq ($(USEASM),true)
-   SWCL_OBJS=$(SOFTWARE_OBJS) vid_x.o snd_linux.o cd_null.o sys_linux.o sys_dosa.o
-else
-   SWCL_OBJS=$(SOFTWARE_OBJS) vid_x.o snd_linux.o cd_null.o sys_linux.o
-endif
-   SW_EXE_NAME=../fteqw.sw
-   SWCL_EXE_NAME=../fteqwcl.sw
-   SW_LDFLAGS=-L/usr/local/lib $(SWLDFLAGS) $(XLDFLAGS) -lXxf86vm -lpthread
-   SW_CFLAGS=$(SWCFLAGS) -I/usr/local/include -I/usr/X11R6/include
+   SW_EXE_NAME=../fteqw.sdl
+   SWCL_EXE_NAME=../fteqwcl.sdl
    SWB_DIR=sw_bsd
    SWCL_DIR=swcl_bsd
 
@@ -584,7 +579,7 @@ endif
    M_EXE_NAME=../fteqw
    MCL_EXE_NAME=../fteqwcl
    M_LDFLAGS=$(GLLDFLAGS) $(GLXLDFLAGS) -lXxf86vm -lpthread
-   M_CFLAGS=$(SWCFLAGS) $(GLCFLAGS) -I/usr/X11R6/include
+   M_CFLAGS=$(SWCFLAGS) $(GLCFLAGS) -I$(LOCALBASE)/include
    MB_DIR=m_bsd
    MCL_DIR=mcl_bsd