]> git.sesse.net Git - vlc/blobdiff - Makefile.in
* BeOS icon and MIME resources courtesy of Wade Majors <guru@startrek.com>.
[vlc] / Makefile.in
index 6d93cf520f0af45e4364f8900032211d588827f5..2a682b81e79f92b592318f0526407048f010f7a7 100644 (file)
@@ -28,10 +28,6 @@ libdir=@libdir@
 CC=@CC@
 SHELL=@SHELL@
 
-LIB_SDL=@LIB_SDL@
-LIB_GLIDE=@LIB_GLIDE@
-LIB_GGI=@LIB_GGI@
-
 #----------------- do not change anything below this line ----------------------
 
 ################################################################################
@@ -52,13 +48,16 @@ endif
 # PROGRAM_BUILD is a complete identification of the build
 # (we can't use fancy options with date since OSes like Solaris
 # or FreeBSD have strange date implementations)
-PROGRAM_BUILD = `date` $(USER)
+ifeq ($(SYS),beos)
 # XXX: beos does not support hostname (how lame...)
-#PROGRAM_BUILD = `date` $(USER)@`hostname`
+PROGRAM_BUILD = `date` $(USER)
+else
+PROGRAM_BUILD = `date` $(USER)@`hostname`
+endif
 
 # 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 += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr '[a-z].' '[A-Z]_')
 
 # On Linux activate 64-bit off_t (by default under BSD)
 ifneq (,$(findstring linux,$(SYS)))
@@ -73,27 +72,13 @@ endif
 #
 # C headers directories
 #
-INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
+INCLUDE += @INCLUDE@
+INCLUDE += -Iinclude -Iextras -I/usr/local/include
 
 #
 # Libraries
 #
-ifeq ($(SYS),gnu)
-LIB += -lthreads -ldl
-endif
-
-ifneq (,$(findstring bsd,$(SYS)))
-LIB += -pthread -lgnugetopt
-LIB += -L/usr/local/lib
-endif
-
-ifneq (,$(findstring linux,$(SYS)))
-LIB += -lpthread -ldl
-endif
-
-ifneq (,$(findstring solaris,$(SYS)))
-LIB += -ldl -lsocket -lnsl -lpthread
-endif
+LIB = @LIB@ -L/usr/local/lib
 
 ifeq ($(SYS),beos)
 LIB += -lbe -lroot -lgame
@@ -114,6 +99,10 @@ ifeq ($(SYS),beos)
 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
 endif
 
+ifneq (,$(findstring darwin,$(SYS)))
+CFLAGS += -traditional-cpp
+endif
+
 # Optimizations : don't compile debug versions with them
 ifeq ($(OPTIMS),1)
 CFLAGS += -O3
@@ -132,12 +121,7 @@ endif
 
 # Optimizations for PowerPC
 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
+CFLAGS += -mmultiple -mhard-float -mstring
 endif
 
 # Optimizations for Sparc
@@ -158,6 +142,19 @@ endif
 #
 PCFLAGS += -fPIC
 
+#
+# C compiler flags: plugin linking
+#
+ifneq (,$(findstring darwin,$(SYS)))
+PLCFLAGS += -bundle -undefined suppress
+else
+ifeq ($(SYS),beos)
+PLCFLAGS += -nostart plugins/_APP_
+else
+PLCFLAGS += -shared
+endif
+endif
+
 #
 # C compiler flags: dependancies
 #
@@ -167,10 +164,24 @@ DCFLAGS += -MM
 #
 # C compiler flags: linking
 #
-LCFLAGS += $(LIB)
+LCFLAGS += @LCFLAGS@ $(LIB)
 LCFLAGS += -Wall
 #LCFLAGS += -s
 
