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