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