]> git.sesse.net Git - vlc/blob - Makefile.in
switched back to the old packet allocation method for PS input, because
[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 INSTALL=@INSTALL@
20 ARCH=@ARCH@
21
22 exec_prefix=@exec_prefix@
23 prefix=@prefix@
24 bindir=@bindir@
25 datadir=@datadir@
26 libdir=@libdir@
27
28 CC=@CC@
29 SHELL=@SHELL@
30
31 #----------------- do not change anything below this line ----------------------
32
33 ################################################################################
34 # Configuration pre-processing
35 ################################################################################
36
37 # PROGRAM_OPTIONS is an identification string of the compilation options
38 PROGRAM_OPTIONS = $(SYS) $(ARCH)
39 ifeq ($(DEBUG),1)
40 PROGRAM_OPTIONS += DEBUG
41 DEFINE += -DDEBUG
42 endif
43 ifeq ($(STATS),1)
44 PROGRAM_OPTIONS += DEBUG
45 DEFINE += -DSTATS
46 endif
47
48 # PROGRAM_BUILD is a complete identification of the build
49 # (we can't use fancy options with date since OSes like Solaris
50 # or FreeBSD have strange date implementations)
51 PROGRAM_BUILD = `date` $(USER)
52 # XXX: beos does not support hostname (how lame...)
53 #PROGRAM_BUILD = `date` $(USER)@`hostname`
54
55 # DEFINE will contain some of the constants definitions decided in Makefile, 
56 # including SYS_xx. It will be passed to C compiler.
57 DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr '[a-z].' '[A-Z]_')
58
59 # On Linux activate 64-bit off_t (by default under BSD)
60 ifneq (,$(findstring linux,$(SYS)))
61 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
62 endif
63
64 ################################################################################
65 # Tuning and other variables - do not change anything except if you know
66 # exactly what you are doing
67 ################################################################################
68
69 #
70 # C headers directories
71 #
72 INCLUDE += @INCLUDE@
73 INCLUDE += -Iinclude -Iextras -I/usr/local/include
74
75 #
76 # Libraries
77 #
78 LIB = @LIB@ -L/usr/local/lib
79
80 ifeq ($(SYS),beos)
81 LIB += -lbe -lroot -lgame
82 else
83 LIB += -lm
84 endif
85
86 #
87 # C compiler flags: mainstream compilation
88 #
89 CFLAGS += $(DEFINE) $(INCLUDE)
90 CFLAGS += -Wall -Winline
91 CFLAGS += -D_REENTRANT
92 CFLAGS += -D_GNU_SOURCE
93
94 # flags needed for clean beos compilation
95 ifeq ($(SYS),beos)
96 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
97 endif
98
99 ifneq (,$(findstring darwin,$(SYS)))
100 CFLAGS += -traditional-cpp
101 endif
102
103 # Optimizations : don't compile debug versions with them
104 ifeq ($(OPTIMS),1)
105 CFLAGS += -O3
106 CFLAGS += -ffast-math -funroll-loops
107 CFLAGS += -fomit-frame-pointer
108
109 # Optimizations for x86 familiy
110 ifneq (,$(findstring 86,$(ARCH)))
111 # Optional Pentium Pro optimizations
112 ifneq (,$(findstring ppro,$(ARCH)))
113 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
114 else
115 CFLAGS += -march=pentium -mcpu=pentium
116 endif
117 endif
118
119 # Optimizations for PowerPC
120 ifneq (,$(findstring powerpc,$(ARCH)))
121 CFLAGS += -mmultiple -mhard-float -mstring
122 endif
123
124 # Optimizations for Sparc
125 ifneq (,$(findstring sparc,$(ARCH)))
126 CFLAGS += -mhard-float
127 endif
128
129 #end of optimisations
130 endif
131
132 # Optional MMX optimizations for x86
133 ifneq (,$(findstring mmx,$(ARCH)))
134 CFLAGS += -DHAVE_MMX
135 endif
136
137 #
138 # C compiler flags: plugin compilation
139 #
140 PCFLAGS += -fPIC
141
142 #
143 # C compiler flags: plugin linking
144 #
145 ifneq (,$(findstring darwin,$(SYS)))
146 PLCFLAGS += -bundle -undefined suppress
147 else
148 ifeq ($(SYS),beos)
149 PLCFLAGS += -nostart plugins/_APP_
150 else
151 PLCFLAGS += -shared
152 endif
153 endif
154
155 #
156 # C compiler flags: dependancies
157 #
158 DCFLAGS += $(INCLUDE)
159 DCFLAGS += -MM
160
161 #
162 # C compiler flags: linking
163 #
164 LCFLAGS += @LCFLAGS@ $(LIB)
165 LCFLAGS += -Wall
166 #LCFLAGS += -s
167
168 ifeq ($(SYS),beos)
169 LCFLAGS += -Xlinker -soname=_APP_
170 else
171 ifneq (,$(findstring qnx,$(SYS)))
172 LCFLAGS += -Xlinker -export-dynamic
173 else
174 ifneq (,$(findstring darwin,$(SYS)))
175 LCFLAGS += -dyn
176 else
177 LCFLAGS += --export-dynamic
178 endif
179 endif
180 endif
181
182 #
183 # Debugging and profiling support (unless optimisations are active)
184 #
185 ifneq ($(OPTIMS),1)
186 CFLAGS += -g
187 endif
188
189 #################################################################################
190 # Objects and files
191 #################################################################################
192
193 #
194 # C Objects
195
196 INTERFACE =     src/interface/main.o \
197                 src/interface/interface.o \
198                 src/interface/intf_msg.o \
199                 src/interface/intf_cmd.o \
200                 src/interface/intf_ctrl.o \
201                 src/interface/intf_playlist.o \
202                 src/interface/intf_channels.o \
203                 src/interface/intf_console.o \
204                 src/interface/intf_urldecode.o \
205
206 INPUT =         src/input/input_ext-dec.o \
207                 src/input/input_ext-intf.o \
208                 src/input/input_dec.o \
209                 src/input/input_programs.o \
210                 src/input/input_netlist.o \
211                 src/input/input_clock.o \
212                 src/input/input.o \
213                 src/input/mpeg_system.o
214
215 AUDIO_OUTPUT =  src/audio_output/audio_output.o \
216                 src/audio_output/aout_fifo.o \
217                 src/audio_output/aout_u8.o \
218                 src/audio_output/aout_s8.o \
219                 src/audio_output/aout_u16.o \
220                 src/audio_output/aout_s16.o
221
222 VIDEO_OUTPUT =  src/video_output/video_output.o \
223                 src/video_output/video_text.o \
224                 src/video_output/video_spu.o \
225                 src/video_output/video_yuv.o
226
227 AC3_DECODER =   src/ac3_decoder/ac3_decoder_thread.o \
228                 src/ac3_decoder/ac3_decoder.o \
229                 src/ac3_decoder/ac3_parse.o \
230                 src/ac3_decoder/ac3_exponent.o \
231                 src/ac3_decoder/ac3_bit_allocate.o \
232                 src/ac3_decoder/ac3_mantissa.o \
233                 src/ac3_decoder/ac3_rematrix.o \
234                 src/ac3_decoder/ac3_imdct.o \
235                 src/ac3_decoder/ac3_downmix.o \
236                 src/ac3_decoder/ac3_downmix_c.o
237
238 LPCM_DECODER =  src/lpcm_decoder/lpcm_decoder_thread.o \
239                 src/lpcm_decoder/lpcm_decoder.o
240
241 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
242                 src/audio_decoder/adec_generic.o \
243                 src/audio_decoder/adec_layer1.o \
244                 src/audio_decoder/adec_layer2.o \
245                 src/audio_decoder/adec_math.o
246
247 SPU_DECODER =   src/spu_decoder/spu_decoder.o
248
249 #GEN_DECODER =  src/generic_decoder/generic_decoder.o
250
251 VIDEO_PARSER =  src/video_parser/video_parser.o \
252                 src/video_parser/vpar_headers.o \
253                 src/video_parser/vpar_blocks.o \
254                 src/video_parser/vpar_synchro.o \
255                 src/video_parser/video_fifo.o
256
257 VIDEO_DECODER = src/video_decoder/video_decoder.o
258
259 MISC =          src/misc/mtime.o \
260                 src/misc/tests.o \
261                 src/misc/rsc_files.o \
262                 src/misc/modules.o \
263                 src/misc/netutils.o
264
265 C_OBJ =         $(INTERFACE) \
266                 $(INPUT) \
267                 $(VIDEO_OUTPUT) \
268                 $(AUDIO_OUTPUT) \
269                 $(AC3_DECODER) \
270                 $(LPCM_DECODER) \
271                 $(AUDIO_DECODER) \
272                 $(SPU_DECODER) \
273                 $(GEN_DECODER) \
274                 $(VIDEO_PARSER) \
275                 $(VIDEO_DECODER) \
276                 $(MISC) \
277                 @GETOPT@
278
279
280 #
281 # CPP Objects
282
283 ifeq ($(SYS),beos)
284 CPP_OBJ =       src/misc/beos_specific.o
285 endif
286
287 #
288 # Assembler Objects
289
290 ifneq (,$(findstring 86,$(ARCH)))
291 ifneq (,$(findstring mmx,$(ARCH)))
292 ASM_OBJ =               
293 endif
294 endif
295
296 #
297 # Plugins
298 #
299 PLUGIN_ALSA =   plugins/alsa/alsa.o \
300                 plugins/alsa/aout_alsa.o
301
302 PLUGIN_BEOS =   plugins/beos/beos.o \
303                 plugins/beos/aout_beos.o \
304                 plugins/beos/intf_beos.o \
305                 plugins/beos/vout_beos.o \
306                 plugins/beos/DrawingTidbits.o \
307                 plugins/beos/TransportButton.o
308
309 PLUGIN_DARWIN = plugins/darwin/darwin.o \
310                 plugins/darwin/aout_darwin.o
311
312 PLUGIN_DSP =    plugins/dsp/dsp.o \
313                 plugins/dsp/aout_dsp.o
314
315 PLUGIN_DUMMY =  plugins/dummy/dummy.o \
316                 plugins/dummy/aout_dummy.o \
317                 plugins/dummy/intf_dummy.o \
318                 plugins/dummy/vout_dummy.o
319
320 PLUGIN_DVD =    plugins/dvd/dvd.o \
321                 plugins/dvd/input_dvd.o \
322                 plugins/dvd/dvd_netlist.o \
323                 plugins/dvd/dvd_ioctl.o \
324                 plugins/dvd/dvd_ifo.o \
325                 plugins/dvd/dvd_udf.o \
326                 plugins/dvd/dvd_css.o
327
328 PLUGIN_ESD =    plugins/esd/esd.o \
329                 plugins/esd/aout_esd.o
330
331 PLUGIN_FB =     plugins/fb/fb.o \
332                 plugins/fb/vout_fb.o
333
334 PLUGIN_GGI =    plugins/ggi/ggi.o \
335                 plugins/ggi/vout_ggi.o
336
337 PLUGIN_GLIDE =  plugins/glide/glide.o \
338                 plugins/glide/vout_glide.o
339
340 PLUGIN_GNOME =  plugins/gnome/gnome.o \
341                 plugins/gnome/intf_gnome.o \
342                 plugins/gnome/gnome_callbacks.o \
343                 plugins/gnome/gnome_interface.o \
344                 plugins/gnome/gnome_support.o
345
346 PLUGIN_GTK =    plugins/gtk/gtk.o \
347                 plugins/gtk/intf_gtk.o \
348                 plugins/gtk/gtk_callbacks.o \
349                 plugins/gtk/gtk_interface.o \
350                 plugins/gtk/gtk_support.o \
351                 plugins/gtk/gtk_playlist.o
352
353 PLUGIN_IDCT =           plugins/idct/idct.o
354
355 PLUGIN_IDCTCLASSIC =    plugins/idct/idctclassic.o
356
357 PLUGIN_IDCTMMX =        plugins/idct/idctmmx.o
358
359 PLUGIN_IDCTMMXEXT =     plugins/idct/idctmmxext.o
360
361 PLUGIN_IDCTALTIVEC =    plugins/idct/idctaltivec.o
362
363 PLUGIN_IDCTCOMMON =     plugins/idct/idct_common.o
364
365 PLUGIN_KDE =    plugins/kde/kde.o \
366                 plugins/kde/intf_kde.o
367
368 PLUGIN_MACOSX = plugins/macosx/macosx.o \
369                 plugins/macosx/intf_macosx.o \
370                 plugins/macosx/vout_macosx.o
371
372 PLUGIN_MGA =    plugins/mga/mga.o \
373                 plugins/mga/vout_mga.o
374
375 PLUGIN_MOTION =         plugins/motion/motion.o \
376                         plugins/motion/vdec_motion_inner.o
377
378 PLUGIN_MOTIONMMX =      plugins/motion/motionmmx.o \
379                         plugins/motion/vdec_motion_inner_mmx.o
380
381 PLUGIN_MOTIONMMXEXT =   plugins/motion/motionmmxext.o \
382                         plugins/motion/vdec_motion_inner_mmxext.o
383
384 PLUGIN_MOTIONCOMMON =   plugins/motion/vdec_motion_common.o
385
386 PLUGIN_NCURSES =        plugins/text/ncurses.o \
387                         plugins/text/intf_ncurses.o
388
389 PLUGIN_NULL =   plugins/null/null.o
390
391 PLUGIN_PS =     plugins/mpeg/ps.o \
392                 plugins/mpeg/input_ps.o
393
394 PLUGIN_QT =     plugins/qt/qt.o \
395                 plugins/qt/intf_qt.o
396
397 PLUGIN_SDL =    plugins/sdl/sdl.o \
398                 plugins/sdl/vout_sdl.o \
399                 plugins/sdl/aout_sdl.o 
400
401 PLUGIN_TS =     plugins/mpeg/ts.o \
402                 plugins/mpeg/input_ts.o
403
404 PLUGIN_XVIDEO = plugins/x11/xvideo.o \
405                 plugins/x11/vout_xvideo.o
406
407 PLUGIN_X11 =    plugins/x11/x11.o \
408                 plugins/x11/vout_x11.o
409
410 PLUGIN_YUV =    plugins/yuv/yuv.o \
411                 plugins/yuv/video_yuv.o \
412                 plugins/yuv/transforms_yuv.o
413
414 PLUGIN_YUVMMX = plugins/yuv/yuvmmx.o \
415                 plugins/yuv/video_yuvmmx.o \
416                 plugins/yuv/transforms_yuvmmx.o
417
418 STD_PLUGIN_OBJ = \
419                 $(PLUGIN_ALSA) \
420                 $(PLUGIN_DARWIN) \
421                 $(PLUGIN_DSP) \
422                 $(PLUGIN_DUMMY) \
423                 $(PLUGIN_DVD) \
424                 $(PLUGIN_ESD) \
425                 $(PLUGIN_FB) \
426                 $(PLUGIN_GGI) \
427                 $(PLUGIN_IDCT) \
428                 $(PLUGIN_IDCTCLASSIC) \
429                 $(PLUGIN_IDCTMMX) \
430                 $(PLUGIN_IDCTMMXEXT) \
431                 $(PLUGIN_IDCTCOMMON) \
432                 $(PLUGIN_MACOSX) \
433                 $(PLUGIN_MGA) \
434                 $(PLUGIN_MOTION) \
435                 $(PLUGIN_MOTIONMMX) \
436                 $(PLUGIN_MOTIONMMXEXT) \
437                 $(PLUGIN_MOTIONCOMMON) \
438                 $(PLUGIN_NCURSES) \
439                 $(PLUGIN_NULL) \
440                 $(PLUGIN_PS) \
441                 $(PLUGIN_SDL) \
442                 $(PLUGIN_TS) \
443                 $(PLUGIN_YUV) \
444                 $(PLUGIN_YUVMMX)
445
446 NONSTD_PLUGIN_OBJ = \
447                 $(PLUGIN_X11) \
448                 $(PLUGIN_XVIDEO) \
449                 $(PLUGIN_GLIDE) \
450                 $(PLUGIN_GTK) \
451                 $(PLUGIN_GNOME) \
452                 $(PLUGIN_IDCTALTIVEC)
453
454 NONSTD_CPP_PLUGIN_OBJ = \
455                 $(PLUGIN_BEOS) \
456                 $(PLUGIN_QT) \
457                 $(PLUGIN_KDE)
458
459 #
460 # Other lists of files
461 #
462 objects := $(C_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(NONSTD_PLUGIN_OBJ)
463 cdependancies := $(objects:%.o=.dep/%.d)
464 cppobjects := $(CPP_OBJ) $(NONSTD_CPP_PLUGIN_OBJ)
465 cppdependancies := $(cppobjects:%.o=.dep/%.dpp)
466
467 # All symbols must be exported
468 export
469
470 ################################################################################
471 # Targets
472 ################################################################################
473
474 #
475 # Virtual targets
476 #
477 all: vlc @ALIASES@ plugins
478
479 clean:
480         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
481         rm -f plugins/*/*.o src/*/*.o lib/*.so extras/*/*.o
482         rm -f vlc gvlc kvlc qvlc
483
484 distclean: clean
485         rm -f **/*.o **/*~ *.log
486         rm -f Makefile include/defs.h include/config.h
487         rm -f config.status config.cache config.log
488         rm -f gmon.out core build-stamp
489         rm -rf .dep
490
491 install:
492         mkdir -p $(DESTDIR)$(bindir)
493         $(INSTALL) vlc $(DESTDIR)$(bindir)
494 # ugly
495         for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
496         mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
497         $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
498         mkdir -p $(DESTDIR)$(datadir)/videolan
499         $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
500         $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
501         $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
502
503 show:
504         @echo CC: $(CC)
505         @echo CFLAGS: $(CFLAGS)
506         @echo DCFLAGS: $(DCFLAGS)
507         @echo LCFLAGS: $(LCFLAGS)
508         @echo C_OBJ: $(C_OBJ)
509         @echo CPP_OBJ: $(CPP_OBJ)
510         @echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
511         @echo NONSTD_PLUGIN_OBJ: $(NONSTD_PLUGIN_OBJ)
512         @echo NONSTD_CPP_PLUGIN_OBJ: $(NONSTD_CPP_PLUGIN_OBJ)
513         @echo objects: $(objects)
514         @echo cppobjects: $(cppobjects)
515
516 # ugliest of all, but I have no time to do it -- sam
517 snapshot:
518         rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
519         # copy archive in /tmp
520         find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \
521                 do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
522         done
523         find debian -mindepth 1 -maxdepth 1 -type d | \
524                 while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
525         # .c .h .in .cpp
526         find include src plugins -type f -name '*.[chi]*' | while read i ; \
527                 do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
528         done
529         # copy misc files
530         cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO \
531                 Makefile.in Makefile.dep configure configure.in install-sh \
532                 config.sub config.guess todo.pl \
533                         /tmp/vlc-@VLC_VERSION@/
534         for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
535                 changelog changelog-css rules rules-css vlc.1 vlc.dirs \
536                 vlc.menu ; do \
537                         cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
538         for file in default8x16.psf default8x9.psf gvlc.png vlc.png \
539                 gvlc.xpm vlc.xpm ; do \
540                         cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
541
542         # build css-enabled archives
543         (cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
544                 bzip2 -f -9 < vlc-@VLC_VERSION@.tar \
545                         > vlc-@VLC_VERSION@.tar.bz2 ; \
546                 gzip -f -9 vlc-@VLC_VERSION@.tar )
547         mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..
548
549         # clean up
550         rm -rf /tmp/vlc-@VLC_VERSION@*
551
552 plugins: $(PLUGINS:%=lib/%.so)
553
554 FORCE:
555
556 #
557 # GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat
558 # the namespace
559 #
560 gvlc kvlc qvlc: vlc
561         rm -f $@ && ln -s vlc $@
562
563
564 #
565 # Generic rules (see below)
566 #
567 $(cdependancies): %.d: FORCE
568         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
569
570 $(cppdependancies): %.dpp: FORCE
571         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
572
573 $(C_OBJ): %.o: Makefile.dep
574 $(C_OBJ): %.o: .dep/%.d
575 $(C_OBJ): %.o: %.c
576         $(CC) $(CFLAGS) -c -o $@ $<
577
578 $(CPP_OBJ): %.o: Makefile.dep
579 $(CPP_OBJ): %.o: .dep/%.dpp
580 $(CPP_OBJ): %.o: %.cpp
581         $(CC) $(CFLAGS) -c -o $@ $<
582
583 $(ASM_OBJ): %.o: Makefile.dep
584 $(ASM_OBJ): %.o: %.S
585         $(CC) $(CFLAGS) -c -o $@ $<
586
587 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
588 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
589 $(STD_PLUGIN_OBJ): %.o: %.c
590         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
591
592 $(PLUGIN_XVIDEO): %.o: Makefile.dep
593 $(PLUGIN_XVIDEO): %.o: .dep/%.d
594 $(PLUGIN_XVIDEO): %.o: %.c
595         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/X11R6/include -c -o $@ $<
596
597 $(PLUGIN_X11): %.o: Makefile.dep
598 $(PLUGIN_X11): %.o: .dep/%.d
599 $(PLUGIN_X11): %.o: %.c
600         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/X11R6/include -c -o $@ $<
601
602 $(PLUGIN_GTK): %.o: Makefile.dep
603 $(PLUGIN_GTK): %.o: .dep/%.d
604 $(PLUGIN_GTK): %.o: %.c
605         $(CC) $(CFLAGS) $(PCFLAGS) `gtk-config --cflags gtk` -c -o $@ $<
606
607 $(PLUGIN_GNOME): %.o: Makefile.dep
608 $(PLUGIN_GNOME): %.o: .dep/%.d
609 $(PLUGIN_GNOME): %.o: %.c
610         $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gtk gnomeui` -c -o $@ $<
611
612 $(PLUGIN_GLIDE): %.o: Makefile.dep
613 $(PLUGIN_GLIDE): %.o: .dep/%.d
614 $(PLUGIN_GLIDE): %.o: %.c
615         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
616
617 $(PLUGIN_QT): %.o: Makefile.dep
618 $(PLUGIN_QT): %.o: .dep/%.dpp
619 $(PLUGIN_QT): %.o: %.moc
620         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
621 $(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
622         moc -i $< -o $@
623
624 $(PLUGIN_KDE): %.o: Makefile.dep
625 $(PLUGIN_KDE): %.o: .dep/%.dpp
626 $(PLUGIN_KDE): %.o: %.cpp
627         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/kde -I/usr/include/qt -fno-rtti -c -o $@ $<
628
629 $(PLUGIN_BEOS): %.o: Makefile.dep
630 $(PLUGIN_BEOS): %.o: .dep/%.dpp
631 $(PLUGIN_BEOS): %.o: %.cpp
632         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
633
634 $(PLUGIN_IDCTALTIVEC): %.o: Makefile.dep
635 $(PLUGIN_IDCTALTIVEC): %.o: .dep/%.d
636 $(PLUGIN_IDCTALTIVEC): %.o: %.c
637         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $< -faltivec
638
639 #
640 # Main application target
641 #
642
643 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
644         $(CC) $(CFLAGS) -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(LCFLAGS)
645 ifeq ($(SYS),beos)
646         rm -f ./plugins/_APP_
647         ln -s ../vlc ./plugins/_APP_
648 endif
649
650 #
651 # Plugin targets
652 #
653
654 lib/alsa.so: $(PLUGIN_ALSA)
655         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lasound
656
657 lib/beos.so: $(PLUGIN_BEOS)
658         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lbe -lgame -lroot -ltracker
659
660 lib/esd.so: $(PLUGIN_ESD)
661 ifneq (,$(findstring bsd,$(SYS)))
662         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lesd
663 else
664         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -laudiofile -lesd
665 endif
666
667 lib/darwin.so: $(PLUGIN_DARWIN)
668         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework CoreAudio
669
670 lib/dsp.so: $(PLUGIN_DSP)
671         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
672
673 lib/dummy.so: $(PLUGIN_DUMMY)
674         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
675
676 lib/dvd.so: $(PLUGIN_DVD)
677         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
678
679 lib/fb.so: $(PLUGIN_FB)
680         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
681
682 lib/ggi.so: $(PLUGIN_GGI)
683         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_GGI@
684
685 lib/glide.so: $(PLUGIN_GLIDE)
686         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_GLIDE@
687
688 lib/gnome.so: $(PLUGIN_GNOME)
689         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
690
691 lib/gtk.so: $(PLUGIN_GTK)
692         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) `gtk-config --libs gtk | sed 's,-rdynamic,,'`
693
694 lib/idct.so: $(PLUGIN_IDCT) $(PLUGIN_IDCTCOMMON)
695         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
696
697 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON)
698         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
699
700 lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON)
701         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
702
703 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON)
704         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
705
706 lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON)
707         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework vecLib
708
709 lib/kde.so: $(PLUGIN_KDE)
710         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lkdeui -lkdecore -lqt -ldl
711
712 lib/macosx.so: $(PLUGIN_MACOSX)
713         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
714
715 lib/mga.so: $(PLUGIN_MGA)
716         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext
717
718 lib/motion.so: $(PLUGIN_MOTION) $(PLUGIN_MOTIONCOMMON)
719         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
720
721 lib/motionmmx.so: $(PLUGIN_MOTIONMMX) $(PLUGIN_MOTIONCOMMON)
722         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
723
724 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT) $(PLUGIN_MOTIONCOMMON)
725         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
726
727 lib/ncurses.so: $(PLUGIN_NCURSES)
728         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lncurses
729
730 lib/null.so: $(PLUGIN_NULL)
731         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
732
733 lib/ps.so: $(PLUGIN_PS)
734         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
735
736 lib/qt.so: $(PLUGIN_QT)
737         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lqt -L${QTDIR}/lib
738
739 lib/sdl.so: $(PLUGIN_SDL)
740         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_SDL@
741
742 lib/ts.so: $(PLUGIN_TS)
743 ifeq ($(SYS),darwin)
744         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework AGL -framework Carbon
745 else
746         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
747 endif
748
749 lib/xvideo.so: $(PLUGIN_XVIDEO)
750 ifeq ($(SYS),nto-qnx)
751         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXv -lsocket
752 else
753         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXv
754 endif
755
756 lib/x11.so: $(PLUGIN_X11)
757 ifeq ($(SYS),nto-qnx)
758         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lsocket
759 else
760         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext
761 endif
762
763 lib/yuv.so: $(PLUGIN_YUV)
764         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
765
766 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
767         $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
768
769 ################################################################################
770 # Note on generic rules and dependancies
771 ################################################################################
772
773 # Note on dependancies: each .c file is associated with a .d file, which
774 # depends of it. The .o file associated with a .c file depends of the .d, of the
775 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
776 # directory.
777 # The dep directory should be ignored by CVS.
778
779 # Note on inclusions: depending of the target, the dependancies files must
780 # or must not be included. The problem is that if we ask make to include a file,
781 # and this file does not exist, it is made before it can be included. In a
782 # general way, a .d file should be included if and only if the corresponding .o
783 # needs to be re-made.
784
785 # Two makefiles are used: the main one (this one) has regular generic rules,
786 # except for .o files, for which it calls the object Makefile. Dependancies
787 # are not included in this file.
788 # The object Makefile known how to make a .o from a .c, and includes
789 # dependancies for the target, but only those required.