]> git.sesse.net Git - vlc/blob - Makefile.in
* Added debian/* files to help generating CSS-enabled non-US packages,
[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
293 PLUGIN_DSP =    plugins/dsp/dsp.o \
294                 plugins/dsp/aout_dsp.o
295
296 PLUGIN_DUMMY =  plugins/dummy/dummy.o \
297                 plugins/dummy/aout_dummy.o \
298                 plugins/dummy/intf_dummy.o \
299                 plugins/dummy/vout_dummy.o
300
301 PLUGIN_DVD =    plugins/dvd/dvd.o \
302                 plugins/dvd/input_dvd.o \
303                 plugins/dvd/dvd_netlist.o \
304                 plugins/dvd/dvd_ioctl.o \
305                 plugins/dvd/dvd_ifo.o \
306                 plugins/dvd/dvd_udf.o \
307                 plugins/dvd/dvd_css.o
308
309 PLUGIN_ESD =    plugins/esd/esd.o \
310                 plugins/esd/aout_esd.o
311
312 PLUGIN_FB =     plugins/fb/fb.o \
313                 plugins/fb/vout_fb.o
314
315 PLUGIN_GGI =    plugins/ggi/ggi.o \
316                 plugins/ggi/vout_ggi.o
317
318 PLUGIN_GLIDE =  plugins/glide/glide.o \
319                 plugins/glide/vout_glide.o
320
321 PLUGIN_GTK =    plugins/gtk/gtk.o \
322                 plugins/gtk/intf_gtk.o \
323                 plugins/gtk/gtk_callbacks.o \
324                 plugins/gtk/gtk_interface.o \
325                 plugins/gtk/gtk_support.o
326
327 PLUGIN_GNOME =  plugins/gnome/gnome.o \
328                 plugins/gnome/intf_gnome.o \
329                 plugins/gnome/gnome_callbacks.o \
330                 plugins/gnome/gnome_interface.o \
331                 plugins/gnome/gnome_support.o
332
333 PLUGIN_KDE =    plugins/kde/kde.o \
334                 plugins/kde/intf_kde.o \
335                 plugins/kde/kvlc.o
336
337 PLUGIN_IDCT =   plugins/idct/idct.o \
338                 plugins/idct/idct_common.o
339
340 PLUGIN_IDCTCLASSIC =    plugins/idct/idctclassic.o \
341                         plugins/idct/idct_common.o
342
343 PLUGIN_IDCTMMX =        plugins/idct/idctmmx.o \
344                         plugins/idct/idct_common.o
345
346 PLUGIN_IDCTMMXEXT =     plugins/idct/idctmmxext.o \
347                         plugins/idct/idct_common.o
348
349 PLUGIN_MGA =    plugins/mga/mga.o \
350                 plugins/mga/vout_mga.o
351
352 PLUGIN_MOTION = plugins/motion/motion.o \
353                 plugins/motion/vdec_motion_common.o \
354                 plugins/motion/vdec_motion_inner.o
355
356 PLUGIN_MOTIONMMX =      plugins/motion/motionmmx.o \
357                         plugins/motion/vdec_motion_common.o \
358                         plugins/motion/vdec_motion_inner_mmx.o
359
360 PLUGIN_MOTIONMMXEXT =   plugins/motion/motionmmxext.o \
361                         plugins/motion/vdec_motion_common.o \
362                         plugins/motion/vdec_motion_inner_mmxext.o
363
364 PLUGIN_NCURSES =        plugins/text/ncurses.o \
365                         plugins/text/intf_ncurses.o
366
367 PLUGIN_NULL =   plugins/null/null.o
368
369 PLUGIN_PS =     plugins/mpeg/ps.o \
370                 plugins/mpeg/input_ps.o
371
372 PLUGIN_SDL =    plugins/sdl/sdl.o \
373                 plugins/sdl/vout_sdl.o \
374                 plugins/sdl/aout_sdl.o 
375
376 PLUGIN_TS =     plugins/mpeg/ts.o \
377                 plugins/mpeg/input_ts.o
378
379 PLUGIN_X11=     plugins/x11/x11.o \
380                 plugins/x11/vout_x11.o
381
382 PLUGIN_YUV =    plugins/yuv/yuv.o \
383                 plugins/yuv/video_yuv.o \
384                 plugins/yuv/transforms_yuv.o
385
386 PLUGIN_YUVMMX = plugins/yuv/yuvmmx.o \
387                 plugins/yuv/video_yuvmmx.o \
388                 plugins/yuv/transforms_yuvmmx.o
389
390 STD_PLUGIN_OBJ = \
391                 $(PLUGIN_ALSA) \
392                 $(PLUGIN_DSP) \
393                 $(PLUGIN_DUMMY) \
394                 $(PLUGIN_DVD) \
395                 $(PLUGIN_ESD) \
396                 $(PLUGIN_FB) \
397                 $(PLUGIN_GGI) \
398                 $(PLUGIN_IDCT) \
399                 $(PLUGIN_IDCTCLASSIC) \
400                 $(PLUGIN_IDCTMMX) \
401                 $(PLUGIN_IDCTMMXEXT) \
402                 $(PLUGIN_MGA) \
403                 $(PLUGIN_MOTION) \
404                 $(PLUGIN_MOTIONMMX) \
405                 $(PLUGIN_MOTIONMMXEXT) \
406                 $(PLUGIN_NCURSES) \
407                 $(PLUGIN_NULL) \
408                 $(PLUGIN_PS) \
409                 $(PLUGIN_SDL) \
410                 $(PLUGIN_TS) \
411                 $(PLUGIN_X11) \
412                 $(PLUGIN_YUV) \
413                 $(PLUGIN_YUVMMX)
414
415 # list duplicates
416 STD_PLUGIN_COMMON =     plugins/idct/idct_common.o \
417                         plugins/motion/vdec_motion_common.o
418
419 # filter out duplicates from the plugin object lists
420 STD_PLUGIN_OBJ :=       $(filter-out $(STD_PLUGIN_COMMON), \
421                                  $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
422
423 NONSTD_PLUGIN_OBJ = \
424                 $(PLUGIN_GLIDE) \
425                 $(PLUGIN_GTK) \
426                 $(PLUGIN_GNOME)
427
428 NONSTD_CPP_PLUGIN_OBJ = \
429                 $(PLUGIN_BEOS) \
430                 $(PLUGIN_KDE)
431
432 #
433 # Other lists of files
434 #
435 objects := $(C_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(NONSTD_PLUGIN_OBJ)
436 cdependancies := $(objects:%.o=.dep/%.d)
437 cppobjects := $(CPP_OBJ) $(NONSTD_CPP_PLUGIN_OBJ)
438 cppdependancies := $(cppobjects:%.o=.dep/%.dpp)
439
440 # All symbols must be exported
441 export
442
443 ################################################################################
444 # Targets
445 ################################################################################
446
447 #
448 # Virtual targets
449 #
450 all: vlc @ALIASES@ plugins
451
452 clean:
453         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
454         rm -f plugins/*/*.o src/*/*.o lib/*.so
455         rm -f vlc kvlc gvlc
456
457 distclean: clean
458         rm -f src/*/*.o plugins/*/*.o **/*~ *.log
459         rm -f Makefile include/defs.h include/config.h
460         rm -f config.status config.cache config.log
461         rm -f gmon.out core build-stamp
462         rm -rf .dep
463
464 install:
465         mkdir -p $(DESTDIR)$(bindir)
466         $(INSTALL) vlc $(DESTDIR)$(bindir)
467 # ugly
468         for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
469         mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
470         $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
471         mkdir -p $(DESTDIR)$(datadir)/videolan
472         $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
473         $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
474         $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
475
476 show:
477         @echo CC: $(CC)
478         @echo CFLAGS: $(CFLAGS)
479         @echo DCFLAGS: $(DCFLAGS)
480         @echo LCFLAGS: $(LCFLAGS)
481         @echo C_OBJ: $(C_OBJ)
482         @echo CPP_OBJ: $(CPP_OBJ)
483         @echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
484         @echo NONSTD_PLUGIN_OBJ: $(NONSTD_PLUGIN_OBJ)
485         @echo NONSTD_CPP_PLUGIN_OBJ: $(NONSTD_CPP_PLUGIN_OBJ)
486         @echo objects: $(objects)
487         @echo cppobjects: $(cppobjects)
488
489 # ugliest of all, but I have no time to do it -- sam
490 snapshot:
491         rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
492         # copy archive in /tmp
493         find -type d | grep -v CVS | grep -v '^\.dep' | while read i ; \
494                 do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
495         done
496         find debian -mindepth 1 -maxdepth 1 -type d | \
497                 while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
498         # .c .h .in .cpp
499         find include src plugins -type f -name '*.[chi]*' | while read i ; \
500                 do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
501         done
502         # copy misc files
503         cp vlc.spec AUTHORS COPYING ChangeLog CONTRIBUTORS INSTALL README TODO \
504                 Makefile.in Makefile.dep configure configure.in install-sh \
505                 config.sub config.guess todo.pl \
506                         /tmp/vlc-@VLC_VERSION@/
507         for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
508                 changelog changelog-css rules rules-css vlc.1 vlc.dirs \
509                 vlc.menu ; do \
510                         cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
511         for file in default8x16.psf default8x9.psf gvlc.png vlc.png \
512                 gvlc.xpm vlc.xpm ; do \
513                         cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
514
515         # build css-enabled archives
516         (cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
517                 bzip2 -f -9 < vlc-@VLC_VERSION@.tar \
518                         > vlc-@VLC_VERSION@.tar.bz2 ; \
519                 gzip -f -9 vlc-@VLC_VERSION@.tar )
520         mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..
521
522         # clean up
523         rm -rf /tmp/vlc-@VLC_VERSION@*
524
525 plugins: $(PLUGINS:%=lib/%.so)
526
527 FORCE:
528
529 #
530 # GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat
531 # the namespace
532 #
533 gvlc kvlc: vlc
534         rm -f $@ && ln -s vlc $@
535
536
537 #
538 # Generic rules (see below)
539 #
540 $(cdependancies): %.d: FORCE
541         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
542
543 $(cppdependancies): %.dpp: FORCE
544         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
545
546 $(C_OBJ): %.o: Makefile.dep
547 $(C_OBJ): %.o: .dep/%.d
548 $(C_OBJ): %.o: %.c
549         $(CC) $(CFLAGS) -c -o $@ $<
550
551 $(CPP_OBJ): %.o: Makefile.dep
552 $(CPP_OBJ): %.o: .dep/%.dpp
553 $(CPP_OBJ): %.o: %.cpp
554         $(CC) $(CFLAGS) -c -o $@ $<
555
556 $(ASM_OBJ): %.o: Makefile.dep
557 $(ASM_OBJ): %.o: %.S
558         $(CC) $(CFLAGS) -c -o $@ $<
559
560 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
561 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
562 $(STD_PLUGIN_OBJ): %.o: %.c
563         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
564
565 $(PLUGIN_GTK): %.o: Makefile.dep
566 $(PLUGIN_GTK): %.o: .dep/%.d
567 $(PLUGIN_GTK): %.o: %.c
568         $(CC) $(CFLAGS) $(PCFLAGS) `gtk-config --cflags gtk` -c -o $@ $<
569
570 $(PLUGIN_GNOME): %.o: Makefile.dep
571 $(PLUGIN_GNOME): %.o: .dep/%.d
572 $(PLUGIN_GNOME): %.o: %.c
573         $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
574
575 $(PLUGIN_GLIDE): %.o: Makefile.dep
576 $(PLUGIN_GLIDE): %.o: .dep/%.d
577 $(PLUGIN_GLIDE): %.o: %.c
578         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
579
580 $(PLUGIN_KDE): %.o: Makefile.dep
581 $(PLUGIN_KDE): %.o: .dep/%.dpp
582 $(PLUGIN_KDE): %.o: %.cpp
583         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/kde -I/usr/include/qt -fno-rtti -c -o $@ $<
584
585 $(PLUGIN_BEOS): %.o: Makefile.dep
586 $(PLUGIN_BEOS): %.o: .dep/%.dpp
587 $(PLUGIN_BEOS): %.o: %.cpp
588         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
589
590 #
591 # Main application target
592 #
593
594 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
595 ifeq ($(SYS),beos)
596         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
597         rm -f ./plugins/_APP_
598         ln -s ../vlc ./plugins/_APP_
599 else
600         $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) 
601 endif
602
603 #
604 # Plugin targets
605 #
606
607 lib/beos.so: $(PLUGIN_BEOS)
608         $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot
609
610 lib/esd.so: $(PLUGIN_ESD)
611 ifneq (,$(findstring bsd,$(SYS)))
612         $(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
613 else
614         $(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
615 endif
616
617 lib/dsp.so: $(PLUGIN_DSP)
618         $(CC) $(PCFLAGS) -shared -o $@ $^
619
620 lib/kde.so: $(PLUGIN_KDE)
621         $(CC) $(PCFLAGS) -shared -o $@ $^ -lkdeui -lkdecore -lqt -ldl
622
623 lib/alsa.so: $(PLUGIN_ALSA)
624         $(CC) $(PCFLAGS) -shared -o $@ $^ -lasound
625
626 lib/fb.so: $(PLUGIN_FB)
627         $(CC) $(PCFLAGS) -shared -o $@ $^
628
629 lib/x11.so: $(PLUGIN_X11)
630         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
631
632 lib/mga.so: $(PLUGIN_MGA)
633         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
634
635 lib/gtk.so: $(PLUGIN_GTK)
636         $(CC) $(PCFLAGS) -shared -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`
637
638 lib/gnome.so: $(PLUGIN_GNOME)
639         $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
640
641 lib/glide.so: $(PLUGIN_GLIDE)
642         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
643
644 lib/ggi.so: $(PLUGIN_GGI)
645         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
646
647 lib/sdl.so: $(PLUGIN_SDL)
648         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
649
650 lib/ncurses.so: $(PLUGIN_NCURSES)
651         $(CC) $(PCFLAGS) -shared -o $@ $^ -lncurses
652
653 ifeq ($(SYS),beos)
654 lib/null.so: $(PLUGIN_NULL)
655         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
656
657 lib/ps.so: $(PLUGIN_PS)
658         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
659
660 lib/ts.so: $(PLUGIN_TS)
661         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
662
663 lib/dvd.so: $(PLUGIN_DVD)
664         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
665
666 lib/dummy.so: $(PLUGIN_DUMMY)
667         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
668
669 lib/yuv.so: $(PLUGIN_YUV)
670         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
671
672 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
673         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
674
675 lib/motion.so: $(PLUGIN_MOTION)
676         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
677
678 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
679         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
680
681 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
682         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
683
684 lib/idct.so: $(PLUGIN_IDCT)
685         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
686
687 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
688         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
689
690 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
691         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
692
693 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
694         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
695 else
696 lib/null.so: $(PLUGIN_NULL)
697         $(CC) $(PCFLAGS) -shared -o $@ $^
698
699 lib/ps.so: $(PLUGIN_PS)
700         $(CC) $(PCFLAGS) -shared -o $@ $^
701
702 lib/ts.so: $(PLUGIN_TS)
703         $(CC) $(PCFLAGS) -shared -o $@ $^
704
705 lib/dvd.so: $(PLUGIN_DVD)
706         $(CC) $(PCFLAGS) -shared -o $@ $^
707
708 lib/dummy.so: $(PLUGIN_DUMMY)
709         $(CC) $(PCFLAGS) -shared -o $@ $^
710
711 lib/yuv.so: $(PLUGIN_YUV)
712         $(CC) $(PCFLAGS) -shared -o $@ $^
713
714 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
715         $(CC) $(PCFLAGS) -shared -o $@ $^
716
717 lib/motion.so: $(PLUGIN_MOTION)
718         $(CC) $(PCFLAGS) -shared -o $@ $^
719
720 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
721         $(CC) $(PCFLAGS) -shared -o $@ $^
722
723 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
724         $(CC) $(PCFLAGS) -shared -o $@ $^
725
726 lib/idct.so: $(PLUGIN_IDCT)
727         $(CC) $(PCFLAGS) -shared -o $@ $^
728
729 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
730         $(CC) $(PCFLAGS) -shared -o $@ $^
731
732 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
733         $(CC) $(PCFLAGS) -shared -o $@ $^
734
735 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
736         $(CC) $(PCFLAGS) -shared -o $@ $^
737 endif
738
739 ################################################################################
740 # Note on generic rules and dependancies
741 ################################################################################
742
743 # Note on dependancies: each .c file is associated with a .d file, which
744 # depends of it. The .o file associated with a .c file depends of the .d, of the
745 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
746 # directory.
747 # The dep directory should be ignored by CVS.
748
749 # Note on inclusions: depending of the target, the dependancies files must
750 # or must not be included. The problem is that if we ask make to include a file,
751 # and this file does not exist, it is made before it can be included. In a
752 # general way, a .d file should be included if and only if the corresponding .o
753 # needs to be re-made.
754
755 # Two makefiles are used: the main one (this one) has regular generic rules,
756 # except for .o files, for which it calls the object Makefile. Dependancies
757 # are not included in this file.
758 # The object Makefile known how to make a .o from a .c, and includes
759 # dependancies for the target, but only those required.