aboutsummaryrefslogtreecommitdiffstats
path: root/games/tenebrae/files/patch-linux__Makefile.i386linux
blob: 9e038de535801482158b3715758d473089787a91 (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
99
100
101
102
103
104
105
106
107
108
--- ./linux/Makefile.i386linux.orig Sat Jun 10 12:08:13 2006
+++ ./linux/Makefile.i386linux  Sat Jun 10 12:12:17 2006
@@ -18,56 +18,60 @@
 
 MOUNT_DIR     = ../
 
-MASTER_DIR    = /usr/local/share/games/quake
+MASTER_DIR    = ${Q1DIR}
 
 BUILD_DEBUG_DIR = debug$(ARCH)$(GLIBC)
-BUILD_RELEASE_DIR = release$(ARCH)$(GLIBC)
+BUILD_RELEASE_DIR = release
 
-LEX           = /usr/bin/flex -i -Cfr
-CC            = /usr/bin/gcc
+LEX           ?= /usr/bin/flex -i -Cfr
+#CC            = /usr/bin/gcc
 
-X11_LIBS      = -L/usr/X11R6/lib -lpthread -lX11 -lXext -lXxf86dga -lXxf86vm
+X11_LIBS      = -L${LOCALBASE}/lib -lX11 -lXext -lXxf86dga -lXxf86vm
 
 # to enable OpenGL code in source 
-OPENGL_CFLAGS = -D__glx__ -DGLQUAKE
+OPENGL_CFLAGS = -D__glx__ -DGLQUAKE -I${LOCALBASE}/include
 OPENGL_LIBS   = -lGL -lGLU
 
-PNG_LIBS      = -lpng -lz
+PNG_LIBS      = -L${LOCALBASE}/lib -lpng -lz
 
 #OPENAL_LIBS   = -lopenal 
-#OPENAL_CFLAGS = -DOPENAL -I/usr/local/include/AL
+#OPENAL_CFLAGS = -DOPENAL -I${LOCALBASE}/include/AL
 
-BASE_CFLAGS   = -DBASEDIR="$(MASTER_DIR)" -DUSERPREF_DIR $(OPENGL_CFLAGS) $(OPENAL_CFLAGS) -I$(MOUNT_DIR)
-RELEASE_CFLAGS = $(BASE_CFLAGS) -mpentiumpro -O6 -ffast-math -funroll-loops \
+BASE_CFLAGS   = -DBASEDIR="$(MASTER_DIR)" -DUSERPREF_DIR $(OPENGL_CFLAGS) $(OPENAL_CFLAGS) -I$(MOUNT_DIR) -I${LOCALBASE}/include `${SDL_CONFIG} --cflags`
+RELEASE_CFLAGS = $(BASE_CFLAGS) -ffast-math -funroll-loops \
    -fomit-frame-pointer -fexpensive-optimizations
 DEBUG_CFLAGS  = $(BASE_CFLAGS) -g 
-LDFLAGS       = -lm -ldl $(X11_LIBS) $(OPENGL_LIBS) $(PNG_LIBS) $(OPENAL_LIBS) 
+LDFLAGS       += -lm $(X11_LIBS) $(OPENGL_LIBS) $(PNG_LIBS) $(OPENAL_LIBS) `${SDL_CONFIG} --libs`
 
 DO_GL_CC      = $(CC) $(CFLAGS) -o $@ -c $<
 DO_GL_AS      = $(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
 DO_LEX        = $(LEX) -o$@ $< 
 
+ifdef USE_ASM
+BASE_CFLAGS += -DUSE_ASM
+endif
+
 #############################################################################
 # SETUP AND BUILD
 #############################################################################
 
-TARGETS=$(BUILDDIR)/bin/tenebrae.run
+TARGETS=$(BUILDDIR)/bin/tenebrae
+
+all: build_release
+
+targets: $(TARGETS)
 
 build_debug:
    @-mkdir -p $(BUILD_DEBUG_DIR) \
        $(BUILD_DEBUG_DIR)/bin \
        $(BUILD_DEBUG_DIR)/glquake
-   $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
+   $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS+="$(DEBUG_CFLAGS)"
 
 build_release:
    @-mkdir -p $(BUILD_RELEASE_DIR) \
        $(BUILD_RELEASE_DIR)/bin \
        $(BUILD_RELEASE_DIR)/glquake
-   $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)"
-
-all: build_debug build_release
-
-targets: $(TARGETS)
+   $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS+="$(RELEASE_CFLAGS)"
 
 #############################################################################
 # GLQuake
@@ -143,7 +147,7 @@
    $(BUILDDIR)/glquake/snd_dma.o \
    $(BUILDDIR)/glquake/snd_mem.o \
    $(BUILDDIR)/glquake/snd_mix.o \
-   $(BUILDDIR)/glquake/snd_linux.o \
+   $(BUILDDIR)/glquake/snd_sdl.o \
    $(BUILDDIR)/glquake/gl_vidlinuxglx.o \
    $(BUILDDIR)/glquake/math.o \
    $(BUILDDIR)/glquake/worlda.o \
@@ -154,7 +158,7 @@
    $(BUILDDIR)/glquake/te_scripts.o 
 
 
-$(BUILDDIR)/bin/tenebrae.run : $(GLQUAKE_OBJS)
+$(BUILDDIR)/bin/tenebrae : $(GLQUAKE_OBJS)
    $(CC) $(CFLAGS) -o $@ $(GLQUAKE_OBJS) $(LDFLAGS)
 
 $(BUILDDIR)/glquake/cl_demo.o :      $(MOUNT_DIR)/cl_demo.c
@@ -361,7 +365,7 @@
 $(BUILDDIR)/glquake/snd_mix.o :      $(MOUNT_DIR)/snd_mix.c
    $(DO_GL_CC)
 
-$(BUILDDIR)/glquake/snd_linux.o :    $(MOUNT_DIR)/snd_linux.c
+$(BUILDDIR)/glquake/snd_sdl.o :    $(MOUNT_DIR)/snd_sdl.c
    $(DO_GL_CC)
 
 $(BUILDDIR)/glquake/math.o :         $(MOUNT_DIR)/math.s