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