. support de la touche `q' pour quitter
[vlc.git] / Makefile.in
index 11bb129..403ebf4 100644 (file)
 DEBUG=0
 
 SYS=@SYS@
-ARCH=@ARCH@
-AOUT=@AOUT@
-VOUT=@VOUT@
-INTF=@VOUT@
+PLUGINS=@PLUGINS@
 SNAPSHOTDIR=vlc-@VLC_VERSION@
 INSTALL=@INSTALL@
+ARCH=@ARCH@
 prefix=@prefix@
 
 #----------------- do not change anything below this line ----------------------
@@ -31,6 +29,7 @@ prefix=@prefix@
 PROGRAM_OPTIONS = $(SYS) $(ARCH)
 ifeq ($(DEBUG),1)
 PROGRAM_OPTIONS += DEBUG
+DEFINE += -DDEBUG -g
 endif
 
 # PROGRAM_BUILD is a complete identification of the build
@@ -43,13 +42,6 @@ PROGRAM_BUILD = `date` $(USER)
 # DEFINE will contain some of the constants definitions decided in Makefile, 
 # including SYS_xx. It will be passed to C compiler.
 DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z A-Z)
-DEFINE += -DPLUGIN_PATH="\"$(prefix)/lib/videolan/vlc\""
-DEFINE += -DDATA_PATH="\"$(prefix)/share/videolan/vlc\""
-#DEFINE += -DPROGRAM_OPTIONS="\"$(shell echo $(PROGRAM_OPTIONS) | tr 'A-Z' 'a-z')\""
-#DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
-ifeq ($(DEBUG),1)
-DEFINE += -DDEBUG
-endif
 
 ################################################################################
 # Tuning and other variables - do not change anything except if you know
@@ -87,28 +79,32 @@ endif
 #
 # C compiler flags: compilation
 #
-CCFLAGS += $(DEFINE) $(INCLUDE)
-CCFLAGS += -Wall
-CCFLAGS += -D_REENTRANT
-CCFLAGS += -D_GNU_SOURCE
+CFLAGS += $(DEFINE) $(INCLUDE)
+CFLAGS += -Wall -Winline
+CFLAGS += -D_REENTRANT
+CFLAGS += -D_GNU_SOURCE
 
 # flags needed for clean beos compilation
-CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
+ifeq ($(SYS),beos)
+CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
+endif
 
 # Optimizations : don't compile debug versions with them
-CCFLAGS += -O6
-CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
-CCFLAGS += -fomit-frame-pointer
+ifeq ($(DEBUG),0)
+CFLAGS += -O6
+CFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
+CFLAGS += -fomit-frame-pointer
 
 # Optimizations for x86 familiy
 ifneq (,$(findstring 86,$(ARCH)))
-CCFLAGS += -malign-double
-#CCFLAGS += -march=pentium
+CFLAGS += -malign-double
 # Eventual Pentium Pro optimizations
-ifneq (,$(findstring pentiumpro,$(ARCH)))
+ifneq (,$(findstring ppro,$(ARCH)))
 ifneq ($(SYS), BSD)
-CCFLAGS += -march=pentiumpro
+CFLAGS += -march=pentiumpro
 endif
+else
+CFLAGS += -march=pentium
 endif
 # Eventual MMX optimizations for x86
 ifneq (,$(findstring mmx,$(ARCH)))
@@ -117,13 +113,21 @@ endif
 endif
 
 # Optimizations for PowerPC
-ifneq (,$(findstring ppc,$(ARCH)))
-CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
+ifneq (,$(findstring powerpc,$(ARCH)))
+# 604e
+CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
+# G3
+#CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
+# G4
+#CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
 endif
 
 # Optimizations for Sparc
 ifneq (,$(findstring sparc,$(ARCH)))
-CCFLAGS += -mhard-float
+CFLAGS += -mhard-float
+endif
+
+# End of optimizations
 endif
 
 #
@@ -143,11 +147,14 @@ LCFLAGS += -Wall
 # Additionnal debugging flags
 #
 
-# Debugging support
-ifeq ($(DEBUG),1)
+# Debugging and profiling support
+ifneq ($(DEBUG),0)
+ifeq ($(SYS),beos)
 CFLAGS += -g
+else
 CFLAGS += -pg
 endif
+endif
 
 #################################################################################
 # Objects and files
@@ -156,67 +163,75 @@ endif
 #
 # C Objects
 # 
-interface_obj =                interface/main.o \
-                                               interface/interface.o \
-                                               interface/intf_msg.o \
-                                               interface/intf_cmd.o \
-                                               interface/intf_ctrl.o \
-                                               interface/intf_console.o
-
-input_obj =                    input/input_vlan.o \
-                                               input/input_file.o \
-                                               input/input_netlist.o \
-                                               input/input_network.o \
-                                               input/input_ctrl.o \
-                                               input/input_pcr.o \
-                                               input/input_psi.o \
-                                               input/input.o
-
-audio_output_obj =             audio_output/audio_output.o
-
-video_output_obj =             video_output/video_output.o \
-                                               video_output/video_text.o \
-                                               video_output/video_spu.o \
-                                               video_output/video_yuv.o
-
-ac3_decoder_obj =              ac3_decoder/ac3_decoder_thread.o \
-                                               ac3_decoder/ac3_decoder.o \
-                                               ac3_decoder/ac3_parse.o \
-                                               ac3_decoder/ac3_exponent.o \
-                                               ac3_decoder/ac3_bit_allocate.o \
-                                               ac3_decoder/ac3_mantissa.o \
-                                               ac3_decoder/ac3_rematrix.o \
-                                               ac3_decoder/ac3_imdct.o \
-                                               ac3_decoder/ac3_downmix.o
+interface_obj =        interface/main.o \
+                               interface/interface.o \
+                               interface/intf_msg.o \
+                               interface/intf_cmd.o \
+                               interface/intf_ctrl.o \
+                               interface/intf_console.o
+
+input_obj =            input/input_vlan.o \
+                               input/input_file.o \
+                               input/input_netlist.o \
+                               input/input_network.o \
+                               input/input_ctrl.o \
+                               input/input_pcr.o \
+                               input/input_psi.o \
+                               input/input.o
+
+audio_output_obj =     audio_output/audio_output.o
+
+video_output_obj =     video_output/video_output.o \
+                               video_output/video_text.o \
+                               video_output/video_spu.o \
+                               video_output/video_yuv.o
+
+ac3_decoder_obj =      ac3_decoder/ac3_decoder_thread.o \
+                               ac3_decoder/ac3_decoder.o \
+                               ac3_decoder/ac3_parse.o \
+                               ac3_decoder/ac3_exponent.o \
+                               ac3_decoder/ac3_bit_allocate.o \
+                               ac3_decoder/ac3_mantissa.o \
+                               ac3_decoder/ac3_rematrix.o \
+                               ac3_decoder/ac3_imdct.o \
+                               ac3_decoder/ac3_downmix.o
                                                
-lpcm_decoder_obj =             lpcm_decoder/lpcm_decoder_thread.o \
-                                               lpcm_decoder/lpcm_decoder.o
+lpcm_decoder_obj =     lpcm_decoder/lpcm_decoder_thread.o \
+                               lpcm_decoder/lpcm_decoder.o
 
-audio_decoder_obj =            audio_decoder/audio_decoder_thread.o \
-                                               audio_decoder/audio_decoder.o \
-                                               audio_decoder/audio_math.o
+audio_decoder_obj =    audio_decoder/audio_decoder_thread.o \
+                               audio_decoder/audio_decoder.o \
+                               audio_decoder/audio_math.o
 
-spu_decoder_obj =              spu_decoder/spu_decoder.o
+spu_decoder_obj =      spu_decoder/spu_decoder.o
 
 #??generic_decoder_obj =               generic_decoder/generic_decoder.o
 # remeber to add it to OBJ 
 
-video_parser_obj =             video_parser/video_parser.o \
-                                               video_parser/vpar_headers.o \
-                                               video_parser/vpar_blocks.o \
-                                               video_parser/vpar_synchro.o \
-                                               video_parser/video_fifo.o
+video_parser_obj =     video_parser/video_parser.o \
+                               video_parser/vpar_headers.o \
+                               video_parser/vpar_blocks.o \
+                               video_parser/vpar_synchro.o \
+                               video_parser/video_fifo.o
 
-video_decoder_obj =            video_decoder/video_decoder.o \
-                                               video_decoder/vdec_motion.o \
-                                               video_decoder/vdec_motion_inner.o \
-                                               video_decoder/vdec_idct.o
+ifneq (,$(findstring mmx,$(ARCH)))
+       vdec_motion_inner = video_decoder/vdec_motion_inner_mmx.o
+else
+       vdec_motion_inner = video_decoder/vdec_motion_inner.o
+endif
+
+video_decoder_obj =    video_decoder/video_decoder.o \
+                               video_decoder/vdec_motion.o \
+                               video_decoder/vdec_idct.o \
+                               $(vdec_motion_inner)
 
-misc_obj =                     misc/mtime.o \
-                                               misc/rsc_files.o \
-                                               misc/netutils.o \
-                                               misc/plugins.o \
-                                               misc/decoder_fifo.o
+misc_obj =             misc/mtime.o \
+                               misc/tests.o \
+                               misc/rsc_files.o \
+                               misc/netutils.o \
+                               misc/playlist.o \
+                               misc/plugins.o \
+                               misc/decoder_fifo.o
 
 
 C_OBJ = $(interface_obj) \
@@ -250,12 +265,79 @@ endif
 #
 # Plugins
 #
-intf_plugin =           $(INTF:%=plugins/intf/intf_%.so)
-aout_plugin =           $(AOUT:%=plugins/aout/aout_%.so)
-vout_plugin =           $(VOUT:%=plugins/vout/vout_%.so)
-
-PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
-
+PLUGINS := $(PLUGINS:%=lib/%.so)
+
+PLUGIN_BEOS   = plugins/beos/beos.o \
+               plugins/beos/aout_beos.o \
+               plugins/beos/intf_beos.o \
+               plugins/beos/vout_beos.o
+
+PLUGIN_DSP    = plugins/dsp/dsp.o \
+               plugins/dsp/aout_dsp.o \
+
+PLUGIN_DUMMY  = plugins/dummy/dummy.o \
+               plugins/dummy/aout_dummy.o \
+               plugins/dummy/intf_dummy.o \
+               plugins/dummy/vout_dummy.o
+
+PLUGIN_ESD    = plugins/esd/esd.o \
+               plugins/esd/aout_esd.o
+
+PLUGIN_FB     = plugins/fb/fb.o \
+               plugins/fb/intf_fb.o \
+               plugins/fb/vout_fb.o
+
+PLUGIN_GGI    = plugins/ggi/ggi.o \
+               plugins/ggi/intf_ggi.o \
+               plugins/ggi/vout_ggi.o
+
+PLUGIN_SDL    = plugins/sdl/sdl.o \
+               plugins/sdl/intf_sdl.o \
+               plugins/sdl/vout_sdl.o 
+#              plugins/sdl/video_yuv.o \
+#              plugins/sdl/video_yuvall.o
+
+
+PLUGIN_GLIDE  = plugins/glide/glide.o \
+               plugins/glide/intf_glide.o \
+               plugins/glide/vout_glide.o
+
+PLUGIN_GNOME  = plugins/gnome/gnome.o \
+               plugins/gnome/intf_gnome.o \
+               plugins/gnome/intf_gnome_callbacks.o \
+               plugins/gnome/intf_gnome_interface.o \
+               plugins/gnome/intf_gnome_support.o \
+               plugins/gnome/vout_gnome.o
+
+PLUGIN_MGA    = plugins/mga/mga.o \
+               plugins/mga/intf_mga.o \
+               plugins/mga/vout_mga.o
+
+PLUGIN_X11    = plugins/x11/x11.o \
+               plugins/x11/intf_x11.o \
+               plugins/x11/vout_x11.o
+
+PLUGIN_YUV    = plugins/yuv/yuv.o \
+               plugins/yuv/video_yuv.o \
+               plugins/yuv/video_yuv8.o \
+               plugins/yuv/video_yuv15.o \
+               plugins/yuv/video_yuv16.o \
+               plugins/yuv/video_yuv24.o \
+               plugins/yuv/video_yuv32.o
+
+
+PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
+               plugins/yuvmmx/video_yuv.o \
+               plugins/yuvmmx/video_yuv8.o \
+               plugins/yuvmmx/video_yuv15.o \
+               plugins/yuvmmx/video_yuv16.o \
+               plugins/yuvmmx/video_yuv24.o \
+               plugins/yuvmmx/video_yuv32.o
+
+PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \
+               $(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \
+               $(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_YUV) $(PLUGIN_YUVMMX) \
+               $(PLUGIN_SDL)   
 #
 # Other lists of files
 #
@@ -275,32 +357,37 @@ export
 #
 # Virtual targets
 #
-all: vlc plugins
+all: vlc @ALIASES@ plugins
 
 clean:
        rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
+       rm -f vlc @ALIASES@ lib/*.so
 
 distclean: clean
-       rm -f */*/*.o plugins/*/*.so **/*~ *.log
+       rm -f src/*/*.o plugins/*/*.o **/*~ *.log
        rm -f Makefile include/defs.h include/config.h
        rm -f config.status config.cache config.log
-       rm -f vlc gvlc gmon.out core
+       rm -f gmon.out core build-stamp
        rm -rf .dep
+       rm -rf debian/tmp debian/files debian/*.debhelper debian/*.substvars
+       find debian/* -type d -maxdepth 0 -name 'vlc-*' | xargs rm -rf
 
 install:
+       mkdir -p $(prefix)/bin
        $(INSTALL) vlc $(prefix)/bin
-       $(INSTALL) gvlc $(prefix)/bin
+       # ugly
+       for alias in "" @ALIASES@ ; do if test $$alias ; then ln -s vlc $(prefix)/bin/$$alias ; fi ; done
        mkdir -p $(prefix)/lib/videolan/vlc
-       $(INSTALL) $(PLUGIN_OBJ) $(prefix)/lib/videolan/vlc
-       $(INSTALL) share/*.psf $(prefix)/share/videolan/vlc
-       $(INSTALL) share/*.png $(prefix)/share/videolan/vlc
+       $(INSTALL) -m 644 $(PLUGINS) $(prefix)/lib/videolan/vlc
+       mkdir -p $(prefix)/share/videolan
+       $(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan
+       $(INSTALL) -m 644 share/*.png $(prefix)/share/videolan
 
 show:
-       @echo "Command line for C objects:"
-       @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
-       @echo
-       @echo "Command line for assembler objects:"
-       @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
+       @echo CC: $(CC)
+       @echo CFLAGS: $(CFLAGS)
+       @echo DCFLAGS: $(DCFLAGS)
+       @echo LCFLAGS: $(LCFLAGS)
 
 # ugliest of all, but I have no time to do it -- sam
 snapshot:
@@ -311,11 +398,14 @@ snapshot:
                make distclean ; \
                find . -type d -name CVS | xargs rm -rf ; \
                find . -type f -name '.*.swp' | xargs rm -f ; \
+               find . -type f -name '.cvsignore' | xargs rm -f ; \
                cd .. ; \
-               tar czvf ${SNAPSHOTDIR}.tar.gz ${SNAPSHOTDIR} )
+               tar czvf ${SNAPSHOTDIR}.tar.gz ${SNAPSHOTDIR} ; \
+               tar cIvf ${SNAPSHOTDIR}.tar.bz2 ${SNAPSHOTDIR} )
        rm -rf /tmp/${SNAPSHOTDIR}
        mv /tmp/${SNAPSHOTDIR}.tar.gz ..
-       @echo "Sources are in ../${SNAPSHOTDIR}.tar.gz"
+       mv /tmp/${SNAPSHOTDIR}.tar.bz2 ..
+       @echo "Sources are in ../${SNAPSHOTDIR}.tar.[gz,bz2]"
 
 FORCE:
 
@@ -324,13 +414,21 @@ FORCE:
 #
 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
 ifeq ($(SYS),beos)
-       $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
-#      ln -s ../vlc ./plugins/_APP_
+       $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
+       rm -f ./plugins/_APP_
+       ln -s ../vlc ./plugins/_APP_
 else
-       $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)   
+       $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)      
 endif
 
-plugins: $(PLUGIN_OBJ)
+#
+# Gnome and Framebuffer aliases - don't add new aliases which could bloat
+# the namespace
+#
+gvlc fbvlc: vlc
+       rm -f $@ && ln -s vlc $@
+
+plugins: $(PLUGINS)
 
 #
 # Generic rules (see below)
@@ -341,10 +439,10 @@ $(dependancies): %.d: FORCE
 $(C_OBJ): %.o: Makefile.dep
 $(C_OBJ): %.o: .dep/%.d
 $(C_OBJ): %.o: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+       $(CC) $(CFLAGS) -c -o $@ $<
 
 $(CPP_OBJ): %.o: %.cpp
-       $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+       $(CC) $(CFLAGS) -c -o $@ $<
 
 $(ASM_OBJ): %.o: Makefile.dep
 $(ASM_OBJ): %.o: %.S
@@ -353,54 +451,82 @@ $(ASM_OBJ): %.o: %.S
 #$(PLUGIN_OBJ): %.so: Makefile.dep
 #$(PLUGIN_OBJ): %.so: .dep/%.d
 
-# audio plugins
-plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
-ifeq ($(SYS),beos)
-       $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
-else
-       $(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
-endif
+lib/beos.so: $(PLUGIN_BEOS)
+       $(CC) $(CFLAGS) $(LCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+$(PLUGIN_BEOS): %.o: %.cpp
+       $(CC) $(CFLAGS) -c -o $@ $<
 
-plugins/aout/aout_esd.so: %.so: %.c
+lib/esd.so: $(PLUGIN_ESD)
 ifneq (,$(findstring bsd,$(SYS)))
-       $(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
+       ld -shared -lesd -o $@ $^
 else
-       $(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
+       ld -shared -laudiofile -lesd -o $@ $^
 endif
+$(PLUGIN_ESD): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
 
-# video plugins
-plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
-       plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
-ifeq ($(SYS),beos)
-       $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
-else
-       $(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
-endif
+lib/dsp.so: $(PLUGIN_DSP)
+       ld -shared -o $@ $^
+$(PLUGIN_DSP): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
 
-plugins/intf/intf_x11.so plugins/vout/vout_x11.so: %.so: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
+lib/dummy.so: $(PLUGIN_DUMMY)
+       ld -shared -o $@ $^
+$(PLUGIN_DUMMY): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
 
-plugins/intf/intf_mga.so plugins/vout/vout_mga.so: %.so: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
+lib/fb.so: $(PLUGIN_FB)
+       ld -shared -o $@ $^
+$(PLUGIN_FB): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
 
-plugins/intf/intf_gnome.so: %.so: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) $(LCFLAGS) `gnome-config --libs --cflags gnomeui` -shared -o $@ $< plugins/intf/intf_gnome_callbacks.c plugins/intf/intf_gnome_interface.c plugins/intf/intf_gnome_support.c
+lib/x11.so: $(PLUGIN_X11)
+       ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
+$(PLUGIN_X11): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
 
-plugins/vout/vout_gnome.so: %.so: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
+lib/mga.so: $(PLUGIN_MGA)
+       ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
+$(PLUGIN_MGA): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
 
-plugins/intf/intf_glide.so plugins/vout/vout_glide.so: %.so: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
+lib/gnome.so: $(PLUGIN_GNOME)
+       ld -shared `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` -o $@ $^
+$(PLUGIN_GNOME): %.o: %.c
+       $(CC) $(CFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
 
-plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
+lib/glide.so: $(PLUGIN_GLIDE)
+       ld -shared -lglide2x -o $@ $^
+$(PLUGIN_GLIDE): %.o: %.c
+       $(CC) $(CFLAGS) -I/usr/include/glide -c -o $@ $<
 
-plugins/intf/intf_beos.so: %.so: %.cpp
-       $(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
+lib/ggi.so: $(PLUGIN_GGI)
+       ld -shared -lggi -o $@ $^
+$(PLUGIN_GGI): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+lib/sdl.so: $(PLUGIN_SDL)
+       ld -shared -lSDL -o $@ $^
+$(PLUGIN_SDL): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
+
+lib/yuv.so: $(PLUGIN_YUV)
+ifeq ($(SYS),beos)
+       $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+else
+       ld -shared -o $@ $^
+endif
+$(PLUGIN_YUV): %.o: %.c
+       $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
 
-plugins/vout/vout_beos.so: %.so: %.cpp
-       $(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
-               
+lib/yuvmmx.so: $(PLUGIN_YUVMMX)
+ifeq ($(SYS),beos)
+       $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+else
+       ld -shared -o $@ $^
+endif
+$(PLUGIN_YUVMMX): %.o: %.c
+       $(CC) $(CFLAGS) -c -o $@ $<
 
 ################################################################################
 # Note on generic rules and dependancies