1 ##### Variables that you may want to modify #####
3 #choose the compiler you want to use
6 #recommended for: anyone not using ALSA 0.5
7 OBJ_SND=snd_oss.o snd_dma.o snd_mix.o snd_mem.o
9 #recommended for: anyone using ALSA 0.5
10 #OBJ_SND=snd_alsa_0_5.o snd_dma.o snd_mix.o snd_mem.o
12 #recommended for: no one (this driver needs to be updated, it doesn't compile anymore)
13 #OBJ_SND=snd_alsa_0_9.o snd_dma.o snd_mix.o snd_mem.o
15 #recommended for: anyone who can't use the above drivers
19 #if you want CD sound in Linux
21 #if you want no CD audio
24 #K6/athlon optimizations
25 #CPUOPTIMIZATIONS=-march=k6
26 #note: don't use -march=athlon, every gcc which has it currently (2.96-3.1)
27 #have optimizer bugs (like entities disappearing randomly - a bug with
28 #compiling BOX_ON_PLANE_SIDE in mathlib.h)
29 #CPUOPTIMIZATIONS=-march=athlon
31 #CPUOPTIMIZATIONS=-march=i686
36 ##### Variables that you shouldn't care about #####
39 CLIENTOBJECTS= cgame.o cgamevm.o chase.o cl_collision.o cl_demo.o cl_input.o \
40 cl_main.o cl_parse.o cl_particles.o cl_screen.o cl_video.o \
41 console.o dpvsimpledecode.o fractalnoise.o gl_backend.o \
42 gl_draw.o gl_models.o gl_rmain.o gl_rsurf.o gl_textures.o \
43 jpeg.o keys.o menu.o meshqueue.o r_crosshairs.o r_explosion.o \
44 r_explosion.o r_lerpanim.o r_light.o r_modules.o r_sky.o \
45 r_sprites.o sbar.o ui.o vid_shared.o view.o wavefile.o \
47 SERVEROBJECTS= pr_cmds.o pr_edict.o pr_exec.o sv_light.o sv_main.o sv_move.o \
49 SHAREDOBJECTS= builddate.o cmd.o collision.o common.o crc.o cvar.o \
50 filematch.o host.o host_cmd.o image.o mathlib.o matrixlib.o \
51 model_alias.o model_brush.o model_shared.o model_sprite.o \
52 net_bsd.o net_dgrm.o net_loop.o net_main.o net_master.o \
53 net_udp.o palette.o portals.o protocol.o quakeio.o sys_linux.o \
54 sys_shared.o world.o wad.o zone.o
56 OBJ_COMMON= $(CLIENTOBJECTS) $(SERVEROBJECTS) $(SHAREDOBJECTS)
57 OBJ_GLX= vid_glx.o $(OBJ_CD) $(OBJ_SND)
58 OBJ_DED= vid_null.o cd_null.o snd_null.o
62 CFLAGS_COMMON=-MD -Wall -Werror
64 CFLAGS_PROFILE=-g -pg -ggdb
68 OPTIM_RELEASE= -O6 -fno-strict-aliasing -ffast-math -funroll-loops \
69 -fexpensive-optimizations $(CPUOPTIMIZATIONS)
71 DO_CC=$(CC) $(CFLAGS) -c $< -o $@
75 LDFLAGS_COMMON=-lm -ldl
76 LDFLAGS_DEBUG=-g -ggdb
77 LDFLAGS_PROFILE=-g -pg
80 EXE_GLX=darkplaces-glx
81 EXE_DED=darkplaces-dedicated
83 GLX_LIB=-L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm $(SOUNDLIB)
85 DO_LD=$(CC) -o $@ $^ $(LDFLAGS)
91 debug profile release \
92 glx-debug glx-profile glx-release \
93 ded-debug ded-profile ded-release \
97 @echo "===== Choose one ====="
98 @echo "* $(MAKE) clean : delete the binaries, and .o and .d files"
99 @echo "* $(MAKE) help : this help"
100 @echo "* $(MAKE) debug : make GLX and dedicated binaries (debug versions)"
101 @echo "* $(MAKE) profile : make GLX and dedicated binaries (profile versions)"
102 @echo "* $(MAKE) release : make GLX and dedicated binaries (release versions)"
103 @echo "* $(MAKE) glx-debug : make GLX binary (debug version)"
104 @echo "* $(MAKE) glx-profile : make GLX binary (profile version)"
105 @echo "* $(MAKE) glx-release : make GLX binary (release version)"
106 @echo "* $(MAKE) ded-debug : make dedicated server (debug version)"
107 @echo "* $(MAKE) ded-profile : make dedicated server (profile version)"
108 @echo "* $(MAKE) ded-release : make dedicated server (release version)"
112 $(MAKE) glx-debug ded-debug
115 $(MAKE) glx-profile ded-profile
118 $(MAKE) glx-release ded-release
121 $(MAKE) bin-debug EXE="$(EXE_GLX)"
124 $(MAKE) bin-profile EXE="$(EXE_GLX)"
127 $(MAKE) bin-release EXE="$(EXE_GLX)"
130 $(MAKE) bin-debug EXE="$(EXE_DED)"
133 $(MAKE) bin-profile EXE="$(EXE_DED)"
136 $(MAKE) bin-release EXE="$(EXE_DED)"
140 @echo "========== $(EXE) (debug) =========="
141 # @echo Using compiler $(CC)
142 # @echo Compiling with flags: $(CFLAGS_COMMON) $(CFLAGS_DEBUG) \
146 CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_DEBUG) $(OPTIM_DEBUG)"\
147 LDFLAGS="$(LDFLAGS_COMMON) $(LDFLAGS_DEBUG)"
151 @echo "========== $(EXE) (profile) =========="
152 # @echo Using compiler $(CC)
153 # @echo Compiling with flags: $(CFLAGS_COMMON) $(CFLAGS_PROFILE) \
157 CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_PROFILE) $(OPTIM_RELEASE)"\
158 LDFLAGS="$(LDFLAGS_COMMON) $(LDFLAGS_PROFILE)"
162 @echo "========== $(EXE) (release) =========="
163 # @echo Using compiler $(CC)
164 # @echo Compiling with flags: $(CFLAGS_COMMON) $(CFLAGS_RELEASE) \
168 CFLAGS="$(CFLAGS_COMMON) $(CFLAGS_RELEASE) $(OPTIM_RELEASE)"\
169 LDFLAGS="$(LDFLAGS_COMMON) $(LDFLAGS_RELEASE)"
175 # @echo " Compiling" $<
176 $(DO_CC) -I/usr/X11R6/include
179 # @echo " Compiling" $<
182 $(EXE_GLX): $(OBJ_COMMON) $(OBJ_GLX)
183 # @echo " Linking " $@
186 $(EXE_DED): $(OBJ_COMMON) $(OBJ_DED)
187 # @echo " Linking " $@
191 rm -f $(EXE_GLX) $(EXE_DED) *.o *.d