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