]> git.xonotic.org Git - xonotic/darkplaces.git/blob - makefile
90ad547dc20958295b807e9b9518300e6592b7f5
[xonotic/darkplaces.git] / makefile
1
2
3 #uncomment these according to your sound driver
4
5 #recommended for: anyone not using ALSA 0.5
6 SND=snd_oss.o snd_dma.o snd_mix.o snd_mem.o
7 SOUNDLIB=
8 #recommended for: anyone using ALSA 0.5
9 #SND=snd_alsa_0_5.o snd_dma.o snd_mix.o snd_mem.o
10 #SOUNDLIB=-lasound
11 #recommended for: no one (this driver needs to be updated, it doesn't compile anymore)
12 #SND=snd_alsa_0_9.o snd_dma.o snd_mix.o snd_mem.o
13 #SOUNDLIB=-lasound
14 #recommended for: anyone who can't use the above drivers
15 #SND=snd_null.o
16 #SOUNDLIB=
17
18
19 #uncomment your preference
20 #if you want CD sound in Linux
21 #CD=cd_linux.o
22 #if you want no CD audio
23 CD=cd_null.o
24
25 CLIENTOBJECTS= cgame.o cgamevm.o chase.o cl_collision.o cl_demo.o cl_input.o cl_light.o cl_main.o cl_parse.o cl_particles.o cl_screen.o cl_tent.o cl_video.o console.o dpvsimpledecode.o fractalnoise.o gl_backend.o gl_draw.o gl_models.o gl_rmain.o gl_rsurf.o gl_textures.o keys.o menu.o meshqueue.o r_crosshairs.o r_explosion.o r_explosion.o r_lerpanim.o r_light.o r_modules.o r_sky.o r_sprites.o sbar.o ui.o vid_shared.o view.o wavefile.o
26 SERVEROBJECTS= pr_cmds.o pr_edict.o pr_exec.o sv_light.o sv_main.o sv_move.o sv_phys.o sv_user.o
27 SHAREDOBJECTS= builddate.o cmd.o collision.o common.o crc.o cvar.o filematch.o host.o host_cmd.o image.o mathlib.o matrixlib.o model_alias.o model_brush.o model_shared.o model_sprite.o net_bsd.o net_dgrm.o net_loop.o net_main.o net_udp.o palette.o portals.o protocol.o quakeio.o sys_linux.o sys_shared.o transform.o world.o wad.o zone.o $(NETOBJECTS) $(SERVEROBJECTS)
28
29
30 #K6/athlon optimizations
31 #CPUOPTIMIZATIONS=-march=k6
32 #note: don't use -march=athlon, every gcc which has it currently (2.96-3.1)
33 #have optimizer bugs (like entities disappearing randomly - a bug with
34 #compiling BOX_ON_PLANE_SIDE in mathlib.h)
35 #CPUOPTIMIZATIONS=-march=athlon
36 #686 optimizations
37 #CPUOPTIMIZATIONS=-march=i686
38 #no specific CPU
39 CPUOPTIMIZATIONS=
40
41 #use this line for profiling
42 PROFILEOPTION=-pg -g
43 #use this line for no profiling
44 #PROFILEOPTION=
45
46 #note:
47 #the -Werror can be removed to compile even if there are warnings,
48 #this is used to ensure that all released versions are free of warnings.
49
50 #normal compile
51 OPTIMIZATIONS= -O6 -fno-strict-aliasing -ffast-math -funroll-loops -fexpensive-optimizations $(CPUOPTIMIZATIONS)
52 CFLAGS= -MD -Wall -Werror $(OPTIMIZATIONS) $(PROFILEOPTION)
53 #debug compile
54 #OPTIMIZATIONS=
55 #CFLAGS= -MD -Wall -Werror -ggdb $(OPTIMIZATIONS) $(PROFILEOPTION)
56
57 LDFLAGS= $(PROFILEOPTION) -lm -ldl
58
59 all: builddate darkplaces-dedicated darkplaces-glx
60
61 builddate:
62         touch builddate.c
63
64 vid_glx.o: vid_glx.c
65         gcc $(CFLAGS) -c vid_glx.c -I/usr/X11R6/include
66
67 .c.o:
68         gcc $(CFLAGS) -c $*.c
69
70 darkplaces-glx:  $(SHAREDOBJECTS) $(CLIENTOBJECTS) $(SERVEROBJECTS) vid_glx.o $(CD) $(SND)
71         gcc -o $@ $^ $(LDFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXxf86dga -lXxf86vm $(SOUNDLIB)
72
73 darkplaces-dedicated: $(SHAREDOBJECTS) $(CLIENTOBJECTS) $(SERVEROBJECTS) vid_null.o cd_null.o snd_null.o
74         gcc -o $@ $^ $(LDFLAGS)
75
76 clean:
77         -rm -f darkplaces-glx darkplaces-dedicated *.o *.d
78
79 .PHONY: clean builddate
80
81 -include *.d
82