+ifeq ($(SYS),beos)
+LCFLAGS += -Xlinker -soname=_APP_
+else
+ifneq (,$(findstring qnx,$(SYS)))
+LCFLAGS += -Xlinker -export-dynamic
+else
+ifneq (,$(findstring darwin,$(SYS)))
+LCFLAGS += -dyn
+else
+LCFLAGS += --export-dynamic
+endif
+endif
+endif
+
 #
 # Debugging and profiling support (unless optimisations are active)
 #
@@ -204,7 +215,12 @@ INPUT =            src/input/input_ext-dec.o \
                src/input/input.o \
                src/input/mpeg_system.o
 
-AUDIO_OUTPUT =         src/audio_output/audio_output.o
+AUDIO_OUTPUT =         src/audio_output/audio_output.o \
+               src/audio_output/aout_fifo.o \
+               src/audio_output/aout_u8.o \
+               src/audio_output/aout_s8.o \
+               src/audio_output/aout_u16.o \
+               src/audio_output/aout_s16.o
 
 VIDEO_OUTPUT =         src/video_output/video_output.o \
                src/video_output/video_text.o \
@@ -249,7 +265,6 @@ MISC =              src/misc/mtime.o \
                src/misc/modules.o \
                src/misc/netutils.o
 
-
 C_OBJ =                $(INTERFACE) \
                $(INPUT) \
                $(VIDEO_OUTPUT) \
@@ -261,16 +276,21 @@ C_OBJ =           $(INTERFACE) \
                $(GEN_DECODER) \
                $(VIDEO_PARSER) \
                $(VIDEO_DECODER) \
-               $(MISC)
+               $(MISC) \
+               @GETOPT@
 
 
 #
-# CPP Objects
+# Misc Objects
 # 
 ifeq ($(SYS),beos)
 CPP_OBJ =      src/misc/beos_specific.o
 endif
 
+ifneq (,$(findstring darwin,$(SYS)))
+C_OBJ +=       src/misc/darwin_specific.o
+endif
+
 #
 # Assembler Objects
 # 
@@ -293,6 +313,8 @@ PLUGIN_BEOS =       plugins/beos/beos.o \
                plugins/beos/DrawingTidbits.o \
                plugins/beos/TransportButton.o
 
+PLUGIN_DARWIN =        plugins/darwin/darwin.o
+
 PLUGIN_DSP =   plugins/dsp/dsp.o \
                plugins/dsp/aout_dsp.o
 
@@ -321,6 +343,12 @@ PLUGIN_GGI =       plugins/ggi/ggi.o \
 PLUGIN_GLIDE = plugins/glide/glide.o \
                plugins/glide/vout_glide.o
 
+PLUGIN_GNOME = plugins/gnome/gnome.o \
+               plugins/gnome/intf_gnome.o \
+               plugins/gnome/gnome_callbacks.o \
+               plugins/gnome/gnome_interface.o \
+               plugins/gnome/gnome_support.o
+
 PLUGIN_GTK =   plugins/gtk/gtk.o \
                plugins/gtk/intf_gtk.o \
                plugins/gtk/gtk_callbacks.o \
@@ -328,45 +356,40 @@ PLUGIN_GTK =      plugins/gtk/gtk.o \
                plugins/gtk/gtk_support.o \
                plugins/gtk/gtk_playlist.o
 
-PLUGIN_GNOME = plugins/gnome/gnome.o \
-               plugins/gnome/intf_gnome.o \
-               plugins/gnome/gnome_callbacks.o \
-               plugins/gnome/gnome_interface.o \
-               plugins/gnome/gnome_support.o
+PLUGIN_IDCT =          plugins/idct/idct.o
 
-PLUGIN_QT =    plugins/qt/qt.o \
-               plugins/qt/intf_qt.o
+PLUGIN_IDCTCLASSIC =   plugins/idct/idctclassic.o
 
-PLUGIN_KDE =   plugins/kde/kde.o \
-               plugins/kde/intf_kde.o
+PLUGIN_IDCTMMX =       plugins/idct/idctmmx.o
 
