]> git.sesse.net Git - vlc/blob - Makefile.in
* Placed a callback to the decoder in the bitstream structure ;
[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 # Debugging mode on or off (set to 1 to activate)
13 DEBUG=@DEBUG@
14 STATS=@STATS@
15 OPTIMS=@OPTIMS@
16
17 SYS=@SYS@
18 PLUGINS=@PLUGINS@
19 SNAPSHOTDIR=vlc-@VLC_VERSION@
20 INSTALL=@INSTALL@
21 ARCH=@ARCH@
22 prefix=@prefix@
23 CC=@CC@
24 SHELL=@SHELL@
25
26 LIB_SDL=@LIB_SDL@
27 LIB_GLIDE=@LIB_GLIDE@
28 LIB_GGI=@LIB_GGI@
29
30 #----------------- do not change anything below this line ----------------------
31
32 ################################################################################
33 # Configuration pre-processing
34 ################################################################################
35
36 # PROGRAM_OPTIONS is an identification string of the compilation options
37 PROGRAM_OPTIONS = $(SYS) $(ARCH)
38 ifeq ($(DEBUG),1)
39 PROGRAM_OPTIONS += DEBUG
40 DEFINE += -DDEBUG
41 endif
42 ifeq ($(STATS),1)
43 PROGRAM_OPTIONS += DEBUG
44 DEFINE += -DSTATS
45 endif
46
47 # PROGRAM_BUILD is a complete identification of the build
48 # ( we can't use fancy options with date since OSes like Solaris
49 # or FreeBSD have strange date implementations )
50 PROGRAM_BUILD = `date` $(USER)
51 # XXX: beos does not support hostname
52 #PROGRAM_BUILD = `date` $(USER)@`hostname`
53
54 # DEFINE will contain some of the constants definitions decided in Makefile, 
55 # including SYS_xx. It will be passed to C compiler.
56 DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z. A-Z_)
57
58 ################################################################################
59 # Tuning and other variables - do not change anything except if you know
60 # exactly what you are doing
61 ################################################################################
62
63 #
64 # C headers directories
65 #
66 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
67
68 #
69 # Libraries
70 #
71 ifeq ($(SYS),gnu)
72 LIB += -lthreads -ldl
73 endif
74
75 ifneq (,$(findstring bsd,$(SYS)))
76 LIB += -pthread -lgnugetopt
77 LIB += -L/usr/local/lib
78 endif
79
80 ifneq (,$(findstring linux,$(SYS)))
81 LIB += -lpthread -ldl
82 endif
83
84 ifneq (,$(findstring solaris,$(SYS)))
85 LIB += -ldl -lsocket -lnsl -lpthread
86 endif
87
88 ifeq ($(SYS),beos)
89 LIB += -lbe -lroot -lgame
90 else
91 LIB += -lm
92 endif
93
94 #
95 # C compiler flags: mainstream compilation
96 #
97 CFLAGS += $(DEFINE) $(INCLUDE)
98 CFLAGS += -Wall -Winline
99 CFLAGS += -D_REENTRANT
100 CFLAGS += -D_GNU_SOURCE
101
102 # flags needed for clean beos compilation
103 ifeq ($(SYS),beos)
104 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
105 endif
106
107 # Optimizations : don't compile debug versions with them
108 ifeq ($(OPTIMS),1)
109 CFLAGS += -O6
110 CFLAGS += -ffast-math -funroll-loops -funroll-all-loops
111 CFLAGS += -fomit-frame-pointer
112 CFLAGS += @BIZARRE_OPTIMS@
113
114 # Optimizations for x86 familiy
115 ifneq (,$(findstring 86,$(ARCH)))
116 CFLAGS += -malign-double
117 # Optional Pentium Pro optimizations
118 ifneq (,$(findstring ppro,$(ARCH)))
119 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
120 else
121 CFLAGS += -march=pentium -mcpu=pentium
122 endif
123 endif
124
125 # Optimizations for PowerPC
126 ifneq (,$(findstring powerpc,$(ARCH)))
127 # 604e
128 CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
129 # G3
130 #CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
131 # G4
132 #CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
133 endif
134
135 # Optimizations for Sparc
136 ifneq (,$(findstring sparc,$(ARCH)))
137 CFLAGS += -mhard-float
138 endif
139
140 #end of optimisations
141 endif
142
143 # Optional MMX optimizations for x86
144 ifneq (,$(findstring mmx,$(ARCH)))
145 CFLAGS += -DHAVE_MMX
146 endif
147
148 #
149 # C compiler flags: plugin compilation
150 #
151 PCFLAGS += -fPIC
152
153 #
154 # C compiler flags: dependancies
155 #
156 DCFLAGS += $(INCLUDE)
157 DCFLAGS += -MM
158
159 #
160 # C compiler flags: linking
161 #
162 LCFLAGS += $(LIB)
163 LCFLAGS += -Wall
164 #LCFLAGS += -s
165
166 #
167 # Debugging and profiling support (unless optimisations are active)
168 #
169 ifneq ($(OPTIMS),1)
170 CFLAGS += -g
171 endif
172
173 #################################################################################
174 # Objects and files
175 #################################################################################
176
177 #
178 # C Objects
179
180 INTERFACE =     src/interface/main.o \
181                 src/interface/interface.o \
182                 src/interface/intf_msg.o \
183                 src/interface/intf_cmd.o \
184                 src/interface/intf_ctrl.o \
185                 src/interface/intf_console.o
186
187 INPUT =         src/input/input_ps.o \
188                 src/input/input_ts.o \
189                 src/input/mpeg_system.o \
190                 src/input/input_ext-dec.o \
191                 src/input/input_dec.o \
192                 src/input/input_programs.o \
193                 src/input/input_netlist.o \
194                 src/input/input.o
195
196 AUDIO_OUTPUT =  src/audio_output/audio_output.o
197
198 VIDEO_OUTPUT =  src/video_output/video_output.o \
199                 src/video_output/video_text.o \
200                 src/video_output/video_spu.o \
201                 src/video_output/video_yuv.o
202
203 AC3_DECODER =   src/ac3_decoder/ac3_decoder_thread.o \
204                 src/ac3_decoder/ac3_decoder.o \
205                 src/ac3_decoder/ac3_parse.o \
206                 src/ac3_decoder/ac3_exponent.o \
207                 src/ac3_decoder/ac3_bit_allocate.o \
208                 src/ac3_decoder/ac3_mantissa.o \
209                 src/ac3_decoder/ac3_rematrix.o \
210                 src/ac3_decoder/ac3_imdct.o \
211                 src/ac3_decoder/ac3_downmix.o
212
213 LPCM_DECODER =  src/lpcm_decoder/lpcm_decoder_thread.o \
214                 src/lpcm_decoder/lpcm_decoder.o
215
216 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
217                 src/audio_decoder/adec_generic.o \
218                 src/audio_decoder/adec_layer1.o \
219                 src/audio_decoder/adec_layer2.o \
220                 src/audio_decoder/adec_math.o
221
222 SPU_DECODER =   src/spu_decoder/spu_decoder.o
223
224 #GEN_DECODER =  src/generic_decoder/generic_decoder.o
225
226
227 VIDEO_PARSER =  src/video_parser/video_parser.o \
228                 src/video_parser/vpar_headers.o \
229                 src/video_parser/vpar_blocks.o \
230                 src/video_parser/vpar_synchro.o \
231                 src/video_parser/video_fifo.o
232
233 ifneq (,$(findstring mmx,$(ARCH)))
234         vdec_motion_inner = src/video_decoder/vdec_motion_inner_mmx.o
235 else
236         vdec_motion_inner = src/video_decoder/vdec_motion_inner.o
237 endif
238
239 VIDEO_DECODER = src/video_decoder/video_decoder.o \
240                 src/video_decoder/vdec_motion.o \
241                 src/video_decoder/vdec_idct.o \
242                 $(vdec_motion_inner)
243
244 MISC =          src/misc/mtime.o \
245                 src/misc/tests.o \
246                 src/misc/rsc_files.o \
247                 src/misc/modules.o \
248                 src/misc/netutils.o \
249                 src/misc/playlist.o \
250                 src/misc/plugins.o
251
252
253 C_OBJ =         $(INTERFACE) \
254                 $(INPUT) \
255                 $(VIDEO_OUTPUT) \
256                 $(AUDIO_OUTPUT) \
257                 $(AC3_DECODER) \
258                 $(LPCM_DECODER) \
259                 $(AUDIO_DECODER) \
260                 $(SPU_DECODER) \
261                 $(GEN_DECODER) \
262                 $(VIDEO_PARSER) \
263                 $(VIDEO_DECODER) \
264                 $(MISC)
265
266
267 #
268 # CPP Objects
269
270 ifeq ($(SYS),beos)
271 CPP_OBJ =       src/misc/beos_specific.o
272 endif
273
274 #
275 # Assembler Objects
276
277 ifneq (,$(findstring 86,$(ARCH)))
278 ifneq (,$(findstring mmx,$(ARCH)))
279 ASM_OBJ =       src/video_decoder/vdec_idctmmx.o \
280                 src/video_output/video_yuv_mmx.o
281 endif
282 endif
283
284 #
285 # Plugins
286 #
287 PLUGIN_BEOS =   plugins/beos/beos.o \
288                 plugins/beos/aout_beos.o \
289                 plugins/beos/intf_beos.o \
290                 plugins/beos/vout_beos.o
291
292 PLUGIN_DSP =    plugins/dsp/dsp.o \
293                 plugins/dsp/aout_dsp.o \
294
295 PLUGIN_DUMMY =  plugins/dummy/dummy.o \
296                 plugins/dummy/aout_dummy.o \
297                 plugins/dummy/intf_dummy.o \
298                 plugins/dummy/vout_dummy.o
299
300 PLUGIN_ESD =    plugins/esd/esd.o \
301                 plugins/esd/aout_esd.o
302
303 PLUGIN_FB =     plugins/fb/fb.o \
304                 plugins/fb/intf_fb.o \
305                 plugins/fb/vout_fb.o
306
307 PLUGIN_GGI =    plugins/ggi/ggi.o \
308                 plugins/ggi/intf_ggi.o \
309                 plugins/ggi/vout_ggi.o
310
311 PLUGIN_SDL =    plugins/sdl/sdl.o \
312                 plugins/sdl/intf_sdl.o \
313                 plugins/sdl/vout_sdl.o 
314 #               plugins/sdl/video_yuv.o \
315 #               plugins/sdl/video_yuvall.o
316
317 PLUGIN_NULL =   plugins/null/null.o
318
319 PLUGIN_GLIDE =  plugins/glide/glide.o \
320                 plugins/glide/intf_glide.o \
321                 plugins/glide/vout_glide.o
322
323 PLUGIN_GNOME =  plugins/gnome/gnome.o \
324                 plugins/gnome/intf_gnome.o \
325                 plugins/gnome/intf_gnome_callbacks.o \
326                 plugins/gnome/intf_gnome_interface.o \
327                 plugins/gnome/intf_gnome_support.o \
328                 plugins/gnome/vout_gnome.o
329
330 PLUGIN_MGA =    plugins/mga/mga.o \
331                 plugins/mga/intf_mga.o \
332                 plugins/mga/vout_mga.o
333
334 PLUGIN_X11=     plugins/x11/x11.o \
335                 plugins/x11/intf_x11.o \
336                 plugins/x11/vout_x11.o
337
338 PLUGIN_YUV =    plugins/yuv/yuv.o \
339                 plugins/yuv/video_yuv.o \
340                 plugins/yuv/video_yuv8.o \
341                 plugins/yuv/video_yuv15.o \
342                 plugins/yuv/video_yuv16.o \
343                 plugins/yuv/video_yuv24.o \
344                 plugins/yuv/video_yuv32.o
345
346 PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
347                 plugins/yuvmmx/video_yuv.o \
348                 plugins/yuvmmx/video_yuv8.o \
349                 plugins/yuvmmx/video_yuv15.o \
350                 plugins/yuvmmx/video_yuv16.o \
351                 plugins/yuvmmx/video_yuv24.o \
352                 plugins/yuvmmx/video_yuv32.o
353
354 PLUGIN_ALSA =   plugins/alsa/alsa.o \
355                 plugins/alsa/aout_alsa.o
356
357 STD_PLUGIN_OBJ =$(PLUGIN_BEOS) \
358                 $(PLUGIN_DSP) \
359                 $(PLUGIN_DUMMY) \
360                 $(PLUGIN_ESD) \
361                 $(PLUGIN_FB) \
362                 $(PLUGIN_GGI) \
363                 $(PLUGIN_MGA) \
364                 $(PLUGIN_X11) \
365                 $(PLUGIN_YUV) \
366                 $(PLUGIN_YUVMMX) \
367                 $(PLUGIN_SDL) \
368                 $(PLUGIN_ALSA) \
369                 $(PLUGIN_NULL)
370
371 #
372 # Other lists of files
373 #
374 objects := $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
375 dependancies := $(objects:%.o=.dep/%.d)
376
377 # All symbols must be exported
378 export
379
380 ################################################################################
381 # Targets
382 ################################################################################
383
384 #
385 # Virtual targets
386 #
387 all: vlc @ALIASES@ plugins
388
389 clean:
390         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
391         rm -f vlc @ALIASES@ lib/*.so
392
393 distclean: clean
394         rm -f src/*/*.o plugins/*/*.o **/*~ *.log
395         rm -f Makefile include/defs.h include/config.h
396         rm -f config.status config.cache config.log
397         rm -f gmon.out core build-stamp
398         rm -rf .dep
399
400 install:
401         mkdir -p $(prefix)/bin
402         $(INSTALL) vlc $(prefix)/bin
403 # ugly
404         for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(prefix)/bin/$$alias && ln -s vlc $(prefix)/bin/$$alias ; fi ; done
405         mkdir -p $(prefix)/lib/videolan/vlc
406         $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(prefix)/lib/videolan/vlc
407         mkdir -p $(prefix)/share/videolan
408         $(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan
409         $(INSTALL) -m 644 share/*.png $(prefix)/share/videolan
410
411 show:
412         @echo CC: $(CC)
413         @echo CFLAGS: $(CFLAGS)
414         @echo DCFLAGS: $(DCFLAGS)
415         @echo LCFLAGS: $(LCFLAGS)
416
417 # ugliest of all, but I have no time to do it -- sam
418 snapshot:
419         rm -rf /tmp/${SNAPSHOTDIR}
420         mkdir /tmp/${SNAPSHOTDIR}
421         cp -a * /tmp/${SNAPSHOTDIR}
422                 (cd /tmp/${SNAPSHOTDIR} ; \
423                 make distclean ; \
424                 find . -type d -name CVS | xargs rm -rf ; \
425                 find . -type f -name '.*.swp' | xargs rm -f ; \
426                 find . -type f -name '.cvsignore' | xargs rm -f ; \
427                 cd .. ; \
428                 tar czvf ${SNAPSHOTDIR}.tar.gz ${SNAPSHOTDIR} ; \
429                 tar cIvf ${SNAPSHOTDIR}.tar.bz2 ${SNAPSHOTDIR} )
430         rm -rf /tmp/${SNAPSHOTDIR}
431         mv /tmp/${SNAPSHOTDIR}.tar.gz ..
432         mv /tmp/${SNAPSHOTDIR}.tar.bz2 ..
433         @echo "Sources are in ../${SNAPSHOTDIR}.tar.[gz,bz2]"
434
435 plugins: $(PLUGINS:%=lib/%.so)
436
437 FORCE:
438
439 #
440 # Gnome and Framebuffer aliases - don't add new aliases which could bloat
441 # the namespace
442 #
443 gvlc fbvlc: vlc
444         rm -f $@ && ln -s vlc $@
445
446
447 #
448 # Generic rules (see below)
449 #
450 $(dependancies): %.d: FORCE
451         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
452
453 $(C_OBJ): %.o: Makefile.dep
454 $(C_OBJ): %.o: .dep/%.d
455 $(C_OBJ): %.o: %.c
456         $(CC) $(CFLAGS) -c -o $@ $<
457
458 $(CPP_OBJ): %.o: %.cpp
459         $(CC) $(CFLAGS) -c -o $@ $<
460
461 $(ASM_OBJ): %.o: Makefile.dep
462 $(ASM_OBJ): %.o: %.S
463         $(CC) $(CFLAGS) -c -o $@ $<
464
465 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
466 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
467 $(STD_PLUGIN_OBJ): %.o: %.c
468         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
469
470 $(PLUGIN_GNOME): %.o: Makefile.dep
471 $(PLUGIN_GNOME): %.o: %.c
472         $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
473
474 $(PLUGIN_GLIDE): %.o: Makefile.dep
475 $(PLUGIN_GLIDE): %.o: %.c
476         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
477
478 #
479 # Main application target
480 #
481
482 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
483 ifeq ($(SYS),beos)
484         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
485         rm -f ./plugins/_APP_
486         ln -s ../vlc ./plugins/_APP_
487 else
488         $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) 
489 endif
490
491 #
492 # Plugin targets
493 #
494
495 lib/beos.so: $(PLUGIN_BEOS)
496         $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
497
498 lib/esd.so: $(PLUGIN_ESD)
499 ifneq (,$(findstring bsd,$(SYS)))
500         $(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
501 else
502         $(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
503 endif
504
505 lib/dsp.so: $(PLUGIN_DSP)
506         $(CC) $(PCFLAGS) -shared -o $@ $^
507
508 lib/alsa.so: $(PLUGIN_ALSA)
509         $(CC) $(PCFLAGS) -shared -o $@ $^
510
511 lib/null.so: $(PLUGIN_NULL)
512         $(CC) $(PCFLAGS) -shared -o $@ $^
513
514 lib/dummy.so: $(PLUGIN_DUMMY)
515         $(CC) $(PCFLAGS) -shared -o $@ $^
516
517 lib/fb.so: $(PLUGIN_FB)
518         $(CC) $(PCFLAGS) -shared -o $@ $^
519
520 lib/x11.so: $(PLUGIN_X11)
521         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
522
523 lib/mga.so: $(PLUGIN_MGA)
524         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
525
526 lib/gnome.so: $(PLUGIN_GNOME)
527         $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
528
529 lib/glide.so: $(PLUGIN_GLIDE)
530         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
531
532 lib/ggi.so: $(PLUGIN_GGI)
533         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
534
535 lib/sdl.so: $(PLUGIN_SDL)
536         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
537
538 lib/yuv.so: $(PLUGIN_YUV)
539 ifeq ($(SYS),beos)
540         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
541 else
542         $(CC) $(PCFLAGS) -shared -o $@ $^
543 endif
544
545 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
546 ifeq ($(SYS),beos)
547         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
548 else
549         $(CC) $(PCFLAGS) -shared -o $@ $^
550 endif
551
552 ################################################################################
553 # Note on generic rules and dependancies
554 ################################################################################
555
556 # Note on dependancies: each .c file is associated with a .d file, which
557 # depends of it. The .o file associated with a .c file depends of the .d, of the
558 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
559 # directory.
560 # The dep directory should be ignored by CVS.
561
562 # Note on inclusions: depending of the target, the dependancies files must
563 # or must not be included. The problem is that if we ask make to include a file,
564 # and this file does not exist, it is made before it can be included. In a
565 # general way, a .d file should be included if and only if the corresponding .o
566 # needs to be re-made.
567
568 # Two makefiles are used: the main one (this one) has regular generic rules,
569 # except for .o files, for which it calls the object Makefile. Dependancies
570 # are not included in this file.
571 # The object Makefile known how to make a .o from a .c, and includes
572 # dependancies for the target, but only those required.