added CVAR_SAVE and CVAR_NOTIFY flags to cvar_t structure (at the beginning), updated...
[divverent/darkplaces.git] / makefile
1 #uncomment one of these according to your sound driver
2 #if you use ALSA version 0.9.x
3 #SND=snd_alsa_0_9.o
4 #SOUNDLIB=-lasound
5 #if you use ALSA version 0.5.x
6 SND=snd_alsa_0_5.o
7 SOUNDLIB=-lasound
8 #if you use the kernel sound driver or OSS
9 #SND=snd_oss.o
10 #SOUNDLIB=
11
12 OBJECTS= buildnumber.o cd_linux.o chase.o cl_demo.o cl_input.o cl_main.o cl_parse.o cl_tent.o cmd.o common.o console.o crc.o cvar.o fractalnoise.o gl_draw.o gl_poly.o gl_rmain.o gl_rmisc.o gl_rsurf.o gl_screen.o gl_warp.o host.o host_cmd.o image.o keys.o mathlib.o menu.o model_alias.o model_brush.o model_shared.o model_sprite.o net_bsd.o net_udp.o net_dgrm.o net_loop.o net_main.o pr_cmds.o pr_edict.o pr_exec.o r_light.o r_part.o r_explosion.o sbar.o snd_dma.o snd_mem.o snd_mix.o $(SND) sv_main.o sv_move.o sv_phys.o sv_user.o sv_light.o sys_linux.o transform.o view.o wad.o world.o zone.o vid_shared.o palette.o r_crosshairs.o gl_textures.o gl_models.o r_sprites.o r_modules.o r_explosion.o r_lerpanim.o cl_effects.o r_decals.o protocol.o quakeio.o r_clip.o ui.o portals.o
13
14 #K6/athlon optimizations
15 CPUOPTIMIZATIONS=-march=k6
16 #686 optimizations
17 #CPUOPTIMIZATIONS=-march=686
18
19 #use this line for profiling
20 PROFILEOPTION=-pg -g
21 NOPROFILEOPTIMIZATIONS=
22 #use this line for no profiling
23 #PROFILEOPTION=
24 #NOPROFILEOPTIMIZATIONS=-fomit-frame-pointer
25
26 #note:
27 #the -Werror can be removed to compile even if there are warnings,
28 #this is used to ensure that all released versions are free of warnings.
29
30 #normal compile
31 OPTIMIZATIONS= -O6 -ffast-math -funroll-loops $(NOPROFILEOPTIMIZATIONS) -fexpensive-optimizations $(CPUOPTIMIZATIONS)
32 CFLAGS= -MD -Wall -Werror -I/usr/X11R6/include -I/usr/include/glide $(OPTIMIZATIONS) $(PROFILEOPTION)
33 #debug compile
34 #OPTIMIZATIONS= -O -g
35 #CFLAGS= -MD -Wall -Werror -I/usr/X11R6/include -ggdb $(OPTIMIZATIONS) $(PROFILEOPTION)
36
37 LDFLAGS= -L/usr/X11R6/lib -lm -lX11 -lXext -lXIE -lXxf86dga -lXxf86vm -lGL -ldl $(SOUNDLIB) -lz $(PROFILEOPTION)
38
39 #most people can't build the -3dfx version (-3dfx version needs some updates for new mesa)
40 all: darkplaces-glx
41 #all: darkplaces-glx darkplaces-3dfx
42
43 .c.o:
44         gcc $(CFLAGS) -c $*.c
45
46 darkplaces-glx: $(OBJECTS) vid_glx.o
47         gcc -o $@ $^ $(LDFLAGS)
48
49 darkplaces-3dfx: $(OBJECTS) in_svgalib.o vid_3dfxsvga.o
50         gcc -o $@ $^ $(LDFLAGS)
51
52
53 clean:
54         -rm -f darkplaces-glx darkplaces-3dfx
55         -rm -f vid_glx.o in_svgalib.o vid_3dfxsvga.o $(OBJECTS) *.d
56
57 .PHONY: clean
58
59 -include *.d