-PLUGIN_IDCT =  plugins/idct/idct.o \
-               plugins/idct/idct_common.o
+PLUGIN_IDCTMMXEXT =    plugins/idct/idctmmxext.o
 
-PLUGIN_IDCTCLASSIC =   plugins/idct/idctclassic.o \
-                       plugins/idct/idct_common.o
+PLUGIN_IDCTALTIVEC =   plugins/idct/idctaltivec.o
 
-PLUGIN_IDCTMMX =       plugins/idct/idctmmx.o \
-                       plugins/idct/idct_common.o
+PLUGIN_IDCTCOMMON =    plugins/idct/idct_common.o
+
+PLUGIN_KDE =   plugins/kde/kde.o \
+               plugins/kde/intf_kde.o
 
-PLUGIN_IDCTMMXEXT =    plugins/idct/idctmmxext.o \
-                       plugins/idct/idct_common.o
+PLUGIN_MACOSX =        plugins/macosx/macosx.o \
+               plugins/macosx/intf_macosx.o \
+               plugins/macosx/aout_macosx.o \
+               plugins/macosx/vout_macosx.o
 
 PLUGIN_MGA =   plugins/mga/mga.o \
                plugins/mga/vout_mga.o
 
-PLUGIN_MOTION =        plugins/motion/motion.o \
-               plugins/motion/vdec_motion_common.o \
-               plugins/motion/vdec_motion_inner.o
+PLUGIN_MOTION =                plugins/motion/motion.o \
+                       plugins/motion/vdec_motion_inner.o
 
 PLUGIN_MOTIONMMX =     plugins/motion/motionmmx.o \
-                       plugins/motion/vdec_motion_common.o \
                        plugins/motion/vdec_motion_inner_mmx.o
 
 PLUGIN_MOTIONMMXEXT =  plugins/motion/motionmmxext.o \
-                       plugins/motion/vdec_motion_common.o \
                        plugins/motion/vdec_motion_inner_mmxext.o
 
+PLUGIN_MOTIONCOMMON =  plugins/motion/vdec_motion_common.o
+
 PLUGIN_NCURSES =       plugins/text/ncurses.o \
                        plugins/text/intf_ncurses.o
 
@@ -375,6 +398,9 @@ PLUGIN_NULL =       plugins/null/null.o
 PLUGIN_PS =    plugins/mpeg/ps.o \
                plugins/mpeg/input_ps.o
 
+PLUGIN_QT =    plugins/qt/qt.o \
+               plugins/qt/intf_qt.o
+
 PLUGIN_SDL =   plugins/sdl/sdl.o \
                plugins/sdl/vout_sdl.o \
                plugins/sdl/aout_sdl.o 
@@ -382,7 +408,10 @@ PLUGIN_SDL =       plugins/sdl/sdl.o \
 PLUGIN_TS =    plugins/mpeg/ts.o \
                plugins/mpeg/input_ts.o
 
-PLUGIN_X11=    plugins/x11/x11.o \
+PLUGIN_XVIDEO =        plugins/x11/xvideo.o \
+               plugins/x11/vout_xvideo.o
+
+PLUGIN_X11 =   plugins/x11/x11.o \
                plugins/x11/vout_x11.o
 
 PLUGIN_YUV =   plugins/yuv/yuv.o \
@@ -395,6 +424,7 @@ PLUGIN_YUVMMX =     plugins/yuv/yuvmmx.o \
 
 STD_PLUGIN_OBJ = \
                $(PLUGIN_ALSA) \
+               $(PLUGIN_DARWIN) \
                $(PLUGIN_DSP) \
                $(PLUGIN_DUMMY) \
                $(PLUGIN_DVD) \
@@ -405,31 +435,28 @@ STD_PLUGIN_OBJ = \
                $(PLUGIN_IDCTCLASSIC) \
                $(PLUGIN_IDCTMMX) \
                $(PLUGIN_IDCTMMXEXT) \
