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