]> git.sesse.net Git - vlc/blobdiff - Makefile
. portage des vlc_threads aux cthreads de Mach pour GNU/Hurd
[vlc] / Makefile
index 01373b35358bf5cc8740154c06e2b7e7219c5b02..7b6b985c04e3596f8f4c70f1c1f86abce520d85e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,14 +15,15 @@ SHELL=/bin/sh
 
 # Audio output settings
 AUDIO = dsp
-# Not yet supported
 #AUDIO += esd
+# Not yet supported
+#AUDIO += alsa
 # Fallback method that should always work
 AUDIO += dummy
 
 # Video output settings
 VIDEO = x11
-VIDEO += fb
+#VIDEO += fb
 #VIDEO += ggi
 #VIDEO += glide
 # Not yet supported
@@ -38,19 +39,24 @@ ARCH=X86
 
 # Target operating system
 SYS=LINUX
+#SYS=GNU
 #SYS=BSD
 #SYS=BEOS
 
 # For x86 architecture, choose MMX support
 MMX=YES
 #MMX=NO
+# For x86 architecture, optimize for Pentium Pro
+# (choose NO if you get `Invalid instruction' errors)
+PPRO=YES
+#PPRO=NO
 
 # Decoder choice - ?? old decoder will be removed soon
 #DECODER=old
 DECODER=new
 
 # Debugging mode on or off (set to 1 to activate)
-DEBUG=1
+DEBUG=0
 
 #----------------- do not change anything below this line ----------------------
 
@@ -59,17 +65,15 @@ DEBUG=1
 ################################################################################
 
 # Program version - may only be changed by the project leader
-PROGRAM_VERSION = 0.95.0
+PROGRAM_VERSION = 0.1.99
 
 # audio options
 audio := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z')
 AUDIO := $(shell echo $(AUDIO) | tr 'a-z' 'A-Z')
-DEFINE += $(AUDIO:%=-DAUDIO_%)
 
 # video options
 video := $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
 VIDEO := $(shell echo $(VIDEO) | tr 'a-z' 'A-Z')
-DEFINE += $(VIDEO:%=-DVIDEO_%)
 
 # PROGRAM_OPTIONS is an identification string of the compilation options
 PROGRAM_OPTIONS = $(ARCH) $(SYS)
@@ -103,31 +107,12 @@ endif
 #
 INCLUDE += -Iinclude
 
-ifneq (,$(findstring x11,$(video)))
-INCLUDE += -I/usr/X11R6/include
-endif
-
-ifneq (,$(findstring glide,$(video)))
-INCLUDE += -I/usr/include/glide
-endif
-
 #
 # Libraries
 #
 LIB += -lpthread
 LIB += -lm
-
-ifneq (,$(findstring x11,$(video)))
-LIB += -L/usr/X11R6/lib
-LIB += -lX11
-LIB += -lXext 
-endif
-ifneq (,$(findstring ggi,$(video)))
-LIB += -lggi
-endif
-ifneq (,$(findstring glide,$(video)))
-LIB += -lglide2x
-endif
+LIB += -ldl
 
 #
 # C compiler flags: compilation
@@ -140,13 +125,19 @@ CCFLAGS += -D_GNU_SOURCE
 # Optimizations : don't compile debug versions with them
 CCFLAGS += -O6
 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
-#CCFLAGS += -fomit-frame-pointer
+CCFLAGS += -fomit-frame-pointer
 
 # Optimizations for x86 familiy
 ifeq ($(ARCH),X86)
 CCFLAGS += -malign-double
-CCFLAGS += -march=pentiumpro
 #CCFLAGS += -march=pentium
+ifeq ($(PPRO), YES)
+CCFLAGS += -march=pentiumpro
+endif
+# Eventual MMX optimizations for x86
+ifeq ($(MMX), YES)
+CFLAGS += -DHAVE_MMX
+endif
 endif
 
 # Optimizations for PowerPC
@@ -172,17 +163,6 @@ LCFLAGS += $(LIB)
 LCFLAGS += -Wall
 #LCFLAGS += -s
 
-#
-# C compiler flags: common flags
-#
-
-# Eventual MMX optimizations for x86
-ifeq ($(ARCH),X86)
-ifeq ($(MMX), YES) # MMX is YES or AUTO
-CFLAGS += -DHAVE_MMX
-endif
-endif
-
 #
 # Additionnal debugging flags
 #
