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