]> git.sesse.net Git - vlc/blob - Makefile.in
. correction d'un bug dans les sous-titres pour un scaling > 1
[vlc] / Makefile.in
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 # Audio output settings
13 AOUT += dsp
14 #AOUT += esd
15 # Not yet supported
16 #AOUT += alsa
17 # Fallback method that should always work
18 AOUT += dummy
19
20 # Video output settings
21 VOUT += x11
22 #VOUT += fb
23 #VOUT += ggi
24 #VOUT += glide
25 #VOUT += gnome
26 # Not yet supported
27 #VOUT += mga
28 #VOUT += beos
29 #VOUT += dga
30 # Fallback method that should always work
31 VOUT += dummy
32
33 # Interface settings
34 INTF += x11
35 #INTF += fb
36 #INTF += ggi
37 #INTF += glide
38 #INTF += gnome
39 # Not yet supported
40 #INTF += mga
41 #INTF += beos
42 #INTF += dga
43 # Fallback method that should always work
44 INTF += dummy
45
46 # Target architecture
47 ARCH=X86
48 #ARCH=PPC
49 #ARCH=SPARC
50
51 # Target operating system
52 SYS=LINUX
53 #SYS=GNU
54 #SYS=BSD
55 #SYS=BEOS
56
57 # For x86 architecture, choose MMX support
58 ARCH += MMX
59 # For x86 architecture, optimize for Pentium Pro
60 # (choose NO if you get `Invalid instruction' errors)
61 ARCH += PPRO
62
63 # Decoder choice - ?? old decoder will be removed soon
64 #DECODER=old
65 DECODER=new
66
67 # Debugging mode on or off (set to 1 to activate)
68 DEBUG=0
69
70 #----------------- do not change anything below this line ----------------------
71
72 prefix=@prefix@
73 INSTALL=@INSTALL@
74
75 ################################################################################
76 # Configuration pre-processing
77 ################################################################################
78
79 SNAPSHOTDIR=vlc-@VLC_VERSION@
80
81 # PROGRAM_OPTIONS is an identification string of the compilation options
82 PROGRAM_OPTIONS = $(SYS) $(ARCH)
83 ifeq ($(DEBUG),1)
84 PROGRAM_OPTIONS += DEBUG
85 endif
86
87 # PROGRAM_BUILD is a complete identification of the build
88 # ( we can't use fancy options with date since OSes like Solaris
89 # or FreeBSD have strange date implementations )
90 PROGRAM_BUILD = `date` $(USER)
91 # XXX: beos does not support hostname
92 #PROGRAM_BUILD = `date` $(USER)@`hostname`
93
94 # DEFINE will contain some of the constants definitions decided in Makefile, 
95 # including ARCH_xx and SYS_xx. It will be passed to C compiler.
96 DEFINE += -DARCH_$(shell echo $(ARCH) | cut -f1 -d' ')
97 DEFINE += -DSYS_$(SYS)
98 DEFINE += -DPLUGIN_PATH="\"$(prefix)/lib/videolan/vlc\""
99 DEFINE += -DDATA_PATH="\"$(prefix)/share/videolan/vlc\""
100 #DEFINE += -DPROGRAM_OPTIONS="\"$(shell echo $(PROGRAM_OPTIONS) | tr 'A-Z' 'a-z')\""
101 #DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
102 ifeq ($(DEBUG),1)
103 DEFINE += -DDEBUG
104 endif
105
106 ################################################################################
107 # Tuning and other variables - do not change anything except if you know
108 # exactly what you are doing
109 ################################################################################
110
111 #
112 # C headers directories
113 #
114 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
115
116 #
117 # Libraries
118 #
119
120 ifeq ($(SYS),GNU)
121 LIB += -lthreads -ldl
122 endif
123
124 ifeq ($(SYS),BSD)
125 LIB += -pthread -lgnugetopt
126 LIB += -L/usr/local/lib
127 endif
128
129 ifeq ($(SYS),LINUX)
130 LIB += -lpthread -ldl
131 endif
132
133 ifeq ($(SYS),BEOS)
134 LIB += -lbe -lroot -lgame
135 else
136 LIB += -lm
137 endif
138
139 #
140 # C compiler flags: compilation
141 #
142 CCFLAGS += $(DEFINE) $(INCLUDE)
143 CCFLAGS += -Wall
144 CCFLAGS += -D_REENTRANT
145 CCFLAGS += -D_GNU_SOURCE
146
147 # flags needed for clean beos compilation
148 CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
149
150 # Optimizations : don't compile debug versions with them
151 CCFLAGS += -O6
152 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
153 CCFLAGS += -fomit-frame-pointer
154
155 # Optimizations for x86 familiy
156 ifneq (,$(findstring X86,$(ARCH)))
157 CCFLAGS += -malign-double
158 #CCFLAGS += -march=pentium
159 # Eventual Pentium Pro optimizations
160 ifneq (,$(findstring PPRO,$(ARCH)))
161 ifneq ($(SYS), BSD)
162 CCFLAGS += -march=pentiumpro
163 endif
164 endif
165 # Eventual MMX optimizations for x86
166 ifneq (,$(findstring MMX,$(ARCH)))
167 CFLAGS += -DHAVE_MMX
168 endif
169 endif
170
171 # Optimizations for PowerPC
172 ifneq (,$(findstring PPC,$(ARCH)))
173 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
174 endif
175
176 # Optimizations for Sparc
177 ifneq (,$(findstring SPARC,$(ARCH)))
178 CCFLAGS += -mhard-float
179 endif
180
181 #
182 # C compiler flags: dependancies
183 #
184 DCFLAGS += $(INCLUDE)
185 DCFLAGS += -MM
186
187 #
188 # C compiler flags: linking
189 #
190 LCFLAGS += $(LIB)
191 LCFLAGS += -Wall
192 #LCFLAGS += -s
193
194 #
195 # Additionnal debugging flags
196 #
197
198 # Debugging support
199 ifeq ($(DEBUG),1)
200 CFLAGS += -g
201 CFLAGS += -pg
202 endif
203
204 #################################################################################
205 # Objects and files
206 #################################################################################
207
208 #
209 # C Objects
210
211 interface_obj =                 interface/main.o \
212                                                 interface/interface.o \
213                                                 interface/intf_msg.o \
214                                                 interface/intf_cmd.o \
215                                                 interface/intf_ctrl.o \
216                                                 interface/intf_console.o
217
218 input_obj =                     input/input_vlan.o \
219                                                 input/input_file.o \
220                                                 input/input_netlist.o \
221                                                 input/input_network.o \
222                                                 input/input_ctrl.o \
223                                                 input/input_pcr.o \
224                                                 input/input_psi.o \
225                                                 input/input.o
226
227 audio_output_obj =              audio_output/audio_output.o
228
229 video_output_obj =              video_output/video_output.o \
230                                                 video_output/video_text.o \
231                                                 video_output/video_spu.o \
232                                                 video_output/video_yuv.o
233
234 ac3_decoder_obj =               ac3_decoder/ac3_decoder_thread.o \
235                                                 ac3_decoder/ac3_decoder.o \
236                                                 ac3_decoder/ac3_parse.o \
237                                                 ac3_decoder/ac3_exponent.o \
238                                                 ac3_decoder/ac3_bit_allocate.o \
239                                                 ac3_decoder/ac3_mantissa.o \
240                                                 ac3_decoder/ac3_rematrix.o \
241                                                 ac3_decoder/ac3_imdct.o \
242                                                 ac3_decoder/ac3_downmix.o
243                                                 
244 lpcm_decoder_obj =              lpcm_decoder/lpcm_decoder_thread.o \
245                                                 lpcm_decoder/lpcm_decoder.o
246
247 audio_decoder_obj =             audio_decoder/audio_decoder_thread.o \
248                                                 audio_decoder/audio_decoder.o \
249                                                 audio_decoder/audio_math.o
250
251 spu_decoder_obj =               spu_decoder/spu_decoder.o
252
253 #??generic_decoder_obj =                generic_decoder/generic_decoder.o
254 # remeber to add it to OBJ 
255
256 ifeq ($(DECODER),old)
257 CFLAGS += -DOLD_DECODER
258 video_decoder_obj =             video_decoder_ref/video_decoder.o \
259                                                 video_decoder_ref/display.o \
260                                                 video_decoder_ref/getblk.o \
261                                                 video_decoder_ref/gethdr.o \
262                                                 video_decoder_ref/getpic.o \
263                                                 video_decoder_ref/getvlc.o \
264                                                 video_decoder_ref/idct.o \
265                                                 video_decoder_ref/motion.o \
266                                                 video_decoder_ref/mpeg2dec.o \
267                                                 video_decoder_ref/recon.o \
268                                                 video_decoder_ref/spatscal.o
269 else
270 video_parser_obj =              video_parser/video_parser.o \
271                                                 video_parser/vpar_headers.o \
272                                                 video_parser/vpar_blocks.o \
273                                                 video_parser/vpar_synchro.o \
274                                                 video_parser/video_fifo.o
275
276 video_decoder_obj =             video_decoder/video_decoder.o \
277                                                 video_decoder/vdec_motion.o \
278                                                 video_decoder/vdec_motion_inner.o \
279                                                 video_decoder/vdec_idct.o
280 endif
281
282 misc_obj =                      misc/mtime.o \
283                                                 misc/rsc_files.o \
284                                                 misc/netutils.o \
285                                                 misc/plugins.o \
286                                                 misc/decoder_fifo.o
287
288
289 C_OBJ = $(interface_obj) \
290                 $(input_obj) \
291                 $(audio_output_obj) \
292                 $(video_output_obj) \
293                 $(ac3_decoder_obj) \
294                 $(lpcm_decoder_obj) \
295                 $(audio_decoder_obj) \
296                 $(spu_decoder_obj) \
297                 $(generic_decoder_obj) \
298                 $(video_parser_obj) \
299                 $(video_decoder_obj) \
300                 $(vlan_obj) \
301                 $(misc_obj)
302
303 ifeq ($(SYS), BEOS)
304 CPP_OBJ =                       misc/beos_specific.o
305 endif
306
307 #
308 # Assembler Objects
309
310 ifneq (,$(findstring X86,$(ARCH)))
311 ifneq (,$(findstring MMX,$(ARCH)))
312 ifeq ($(DECODER),new)
313 ASM_OBJ =                       video_decoder/vdec_idctmmx.o \
314                                                 video_output/video_yuv_mmx.o
315 else
316 ASM_OBJ =                       video_decoder_ref/vdec_idctmmx.o \
317                                                 video_output/video_yuv_mmx.o
318 endif
319 endif
320 endif
321
322 #
323 # Plugins
324 #
325 intf_plugin =           $(INTF:%=plugins/intf/intf_%.so)
326 aout_plugin =           $(AOUT:%=plugins/aout/aout_%.so)
327 vout_plugin =           $(VOUT:%=plugins/vout/vout_%.so)
328
329 PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
330
331 #
332 # Other lists of files
333 #
334 C_OBJ := $(C_OBJ:%.o=src/%.o)
335 CPP_OBJ := $(CPP_OBJ:%.o=src/%.o)
336 ASM_OBJ := $(ASM_OBJ:%.o=src/%.o)
337 sources_c := $(C_OBJ:%.o=%.c)
338 dependancies := $(sources_c:%.c=.dep/%.d)
339
340 # All symbols must be exported
341 export
342
343 ################################################################################
344 # Targets
345 ################################################################################
346
347 #
348 # Virtual targets
349 #
350 all: vlc plugins
351
352 clean:
353         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
354
355 distclean: clean
356         rm -f **/*.o **/*.so **/*~ *.log
357         rm -f Makefile include/defs.h config.cache config.log
358         rm -f vlc gmon.out core
359         rm -rf .dep
360
361 install:
362         $(INSTALL) vlc $(prefix)/bin
363         mkdir -p $(prefix)/lib/videolan/vlc
364         $(INSTALL) $(PLUGIN_OBJ) $(prefix)/lib/videolan/vlc
365         $(INSTALL) share/*.psf $(prefix)/share/videolan/vlc
366         $(INSTALL) share/*.png $(prefix)/share/videolan/vlc
367
368 show:
369         @echo "Command line for C objects:"
370         @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
371         @echo
372         @echo "Command line for assembler objects:"
373         @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
374
375 # ugliest of all, but I have no time to do it -- sam
376 snapshot:
377         rm -rf /tmp/${SNAPSHOTDIR}
378         mkdir /tmp/${SNAPSHOTDIR}
379         cp -a * /tmp/${SNAPSHOTDIR}
380                 (cd /tmp/${SNAPSHOTDIR} ; \
381                 make distclean ; \
382                 find . -type d -name CVS | xargs rm -rf ; \
383                 find . -type f -name '.*.swp' | xargs rm -f ; \
384                 cd .. ; \
385                 tar czvf ${SNAPSHOTDIR}.tar.gz ${SNAPSHOTDIR} )
386         rm -rf /tmp/${SNAPSHOTDIR}
387         mv /tmp/${SNAPSHOTDIR}.tar.gz ..
388         @echo "Sources are in ../${SNAPSHOTDIR}.tar.gz"
389
390 FORCE:
391
392 #
393 # Real targets
394 #
395 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
396 ifeq ($(SYS), BEOS)
397         $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
398 #       ln -s ../vlc ./plugins/_APP_
399 else
400         $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)   
401 endif
402
403 plugins: $(PLUGIN_OBJ)
404
405 #
406 # Generic rules (see below)
407 #
408 $(dependancies): %.d: FORCE
409         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
410
411 $(C_OBJ): %.o: Makefile.dep
412 $(C_OBJ): %.o: .dep/%.d
413 $(C_OBJ): %.o: %.c
414         @echo "compiling $*.o from $*.c"
415         @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
416
417 $(CPP_OBJ): %.o: %.cpp
418         @echo "compiling $*.o from $*.cpp"
419         @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
420
421 $(ASM_OBJ): %.o: Makefile.dep
422 $(ASM_OBJ): %.o: %.S
423         @echo "assembling $*.o from $*.S"
424         @$(CC) $(CFLAGS) -c -o $@ $<
425
426 #$(PLUGIN_OBJ): %.so: Makefile.dep
427 #$(PLUGIN_OBJ): %.so: .dep/%.d
428
429 # audio plugins
430 plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
431                 @echo "compiling $*.so from $*.c"
432 ifeq ($(SYS), BEOS)
433                 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
434 else
435                 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
436 endif
437
438 plugins/aout/aout_esd.so: %.so: %.c
439                 @echo "compiling $*.so from $*.c"
440 ifeq ($(SYS), BSD)
441                 @$(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
442 else
443                 @$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
444 endif
445
446 # video plugins
447 plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
448         plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
449                 @echo "compiling $*.so from $*.c"
450 ifeq ($(SYS), BEOS)
451                 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
452 else
453                 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
454 endif
455
456 plugins/intf/intf_x11.so plugins/vout/vout_x11.so: %.so: %.c
457                 @echo "compiling $*.so from $*.c"
458                 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
459
460 plugins/intf/intf_mga.so plugins/vout/vout_mga.so: %.so: %.c
461                 @echo "compiling $*.so from $*.c"
462                 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
463
464 plugins/intf/intf_gnome.so: %.so: %.c
465                 @echo "compiling $*.so from $*.c"
466                 @$(CC) $(CCFLAGS) $(CFLAGS) $(LCFLAGS) `gnome-config --libs --cflags gnomeui` -shared -o $@ $< plugins/intf/intf_gnome_callbacks.c plugins/intf/intf_gnome_interface.c plugins/intf/intf_gnome_support.c
467
468 plugins/vout/vout_gnome.so: %.so: %.c
469                 @echo "compiling $*.so from $*.c"
470                 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
471
472 plugins/intf/intf_glide.so plugins/vout/vout_glide.so: %.so: %.c
473                 @echo "compiling $*.so from $*.c"
474                 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
475
476 plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
477                 @echo "compiling $*.so from $*.c"
478                 @$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
479
480 plugins/intf/intf_beos.so: %.so: %.cpp
481                 @echo "compiling $*.so from $*.cpp"
482                 @$(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
483
484 plugins/vout/vout_beos.so: %.so: %.cpp
485                 @echo "compiling $*.so from $*.cpp"
486                 @$(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
487                 
488
489 ################################################################################
490 # Note on generic rules and dependancies
491 ################################################################################
492
493 # Note on dependancies: each .c file is associated with a .d file, which
494 # depends of it. The .o file associated with a .c file depends of the .d, of the
495 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
496 # directory.
497 # The dep directory should be ignored by CVS.
498
499 # Note on inclusions: depending of the target, the dependancies files must
500 # or must not be included. The problem is that if we ask make to include a file,
501 # and this file does not exist, it is made before it can be included. In a
502 # general way, a .d file should be included if and only if the corresponding .o
503 # needs to be re-made.
504
505 # Two makefiles are used: the main one (this one) has regular generic rules,
506 # except for .o files, for which it calls the object Makefile. Dependancies
507 # are not included in this file.
508 # The object Makefile known how to make a .o from a .c, and includes
509 # dependancies for the target, but only those required.