@@ -205,9 +185,7 @@ interface_obj =             interface/main.o \
                                                interface/intf_msg.o \
                                                interface/intf_cmd.o \
                                                interface/intf_ctrl.o \
-                                               interface/control.o \
-                                               interface/intf_console.o \
-                                               $(video:%=interface/intf_%.o)
+                                               interface/intf_console.o
 
 input_obj =                    input/input_vlan.o \
                                                input/input_file.o \
@@ -218,15 +196,14 @@ input_obj =                       input/input_vlan.o \
                                                input/input_psi.o \
                                                input/input.o
 
-audio_output_obj =             audio_output/audio_output.o \
-                                               $(audio:%=audio_output/aout_%.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_yuv.o \
-                                               $(video:%=video_output/vout_%.o)
+                                               video_output/video_yuv.o
 
-ac3_decoder_obj =              ac3_decoder/ac3_decoder.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 \
@@ -265,6 +242,7 @@ video_parser_obj =          video_parser/video_parser.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
 endif
 
@@ -301,10 +279,19 @@ endif
 endif
 endif
 
+#
+# Plugins
+#
+interface_plugin =     $(video:%=interface/intf_%.so)
+audio_plugin =         $(audio:%=audio_output/aout_%.so)
+video_plugin =                 $(video:%=video_output/vout_%.so)
+
+PLUGIN_OBJ = $(interface_plugin) $(audio_plugin) $(video_plugin)
+
 #
 # Other lists of files
 #
-sources := $(C_OBJ:%.o=%.c)
+sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c)
 dependancies := $(sources:%.c=dep/%.d)
 
 # All symbols must be exported
@@ -320,10 +307,10 @@ export
 all: vlc
 
 clean:
-       rm -f $(C_OBJ) $(ASM_OBJ)
+       rm -f $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
 
 distclean: clean
-       rm -f **/*.o **/*~ *.log
+       rm -f **/*.o **/*.so **/*~ *.log
        rm -f vlc gmon.out core
        rm -rf dep
 
@@ -339,8 +326,8 @@ FORCE:
 #
 # Real targets
 #
-vlc: $(C_OBJ) $(ASM_OBJ)
-       $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)    
+vlc: $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
+       $(CC) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(ASM_OBJ) 
 
 #
 # Generic rules (see below)
@@ -351,14 +338,45 @@ $(dependancies): %.d: FORCE
 $(C_OBJ): %.o: Makefile.dep
 $(C_OBJ): %.o: dep/%.d
 $(C_OBJ): %.o: %.c
-       @echo "compiling $*.c"
+       @echo "compiling $*.o from $*.c"
        @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
 
 $(ASM_OBJ): %.o: Makefile.dep
 $(ASM_OBJ): %.o: %.S
-       @echo "assembling $*.S"
+       @echo "assembling $*.o from $*.S"
        @$(CC) $(CFLAGS) -c -o $@ $<
 
+$(PLUGIN_OBJ): %.so: Makefile.dep
+$(PLUGIN_OBJ): %.so: dep/%.d
+
+# audio plugins
+audio_output/aout_dummy.so audio_output/aout_dsp.so: %.so: %.c
+               @echo "compiling $*.so from $*.c"
+               @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
+
+audio_output/aout_esd.so: %.so: %.c
+               @echo "compiling $*.so from $*.c"
+               @$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
+
+# video plugins
+interface/intf_dummy.so video_output/vout_dummy.so \
+       interface/intf_fb.so video_output/vout_fb.so: %.so: %.c
+               @echo "compiling $*.so from $*.c"
+               @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
+
+interface/intf_x11.so video_output/vout_x11.so: %.so: %.c
+               @echo "compiling $*.so from $*.c"
+               @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
+
+interface/intf_glide.so video_output/vout_glide.so: %.so: %.c
+               @echo "compiling $*.so from $*.c"
+               @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
+
+interface/intf_ggi.so video_output/vout_ggi.so: %.so: %.c
+               @echo "compiling $*.so from $*.c"
+               @$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
+
+
 ################################################################################
 # Note on generic rules and dependancies
 ################################################################################