]> git.sesse.net Git - vlc/blob - Makefile.in
* Added IDCT Altivec optimization [MacOS X port]. Untested, not compiled.
[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 -dyn
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 ifneq (,$(findstring darwin,$(SYS)))
163 PCFLAGS += -bundle -undefined suppress
164 else
165 PCFLAGS += -fPIC
166 PLCFLAGS += -shared
167 endif
168
169 #
170 # C compiler flags: dependancies
171 #
172 DCFLAGS += $(INCLUDE)
173 DCFLAGS += -MM
174
175 #
176 # C compiler flags: linking
177 #
178 LCFLAGS += $(LIB)
179 LCFLAGS += -Wall
180 #LCFLAGS += -s
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
266 C_OBJ =         $(INTERFACE) \
267                 $(INPUT) \
268                 $(VIDEO_OUTPUT) \
269                 $(AUDIO_OUTPUT) \
270                 $(AC3_DECODER) \
271                 $(LPCM_DECODER) \
272                 $(AUDIO_DECODER) \
273                 $(SPU_DECODER) \
274                 $(GEN_DECODER) \
275                 $(VIDEO_PARSER) \
276                 $(VIDEO_DECODER) \
277                 $(MISC)
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_GTK =    plugins/gtk/gtk.o \
341                 plugins/gtk/intf_gtk.o \
342                 plugins/gtk/gtk_callbacks.o \
343                 plugins/gtk/gtk_interface.o \
344                 plugins/gtk/gtk_support.o \
345                 plugins/gtk/gtk_playlist.o
346
347 PLUGIN_GNOME =  plugins/gnome/gnome.o \
348                 plugins/gnome/intf_gnome.o \
349                 plugins/gnome/gnome_callbacks.o \
350                 plugins/gnome/gnome_interface.o \
351                 plugins/gnome/gnome_support.o
352
353 PLUGIN_QT =     plugins/qt/qt.o \
354                 plugins/qt/intf_qt.o
355
356 PLUGIN_KDE =    plugins/kde/kde.o \
357                 plugins/kde/intf_kde.o
358
359 PLUGIN_IDCT =   plugins/idct/idct.o \
360                 plugins/idct/idct_common.o
361
362 PLUGIN_IDCTCLASSIC =    plugins/idct/idctclassic.o \
363                         plugins/idct/idct_common.o
364
365 PLUGIN_IDCTMMX =        plugins/idct/idctmmx.o \
366                         plugins/idct/idct_common.o
367
368 PLUGIN_IDCTMMXEXT =     plugins/idct/idctmmxext.o \
369                         plugins/idct/idct_common.o
370
371 PLUGIN_IDCTALTIVEC =    plugins/idct/idctaltivec.o \
372                         plugins/idct/idct_common.o
373
374 PLUGIN_MACOSX = plugins/macosx/macosx.o \
375                 plugins/macosx/intf_macosx.o \
376                 plugins/macosx/vout_macosx.o
377
378 PLUGIN_MGA =    plugins/mga/mga.o \
379                 plugins/mga/vout_mga.o
380
381 PLUGIN_MOTION = plugins/motion/motion.o \
382                 plugins/motion/vdec_motion_common.o \
383                 plugins/motion/vdec_motion_inner.o
384
385 PLUGIN_MOTIONMMX =      plugins/motion/motionmmx.o \
386                         plugins/motion/vdec_motion_common.o \
387                         plugins/motion/vdec_motion_inner_mmx.o
388
389 PLUGIN_MOTIONMMXEXT =   plugins/motion/motionmmxext.o \
390                         plugins/motion/vdec_motion_common.o \
391                         plugins/motion/vdec_motion_inner_mmxext.o
392
393 PLUGIN_NCURSES =        plugins/text/ncurses.o \
394                         plugins/text/intf_ncurses.o
395
396 PLUGIN_NULL =   plugins/null/null.o
397
398 PLUGIN_PS =     plugins/mpeg/ps.o \
399                 plugins/mpeg/input_ps.o
400
401 PLUGIN_SDL =    plugins/sdl/sdl.o \
402                 plugins/sdl/vout_sdl.o \
403                 plugins/sdl/aout_sdl.o 
404
405 PLUGIN_TS =     plugins/mpeg/ts.o \
406                 plugins/mpeg/input_ts.o
407
408 PLUGIN_X11=     plugins/x11/x11.o \
409                 plugins/x11/vout_x11.o
410
411 PLUGIN_YUV =    plugins/yuv/yuv.o \
412                 plugins/yuv/video_yuv.o \
413                 plugins/yuv/transforms_yuv.o
414
415 PLUGIN_YUVMMX = plugins/yuv/yuvmmx.o \
416                 plugins/yuv/video_yuvmmx.o \
417                 plugins/yuv/transforms_yuvmmx.o
418
419 STD_PLUGIN_OBJ = \
420                 $(PLUGIN_ALSA) \
421                 $(PLUGIN_DARWIN) \
422                 $(PLUGIN_DSP) \
423                 $(PLUGIN_DUMMY) \
424                 $(PLUGIN_DVD) \
425                 $(PLUGIN_ESD) \
426                 $(PLUGIN_FB) \
427                 $(PLUGIN_GGI) \
428                 $(PLUGIN_IDCT) \
429                 $(PLUGIN_IDCTCLASSIC) \
430                 $(PLUGIN_IDCTMMX) \
431                 $(PLUGIN_IDCTMMXEXT) \
432                 $(PLUGIN_MACOSX) \
433                 $(PLUGIN_MGA) \
434                 $(PLUGIN_MOTION) \
435                 $(PLUGIN_MOTIONMMX) \
436                 $(PLUGIN_MOTIONMMXEXT) \
437                 $(PLUGIN_NCURSES) \
438                 $(PLUGIN_NULL) \
439                 $(PLUGIN_PS) \
440                 $(PLUGIN_SDL) \
441                 $(PLUGIN_TS) \
442                 $(PLUGIN_YUV) \
443                 $(PLUGIN_YUVMMX)
444
445 # list duplicates
446 STD_PLUGIN_COMMON =     plugins/idct/idct_common.o \
447                         plugins/motion/vdec_motion_common.o
448
449 # filter out duplicates from the plugin object lists
450 STD_PLUGIN_OBJ :=       $(filter-out $(STD_PLUGIN_COMMON), \
451                                  $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
452
453 NONSTD_PLUGIN_OBJ = \
454                 $(PLUGIN_X11) \
455                 $(PLUGIN_GLIDE) \
456                 $(PLUGIN_GTK) \
457                 $(PLUGIN_GNOME) \
458                 $(PLUGIN_IDCT_ALTIVEC)
459
460 NONSTD_CPP_PLUGIN_OBJ = \
461                 $(PLUGIN_BEOS) \
462                 $(PLUGIN_QT) \
463                 $(PLUGIN_KDE)
464
465 #
466 # Other lists of files
467 #
468 objects := $(C_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(NONSTD_PLUGIN_OBJ)
469 cdependancies := $(objects:%.o=.dep/%.d)
470 cppobjects := $(CPP_OBJ) $(NONSTD_CPP_PLUGIN_OBJ)
471 cppdependancies := $(cppobjects:%.o=.dep/%.dpp)
472
473 # All symbols must be exported
474 export
475
476 ################################################################################
477 # Targets
478 ################################################################################
479
480 #
481 # Virtual targets
482 #
483 all: vlc @ALIASES@ plugins
484
485 clean:
486         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
487         rm -f plugins/*/*.o src/*/*.o lib/*.so
488         rm -f vlc gvlc kvlc qvlc
489
490 distclean: clean
491         rm -f src/*/*.o plugins/*/*.o **/*~ *.log
492         rm -f Makefile include/defs.h include/config.h
493         rm -f config.status config.cache config.log
494         rm -f gmon.out core build-stamp
495         rm -rf .dep
496
497 install:
498         mkdir -p $(DESTDIR)$(bindir)
499         $(INSTALL) vlc $(DESTDIR)$(bindir)
500 # ugly
501         for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
502         mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
503         $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
504         mkdir -p $(DESTDIR)$(datadir)/videolan
505         $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
506         $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
507         $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
508
509 show:
510         @echo CC: $(CC)
511         @echo CFLAGS: $(CFLAGS)
512         @echo DCFLAGS: $(DCFLAGS)
513         @echo LCFLAGS: $(LCFLAGS)
514         @echo C_OBJ: $(C_OBJ)
515         @echo CPP_OBJ: $(CPP_OBJ)
516         @echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
517         @echo NONSTD_PLUGIN_OBJ: $(NONSTD_PLUGIN_OBJ)
518         @echo NONSTD_CPP_PLUGIN_OBJ: $(NONSTD_CPP_PLUGIN_OBJ)
519         @echo objects: $(objects)
520         @echo cppobjects: $(cppobjects)
521
522 # ugliest of all, but I have no time to do it -- sam
523 snapshot:
524         rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
525         # copy archive in /tmp
526         find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \
527                 do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
528         done
529         find debian -mindepth 1 -maxdepth 1 -type d | \
530                 while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
531         # .c .h .in .cpp
532         find include src plugins -type f -name '*.[chi]*' | while read i ; \
533                 do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
534         done
535         # copy misc files
536         cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO \
537                 Makefile.in Makefile.dep configure configure.in install-sh \
538                 config.sub config.guess todo.pl \
539                         /tmp/vlc-@VLC_VERSION@/
540         for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
541                 changelog changelog-css rules rules-css vlc.1 vlc.dirs \
542                 vlc.menu ; do \
543                         cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
544         for file in default8x16.psf default8x9.psf gvlc.png vlc.png \
545                 gvlc.xpm vlc.xpm ; do \
546                         cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
547
548         # build css-enabled archives
549         (cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
550                 bzip2 -f -9 < vlc-@VLC_VERSION@.tar \
551                         > vlc-@VLC_VERSION@.tar.bz2 ; \
552                 gzip -f -9 vlc-@VLC_VERSION@.tar )
553         mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..
554
555         # clean up
556         rm -rf /tmp/vlc-@VLC_VERSION@*
557
558 plugins: $(PLUGINS:%=lib/%.so)
559
560 FORCE:
561
562 #
563 # GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat
564 # the namespace
565 #
566 gvlc kvlc qvlc: vlc
567         rm -f $@ && ln -s vlc $@
568
569
570 #
571 # Generic rules (see below)
572 #
573 $(cdependancies): %.d: FORCE
574         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
575
576 $(cppdependancies): %.dpp: FORCE
577         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
578
579 $(C_OBJ): %.o: Makefile.dep
580 $(C_OBJ): %.o: .dep/%.d
581 $(C_OBJ): %.o: %.c
582         $(CC) $(CFLAGS) -c -o $@ $<
583
584 $(CPP_OBJ): %.o: Makefile.dep
585 $(CPP_OBJ): %.o: .dep/%.dpp
586 $(CPP_OBJ): %.o: %.cpp
587         $(CC) $(CFLAGS) -c -o $@ $<
588
589 $(ASM_OBJ): %.o: Makefile.dep
590 $(ASM_OBJ): %.o: %.S
591         $(CC) $(CFLAGS) -c -o $@ $<
592
593 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
594 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
595 $(STD_PLUGIN_OBJ): %.o: %.c
596         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
597
598 $(PLUGIN_X11): %.o: Makefile.dep
599 $(PLUGIN_X11): %.o: .dep/%.d
600 $(PLUGIN_X11): %.o: %.c
601         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/X11R6/include -c -o $@ $<
602
603 $(PLUGIN_GTK): %.o: Makefile.dep
604 $(PLUGIN_GTK): %.o: .dep/%.d
605 $(PLUGIN_GTK): %.o: %.c
606         $(CC) $(CFLAGS) $(PCFLAGS) `gtk-config --cflags gtk` -c -o $@ $<
607
608 $(PLUGIN_GNOME): %.o: Makefile.dep
609 $(PLUGIN_GNOME): %.o: .dep/%.d
610 $(PLUGIN_GNOME): %.o: %.c
611         $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gtk gnomeui` -c -o $@ $<
612
613 $(PLUGIN_GLIDE): %.o: Makefile.dep
614 $(PLUGIN_GLIDE): %.o: .dep/%.d
615 $(PLUGIN_GLIDE): %.o: %.c
616         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
617
618 $(PLUGIN_QT): %.o: Makefile.dep
619 $(PLUGIN_QT): %.o: .dep/%.dpp
620 $(PLUGIN_QT): %.o: %.moc
621         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -c -o $@ $(<:%.moc=%.cpp)
622 $(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
623         moc -i $< -o $@
624
625 $(PLUGIN_KDE): %.o: Makefile.dep
626 $(PLUGIN_KDE): %.o: .dep/%.dpp
627 $(PLUGIN_KDE): %.o: %.cpp
628         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/kde -I/usr/include/qt -fno-rtti -c -o $@ $<
629
630 $(PLUGIN_BEOS): %.o: Makefile.dep
631 $(PLUGIN_BEOS): %.o: .dep/%.dpp
632 $(PLUGIN_BEOS): %.o: %.cpp
633         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
634
635 $(PLUGIN_IDCTALTIVEC): %.o: Makefile.dep
636 $(PLUGIN_IDCTALTIVEC): %.o: .dep/%.d
637 $(PLUGIN_IDCTALTIVEC): %.o: %.c
638         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $< -faltivec
639
640 #
641 # Main application target
642 #
643
644 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
645 ifeq ($(SYS),beos)
646         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
647         rm -f ./plugins/_APP_
648         ln -s ../vlc ./plugins/_APP_
649 else
650 ifeq ($(SYS),nto-qnx)
651         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -export-dynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
652 else
653         $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) 
654 endif
655 endif
656
657 #
658 # Plugin targets
659 #
660
661 lib/beos.so: $(PLUGIN_BEOS)
662         $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot -ltracker
663
664 lib/esd.so: $(PLUGIN_ESD)
665 ifneq (,$(findstring bsd,$(SYS)))
666         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lesd
667 else
668         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -laudiofile -lesd
669 endif
670
671 lib/macosx.so: $(PLUGIN_MACOSX)
672         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
673
674 lib/darwin.so: $(PLUGIN_DARWIN)
675         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -framework CoreAudio
676
677 lib/dsp.so: $(PLUGIN_DSP)
678         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
679
680 lib/qt.so: $(PLUGIN_QT)
681         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lqt
682
683 lib/kde.so: $(PLUGIN_KDE)
684         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lkdeui -lkdecore -lqt -ldl
685
686 lib/alsa.so: $(PLUGIN_ALSA)
687         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lasound
688
689 lib/fb.so: $(PLUGIN_FB)
690         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
691
692 ifeq ($(SYS),nto-qnx)
693 lib/x11.so: $(PLUGIN_X11)
694         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext -lsocket
695 else
696 lib/x11.so: $(PLUGIN_X11)
697         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
698 endif
699
700 lib/mga.so: $(PLUGIN_MGA)
701         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
702
703 lib/gtk.so: $(PLUGIN_GTK)
704         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`
705
706 lib/gnome.so: $(PLUGIN_GNOME)
707         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
708
709 lib/glide.so: $(PLUGIN_GLIDE)
710         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ $(LIB_GLIDE)
711
712 lib/ggi.so: $(PLUGIN_GGI)
713         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ $(LIB_GGI)
714
715 lib/sdl.so: $(PLUGIN_SDL)
716         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ $(LIB_SDL)
717
718 lib/ncurses.so: $(PLUGIN_NCURSES)
719         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -lncurses
720
721 ifeq ($(SYS),beos)
722 lib/null.so: $(PLUGIN_NULL)
723         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
724
725 lib/ps.so: $(PLUGIN_PS)
726         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
727
728 lib/ts.so: $(PLUGIN_TS)
729         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
730
731 lib/dvd.so: $(PLUGIN_DVD)
732         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
733
734 lib/dummy.so: $(PLUGIN_DUMMY)
735         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
736
737 lib/yuv.so: $(PLUGIN_YUV)
738         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
739
740 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
741         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
742
743 lib/motion.so: $(PLUGIN_MOTION)
744         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
745
746 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
747         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
748
749 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
750         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
751
752 lib/idct.so: $(PLUGIN_IDCT)
753         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
754
755 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
756         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
757
758 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
759         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
760
761 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
762         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
763 else
764 lib/null.so: $(PLUGIN_NULL)
765         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
766
767 lib/ps.so: $(PLUGIN_PS)
768         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
769
770 lib/ts.so: $(PLUGIN_TS)
771         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
772
773 lib/dvd.so: $(PLUGIN_DVD)
774         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
775
776 lib/dummy.so: $(PLUGIN_DUMMY)
777         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
778
779 lib/yuv.so: $(PLUGIN_YUV)
780         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
781
782 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
783         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
784
785 lib/motion.so: $(PLUGIN_MOTION)
786         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
787
788 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
789         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
790
791 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
792         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
793
794 lib/idct.so: $(PLUGIN_IDCT)
795         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
796
797 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
798         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
799
800 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
801         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
802
803 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
804         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^
805
806 lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC)
807         $(CC) $(PCFLAGS) $(PLCFLAGS) -o $@ $^ -framework VecLib
808 endif
809
810 ################################################################################
811 # Note on generic rules and dependancies
812 ################################################################################
813
814 # Note on dependancies: each .c file is associated with a .d file, which
815 # depends of it. The .o file associated with a .c file depends of the .d, of the
816 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
817 # directory.
818 # The dep directory should be ignored by CVS.
819
820 # Note on inclusions: depending of the target, the dependancies files must
821 # or must not be included. The problem is that if we ask make to include a file,
822 # and this file does not exist, it is made before it can be included. In a
823 # general way, a .d file should be included if and only if the corresponding .o
824 # needs to be re-made.
825
826 # Two makefiles are used: the main one (this one) has regular generic rules,
827 # except for .o files, for which it calls the object Makefile. Dependancies
828 # are not included in this file.
829 # The object Makefile known how to make a .o from a .c, and includes
830 # dependancies for the target, but only those required.