+               $(PLUGIN_IDCTCOMMON) \
                $(PLUGIN_MGA) \
                $(PLUGIN_MOTION) \
                $(PLUGIN_MOTIONMMX) \
                $(PLUGIN_MOTIONMMXEXT) \
+               $(PLUGIN_MOTIONCOMMON) \
                $(PLUGIN_NCURSES) \
                $(PLUGIN_NULL) \
                $(PLUGIN_PS) \
                $(PLUGIN_SDL) \
                $(PLUGIN_TS) \
-               $(PLUGIN_X11) \
                $(PLUGIN_YUV) \
                $(PLUGIN_YUVMMX)
 
-# list duplicates
-STD_PLUGIN_COMMON =    plugins/idct/idct_common.o \
-                       plugins/motion/vdec_motion_common.o
-
-# filter out duplicates from the plugin object lists
-STD_PLUGIN_OBJ :=      $(filter-out $(STD_PLUGIN_COMMON), \
-                                $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
-
 NONSTD_PLUGIN_OBJ = \
+               $(PLUGIN_X11) \
+               $(PLUGIN_XVIDEO) \
                $(PLUGIN_GLIDE) \
                $(PLUGIN_GTK) \
-               $(PLUGIN_GNOME)
+               $(PLUGIN_GNOME) \
+               $(PLUGIN_MACOSX) \
+               $(PLUGIN_IDCTALTIVEC)
 
 NONSTD_CPP_PLUGIN_OBJ = \
                $(PLUGIN_BEOS) \
@@ -454,19 +481,22 @@ export
 #
 # Virtual targets
 #
-all: vlc @ALIASES@ plugins
+all: vlc @ALIASES@ plugins vlc.app
 
 clean:
        rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
-       rm -f plugins/*/*.o src/*/*.o lib/*.so
-       rm -f vlc gvlc kvlc qvlc
+       rm -f plugins/*/*.o plugins/*/*.moc plugins/*/*.bak
+       rm -f src/*/*.o extras/*/*.o
+       rm -f lib/*.so vlc gnome-vlc gvlc kvlc qvlc
+       rm -rf vlc.app
 
 distclean: clean
-       rm -f src/*/*.o plugins/*/*.o **/*~ *.log
+       rm -f **/*.o **/*~ *.log
        rm -f Makefile include/defs.h include/config.h
        rm -f config.status config.cache config.log
        rm -f gmon.out core build-stamp
-       rm -rf .dep
+       rm -Rf .dep
+       rm -f .gdb_history
 
 install:
        mkdir -p $(DESTDIR)$(bindir)
@@ -480,6 +510,19 @@ install:
        $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
        $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
 
+ifneq (,$(findstring darwin,$(SYS)))
+# XXX this should only be for MacOS X
+#should the following be "$(DESTDIR)$(bindir)vlc.app/" or "$(DESTDIR)vlc.app/" ?
+       mkdir -p $(DESTDIR)$(bindir)vlc.app/Contents/MacOS
+       mkdir -p $(DESTDIR)$(bindir)vlc.app/Contents/MacOS/lib
+       mkdir -p $(DESTDIR)$(bindir)vlc.app/Contents/MacOS/share
+       $(INSTALL) -m 644 extras/MacOSX_app/Contents/Info.plist $(DESTDIR)$(bindir)vlc.app/Contents/
+       $(INSTALL) -m 644 extras/MacOSX_app/Contents/PkgInfo $(DESTDIR)$(bindir)vlc.app/Contents/
+       $(INSTALL) vlc $(DESTDIR)$(bindir)vlc.app/Contents/MacOS/
+       $(INSTALL) $(PLUGINS:%=lib/%.so) $(DESTDIR)$(bindir)vlc.app/Contents/MacOS/lib
+       $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(bindir)vlc.app/Contents/MacOS/share
+endif
+
 show:
        @echo CC: $(CC)
        @echo CFLAGS: $(CFLAGS)
@@ -495,29 +538,38 @@ show:
 
 # ugliest of all, but I have no time to do it -- sam
 snapshot:
-       rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
+       rm -Rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
        # copy archive in /tmp
        find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \
                do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
        done
        find debian -mindepth 1 -maxdepth 1 -type d | \
-               while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
+               while read i ; do rm -Rf /tmp/vlc-@VLC_VERSION@/$$i ; done
        # .c .h .in .cpp
        find include src plugins -type f -name '*.[chi]*' | while read i ; \
                do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
        done
+       # extra files
+       cp -a extras/* /tmp/vlc-@VLC_VERSION@/extras
+       cp -a doc/* /tmp/vlc-@VLC_VERSION@/doc
+       find /tmp/vlc-@VLC_VERSION@/extras /tmp/vlc-@VLC_VERSION@/doc \
+               -type d -name CVS | while read i ; \
+                       do rm -Rf $$i ; \
+               done
        # copy misc files
        cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO \
                Makefile.in Makefile.dep configure configure.in install-sh \
                config.sub config.guess todo.pl \
                        /tmp/vlc-@VLC_VERSION@/
        for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
-               changelog changelog-css rules rules-css vlc.1 vlc.dirs \
+               changelog changelog-css rules rules-css vlc.dirs \
                vlc.menu ; do \
                        cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
-       for file in default8x16.psf default8x9.psf gvlc.png vlc.png \
-               gvlc.xpm vlc.xpm ; do \
-                       cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
+       for file in default8x16.psf default8x9.psf vlc_beos.rsrc ; do \
+               cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
+       for icon in vlc gvlc qvlc gnome-vlc kvlc ; do \
+               cp share/$$icon.xpm share/$$icon.png \
+                       /tmp/vlc-@VLC_VERSION@/share/ ; done
 
        # build css-enabled archives
        (cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
@@ -527,7 +579,7 @@ snapshot:
        mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..
 
        # clean up
-       rm -rf /tmp/vlc-@VLC_VERSION@*
+       rm -Rf /tmp/vlc-@VLC_VERSION@*
 
 plugins: $(PLUGINS:%=lib/%.so)
 
@@ -537,7 +589,7 @@ FORCE:
 # GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat
 # the namespace
 #
-gvlc kvlc qvlc: vlc
+gnome-vlc gvlc kvlc qvlc: vlc
        rm -f $@ && ln -s vlc $@
 
 
@@ -553,7 +605,12 @@ $(cppdependancies): %.dpp: FORCE
 $(C_OBJ): %.o: Makefile.dep
 $(C_OBJ): %.o: .dep/%.d
 $(C_OBJ): %.o: %.c
+ifneq (,$(findstring darwin,$(SYS)))
+#this is uglier of all
+       @if test "src/ac3_decoder/ac3_imdct.c" = "$<"; then $(CC) `echo $(CFLAGS) | sed -e 's/-O3/-O/'` -c -o $@ $<; echo "(CC) `echo $(CFLAGS) | sed -e 's/-O3/-O/'` -c -o $@ $<"; else $(CC) $(CFLAGS) -c -o $@ $<; echo "$(CC) $(CFLAGS) -c -o $@ $<"; fi
+else
        $(CC) $(CFLAGS) -c -o $@ $<
+endif
 
 $(CPP_OBJ): %.o: Makefile.dep
 $(CPP_OBJ): %.o: .dep/%.dpp
@@ -569,6 +626,16 @@ $(STD_PLUGIN_OBJ): %.o: .dep/%.d
 $(STD_PLUGIN_OBJ): %.o: %.c
        $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
 
+$(PLUGIN_XVIDEO): %.o: Makefile.dep
+$(PLUGIN_XVIDEO): %.o: .dep/%.d
+$(PLUGIN_XVIDEO): %.o: %.c
+       $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/X11R6/include -c -o $@ $<
+
+$(PLUGIN_X11): %.o: Makefile.dep
+$(PLUGIN_X11): %.o: .dep/%.d
+$(PLUGIN_X11): %.o: %.c
+       $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/X11R6/include -c -o $@ $<
+
 $(PLUGIN_GTK): %.o: Makefile.dep
 $(PLUGIN_GTK): %.o: .dep/%.d
 $(PLUGIN_GTK): %.o: %.c
@@ -587,7 +654,7 @@ $(PLUGIN_GLIDE): %.o: %.c
 $(PLUGIN_QT): %.o: Makefile.dep
 $(PLUGIN_QT): %.o: .dep/%.dpp
 $(PLUGIN_QT): %.o: %.moc
-       $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -c -o $@ $(<:%.moc=%.cpp)
+       $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -I${QTDIR}/include -c -o $@ $(<:%.moc=%.cpp)
 $(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
        moc -i $< -o $@
 
@@ -601,157 +668,163 @@ $(PLUGIN_BEOS): %.o: .dep/%.dpp
 $(PLUGIN_BEOS): %.o: %.cpp
        $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
 
+$(PLUGIN_IDCTALTIVEC): %.o: Makefile.dep
+$(PLUGIN_IDCTALTIVEC): %.o: .dep/%.d
+$(PLUGIN_IDCTALTIVEC): %.o: %.c
+       $(CC) $(CFLAGS) $(PCFLAGS) -faltivec -c -o $@ $<
+
+$(PLUGIN_MACOSX): %.o: Makefile.dep
+$(PLUGIN_MACOSX): %.o: .dep/%.d
+$(PLUGIN_MACOSX): %.o: %.c
+       $(CC) $(CFLAGS) $(PCFLAGS) -fpascal-strings -c -o $@ $<
+
 #
 # Main application target
 #
 
 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
+       $(CC) $(CFLAGS) -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(LCFLAGS)
 ifeq ($(SYS),beos)
-       $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
        rm -f ./plugins/_APP_
        ln -s ../vlc ./plugins/_APP_
-else
-       $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) 
+       xres -o $@ ./share/vlc_beos.rsrc
+       mimeset -f $@
+endif
+
+vlc.app:
+ifneq (,$(findstring darwin,$(SYS)))
+       mkdir -p vlc.app/Contents/MacOS
+       mkdir -p vlc.app/Contents/MacOS/lib
+       mkdir -p vlc.app/Contents/MacOS/share
+       $(INSTALL) -m 644 extras/MacOSX_app/Contents/Info.plist vlc.app/Contents/
+       $(INSTALL) -m 644 extras/MacOSX_app/Contents/PkgInfo vlc.app/Contents/
+       $(INSTALL) vlc vlc.app/Contents/MacOS/
+       $(INSTALL) $(PLUGINS:%=lib/%.so) vlc.app/Contents/MacOS/lib
+       $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
 endif
 
 #
 # Plugin targets
 #
 
+lib/alsa.so: $(PLUGIN_ALSA)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lasound
+
 lib/beos.so: $(PLUGIN_BEOS)
-       $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot -ltracker
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lbe -lgame -lroot -ltracker
 
 lib/esd.so: $(PLUGIN_ESD)
 ifneq (,$(findstring bsd,$(SYS)))
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lesd
 else
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -laudiofile -lesd
 endif
 
-lib/dsp.so: $(PLUGIN_DSP)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
+lib/darwin.so: $(PLUGIN_DARWIN)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework CoreAudio
 
-lib/qt.so: $(PLUGIN_QT)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -lqt
+lib/dsp.so: $(PLUGIN_DSP)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/kde.so: $(PLUGIN_KDE)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -lkdeui -lkdecore -lqt -ldl
+lib/dummy.so: $(PLUGIN_DUMMY)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/alsa.so: $(PLUGIN_ALSA)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -lasound
+lib/dvd.so: $(PLUGIN_DVD)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 lib/fb.so: $(PLUGIN_FB)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/x11.so: $(PLUGIN_X11)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/mga.so: $(PLUGIN_MGA)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
+lib/ggi.so: $(PLUGIN_GGI)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_GGI@
 
-lib/gtk.so: $(PLUGIN_GTK)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`
+lib/glide.so: $(PLUGIN_GLIDE)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_GLIDE@
 
 lib/gnome.so: $(PLUGIN_GNOME)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
-
-lib/glide.so: $(PLUGIN_GLIDE)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
 
-lib/ggi.so: $(PLUGIN_GGI)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
+lib/gtk.so: $(PLUGIN_GTK)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) `gtk-config --libs gtk | sed 's,-rdynamic,,'`
 
-lib/sdl.so: $(PLUGIN_SDL)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
+lib/idct.so: $(PLUGIN_IDCT) $(PLUGIN_IDCTCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/ncurses.so: $(PLUGIN_NCURSES)
-       $(CC) $(PCFLAGS) -shared -o $@ $^ -lncurses
+lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-ifeq ($(SYS),beos)
-lib/null.so: $(PLUGIN_NULL)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/ps.so: $(PLUGIN_PS)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/ts.so: $(PLUGIN_TS)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework vecLib
 
-lib/dvd.so: $(PLUGIN_DVD)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/kde.so: $(PLUGIN_KDE)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lkdeui -lkdecore -lqt -ldl
 
-lib/dummy.so: $(PLUGIN_DUMMY)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/macosx.so: $(PLUGIN_MACOSX)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework CoreAudio -framework Carbon -framework AGL
 
-lib/yuv.so: $(PLUGIN_YUV)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/mga.so: $(PLUGIN_MGA)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext
 
-lib/yuvmmx.so: $(PLUGIN_YUVMMX)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/motion.so: $(PLUGIN_MOTION) $(PLUGIN_MOTIONCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/motion.so: $(PLUGIN_MOTION)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/motionmmx.so: $(PLUGIN_MOTIONMMX) $(PLUGIN_MOTIONCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT) $(PLUGIN_MOTIONCOMMON)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/ncurses.so: $(PLUGIN_NCURSES)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lncurses
 
-lib/idct.so: $(PLUGIN_IDCT)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/null.so: $(PLUGIN_NULL)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/ps.so: $(PLUGIN_PS)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
-lib/idctmmx.so: $(PLUGIN_IDCTMMX)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/qt.so: $(PLUGIN_QT)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lqt -L${QTDIR}/lib
 
-lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+lib/sdl.so: $(PLUGIN_SDL)
+ifneq (,$(findstring darwin,$(SYS)))
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_SDL@ -framework Carbon -framework AGL
 else
-lib/null.so: $(PLUGIN_NULL)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/ps.so: $(PLUGIN_PS)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_SDL@
+endif
 
 lib/ts.so: $(PLUGIN_TS)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
+ifneq (,$(findstring darwin,$(SYS)))
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -framework AGL -framework Carbon
+else
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
+endif
 
-lib/dvd.so: $(PLUGIN_DVD)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
+lib/xvideo.so: $(PLUGIN_XVIDEO)
+ifeq ($(SYS),nto-qnx)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXv -lsocket
+else
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXv
+endif
 
-lib/dummy.so: $(PLUGIN_DUMMY)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
+lib/x11.so: $(PLUGIN_X11)
+ifeq ($(SYS),nto-qnx)
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lsocket
+else
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext
+endif
 
 lib/yuv.so: $(PLUGIN_YUV)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/motion.so: $(PLUGIN_MOTION)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/idct.so: $(PLUGIN_IDCT)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/idctmmx.so: $(PLUGIN_IDCTMMX)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-
-lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
-       $(CC) $(PCFLAGS) -shared -o $@ $^
-endif
+       $(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) 
 
 ################################################################################
 # Note on generic rules and dependancies