]> git.sesse.net Git - vlc/blob - Makefile
. am�lioration de la YUV 8bpp
[vlc] / Makefile
1 ################################################################################
2 # vlc (VideoLAN Client) main makefile
3 # (c)1998 VideoLAN
4 ################################################################################
5 # This makefile is the main makefile for the VideoLAN client.
6 ################################################################################
7
8 ################################################################################
9 # Configuration
10 ################################################################################
11
12 # Environment
13 #CC=gcc
14 #SHELL=/bin/sh
15
16 # Audio output settings
17 AUDIO_DSP=YES
18
19 # Video output settings
20 VIDEO_X11=YES
21 VIDEO_FB=YES
22 #VIDEO_GGI=YES
23 # You probably won't need this one
24 #VIDEO_GLIDE=YES
25 # Not yet supported
26 #VIDEO_BEOS=YES
27 #VIDEO_DGA=YES
28
29 # Target architecture
30 ARCH=X86
31 #ARCH=PPC
32 #ARCH=SPARC
33
34 # Target operating system
35 SYS=LINUX
36 #SYS=BSD
37 #SYS=BEOS
38
39 # For x86 architecture, choose MMX support
40 MMX=YES
41 #MMX=NO
42
43 # Decoder choice - ?? old decoder will be removed soon
44 #DECODER=old
45 DECODER=new
46
47 # Debugging mode on or off (set to 1 to activate)
48 DEBUG=1
49
50 #----------------- do not change anything below this line ----------------------
51
52 ################################################################################
53 # Configuration pre-processing
54 ################################################################################
55
56 # Program version - may only be changed by the project leader
57 PROGRAM_VERSION = 1.0-dev
58
59 # AUDIO_OPTIONS describes all used audio options
60 AUDIO_OPTIONS = dummy
61 aout_method = audio_output/aout_dummy.o
62 ifeq ($(AUDIO_DSP), YES)
63 AUDIO_OPTIONS += dsp
64 DEFINE += -DAUDIO_DSP
65 aout_method += audio_output/aout_dsp.o
66 endif
67
68 # VIDEO_OPTIONS describes all used video options
69 VIDEO_OPTIONS = dummy
70 intf_method = interface/intf_dummy.o
71 vout_method = video_output/vout_dummy.o
72 ifeq ($(VIDEO_GLIDE), YES)
73 VIDEO_OPTIONS += glide
74 DEFINE += -DVIDEO_GLIDE
75 intf_method += interface/intf_glide.o
76 vout_method += video_output/vout_glide.o
77 endif
78 ifeq ($(VIDEO_X11), YES)
79 VIDEO_OPTIONS += x11
80 DEFINE += -DVIDEO_X11
81 intf_method += interface/intf_x11.o
82 vout_method += video_output/vout_x11.o
83 endif
84 ifeq ($(VIDEO_GGI), YES)
85 VIDEO_OPTIONS += ggi
86 DEFINE += -DVIDEO_GGI
87 intf_method += interface/intf_ggi.o
88 vout_method += video_output/vout_ggi.o
89 endif
90 ifeq ($(VIDEO_FB), YES)
91 VIDEO_OPTIONS += fb
92 DEFINE += -DVIDEO_FB
93 intf_method += interface/intf_fb.o
94 vout_method += video_output/vout_fb.o
95 endif
96 ifeq ($(VIDEO_BEOS), YES)
97 VIDEO_OPTIONS += beos
98 DEFINE += -DVIDEO_BEOS
99 intf_method += interface/intf_beos.o
100 vout_method += video_output/vout_beos.o
101 endif
102 ifeq ($(VIDEO_DGA), YES)
103 VIDEO_OPTIONS += dga
104 DEFINE += -DVIDEO_DGA
105 intf_method += interface/intf_dga.o
106 vout_method += video_output/vout_dga.o
107 endif
108
109 # PROGRAM_OPTIONS is an identification string of the compilation options
110 PROGRAM_OPTIONS = $(ARCH) $(SYS)
111 ifeq ($(DEBUG),1)
112 PROGRAM_OPTIONS += DEBUG
113 endif
114
115 # PROGRAM_BUILD is a complete identification of the build
116 PROGRAM_BUILD = `date -R` $(USER)@`hostname`
117
118 # DEFINE will contain some of the constants definitions decided in Makefile, 
119 # including ARCH_xx and SYS_xx. It will be passed to C compiler.
120 DEFINE += -DARCH_$(ARCH)
121 DEFINE += -DSYS_$(SYS)
122 DEFINE += -DAUDIO_OPTIONS="\"$(shell echo $(AUDIO_OPTIONS) | tr 'A-Z' 'a-z')\""
123 DEFINE += -DVIDEO_OPTIONS="\"$(shell echo $(VIDEO_OPTIONS) | tr 'A-Z' 'a-z')\""
124 DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\""
125 DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\""
126 DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
127 ifeq ($(DEBUG),1)
128 DEFINE += -DDEBUG
129 endif
130
131 ################################################################################
132 # Tuning and other variables - do not change anything except if you know
133 # exactly what you are doing
134 ################################################################################
135
136 #
137 # C headers directories
138 #
139 INCLUDE += -Iinclude
140
141 ifeq ($(VIDEO_X11),YES)
142 INCLUDE += -I/usr/X11R6/include
143 endif
144
145 ifeq ($(VIDEO_GLIDE),YES)
146 INCLUDE += -I/usr/include/glide
147 endif
148
149 #
150 # Libraries
151 #
152 LIB += -lpthread
153 LIN += -lm
154
155 ifeq ($(VIDEO_X11),YES)
156 LIB += -L/usr/X11R6/lib
157 LIB += -lX11
158 LIB += -lXext 
159 endif
160 ifeq ($(VIDEO_GGI),YES)
161 LIB += -lggi
162 endif
163 ifeq ($(VIDEO_GLIDE),YES)
164 LIB += -lglide2x
165 endif
166
167 #
168 # C compiler flags: compilation
169 #
170 CCFLAGS += $(DEFINE) $(INCLUDE)
171 CCFLAGS += -Wall
172 CCFLAGS += -D_REENTRANT
173 CCFLAGS += -D_GNU_SOURCE
174
175 # Optimizations : don't compile debug versions with them
176 CCFLAGS += -O6
177 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
178 CCFLAGS += -fomit-frame-pointer
179
180 # Optimizations for x86 familiy
181 ifeq ($(ARCH),X86)
182 CCFLAGS += -malign-double
183 CCFLAGS += -march=pentiumpro
184 #CCFLAGS += -march=pentium
185 endif
186
187 # Optimizations for PowerPC
188 ifeq ($(ARCH),PPC)
189 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
190 endif
191
192 # Optimizations for Sparc
193 ifeq ($(ARCH),SPARC)
194 CCFLAGS += -mhard-float
195 endif
196
197 #
198 # C compiler flags: dependancies
199 #
200 DCFLAGS += $(INCLUDE)
201 DCFLAGS += -MM
202
203 #
204 # C compiler flags: linking
205 #
206 LCFLAGS += $(LIB)
207 LCFLAGS += -Wall
208 #LCFLAGS += -s
209
210 #
211 # C compiler flags: common flags
212 #
213
214 # Eventual MMX optimizations for x86
215 ifeq ($(ARCH),X86)
216 ifeq ($(MMX), YES) # MMX is YES or AUTO
217 CFLAGS += -DHAVE_MMX
218 endif
219 endif
220
221 #
222 # Additionnal debugging flags
223 #
224
225 # Debugging support
226 ifeq ($(DEBUG),1)
227 CFLAGS += -g
228 #CFLAGS += -pg
229 endif
230
231 #################################################################################
232 # Objects and files
233 #################################################################################
234
235 #
236 # C Objects
237
238 interface_obj =                 interface/main.o \
239                                                 interface/interface.o \
240                                                 interface/intf_msg.o \
241                                                 interface/intf_cmd.o \
242                                                 interface/intf_ctrl.o \
243                                                 interface/control.o \
244                                                 interface/intf_console.o \
245                                                 $(intf_method)
246
247 input_obj =                     input/input_vlan.o \
248                                                 input/input_file.o \
249                                                 input/input_netlist.o \
250                                                 input/input_network.o \
251                                                 input/input_ctrl.o \
252                                                 input/input_pcr.o \
253                                                 input/input_psi.o \
254                                                 input/input.o
255
256 audio_output_obj =              audio_output/audio_output.o \
257                                                 audio_output/audio_dsp.o
258
259 video_output_obj =              video_output/video_output.o \
260                                                 video_output/video_text.o \
261                                                 video_output/video_yuv.o \
262                                                 $(vout_method)
263
264 ac3_decoder_obj =               ac3_decoder/ac3_decoder.o \
265                                                 ac3_decoder/ac3_parse.o \
266                                                 ac3_decoder/ac3_exponent.o \
267                                                 ac3_decoder/ac3_bit_allocate.o \
268                                                 ac3_decoder/ac3_mantissa.o \
269                                                 ac3_decoder/ac3_rematrix.o \
270                                                 ac3_decoder/ac3_imdct.o \
271                                                 ac3_decoder/ac3_downmix.o
272
273 audio_decoder_obj =             audio_decoder/audio_decoder.o \
274                                                 audio_decoder/audio_math.o
275
276 spu_decoder_obj =               spu_decoder/spu_decoder.o
277
278 #??generic_decoder_obj =                generic_decoder/generic_decoder.o
279 # remeber to add it to OBJ 
280
281 ifeq ($(DECODER),old)
282 CFLAGS += -DOLD_DECODER
283 video_decoder_obj =             video_decoder_ref/video_decoder.o \
284                                                 video_decoder_ref/display.o \
285                                                 video_decoder_ref/getblk.o \
286                                                 video_decoder_ref/gethdr.o \
287                                                 video_decoder_ref/getpic.o \
288                                                 video_decoder_ref/getvlc.o \
289                                                 video_decoder_ref/idct.o \
290                                                 video_decoder_ref/motion.o \
291                                                 video_decoder_ref/mpeg2dec.o \
292                                                 video_decoder_ref/recon.o \
293                                                 video_decoder_ref/spatscal.o
294 else
295 video_parser_obj =              video_parser/video_parser.o \
296                                                 video_parser/vpar_headers.o \
297                                                 video_parser/vpar_blocks.o \
298                                                 video_parser/vpar_synchro.o \
299                                                 video_parser/video_fifo.o
300
301 video_decoder_obj =             video_decoder/video_decoder.o \
302                                                 video_decoder/vdec_motion.o \
303                                                 video_decoder/vdec_idct.o
304 endif
305
306 misc_obj =                      misc/mtime.o \
307                                                 misc/rsc_files.o \
308                                                 misc/netutils.o
309
310 C_OBJ = $(interface_obj) \
311                 $(input_obj) \
312                 $(audio_output_obj) \
313                 $(video_output_obj) \
314                 $(ac3_decoder_obj) \
315                 $(audio_decoder_obj) \
316                 $(spu_decoder_obj) \
317                 $(generic_decoder_obj) \
318                 $(video_parser_obj) \
319                 $(video_decoder_obj) \
320                 $(vlan_obj) \
321                 $(misc_obj)
322
323 #
324 # Assembler Objects
325
326 ifeq ($(ARCH),X86)
327 ifeq ($(MMX), YES)
328 ifeq ($(DECODER),new)
329 ASM_OBJ =                       video_decoder/idctmmx.o \
330                                                 video_output/video_yuv_mmx.o
331 else
332 ASM_OBJ =                       video_decoder_ref/idctmmx.o \
333                                                 video_output/video_yuv_mmx.o
334 endif
335 endif
336 endif
337
338 #
339 # Other lists of files
340 #
341 sources := $(C_OBJ:%.o=%.c)
342 dependancies := $(sources:%.c=dep/%.d)
343
344 # All symbols must be exported
345 export
346
347 ################################################################################
348 # Targets
349 ################################################################################
350
351 #
352 # Virtual targets
353 #
354 all: vlc
355
356 clean:
357         rm -f $(C_OBJ) $(ASM_OBJ)
358
359 distclean: clean
360         rm -f **/*.o **/*~ *.log
361         rm -f vlc gmon.out core
362         rm -rf dep
363
364 show:
365         @echo "Command line for C objects:"
366         @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
367         @echo
368         @echo "Command line for assembler objects:"
369         @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
370
371 FORCE:
372
373 #
374 # Real targets
375 #
376 vlc: $(C_OBJ) $(ASM_OBJ)
377         $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)    
378
379 #
380 # Generic rules (see below)
381 #
382 $(dependancies): %.d: FORCE
383         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
384
385 $(C_OBJ): %.o: Makefile Makefile.dep
386 $(C_OBJ): %.o: dep/%.d
387 $(C_OBJ): %.o: %.c
388         @echo "compiling $*.c"
389         @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
390
391 $(ASM_OBJ): %.o: Makefile Makefile.dep
392 $(ASM_OBJ): %.o: %.S
393         @echo "assembling $*.S"
394         @$(CC) $(CFLAGS) -c -o $@ $<
395
396 ################################################################################
397 # Note on generic rules and dependancies
398 ################################################################################
399
400 # Note on dependancies: each .c file is associated with a .d file, which
401 # depends of it. The .o file associated with a .c file depends of the .d, of the 
402 # .c itself, and of Makefile. The .d files are stored in a separate dep/ 
403 # directory.
404 # The dep directory should be ignored by CVS.
405
406 # Note on inclusions: depending of the target, the dependancies files must 
407 # or must not be included. The problem is that if we ask make to include a file,
408 # and this file does not exist, it is made before it can be included. In a 
409 # general way, a .d file should be included if and only if the corresponding .o 
410 # needs to be re-made.
411
412 # Two makefiles are used: the main one (this one) has regular generic rules,
413 # except for .o files, for which it calls the object Makefile. Dependancies
414 # are not included in this file.
415 # The object Makefile known how to make a .o from a .c, and includes
416 # dependancies for the target, but only those required.