]> git.sesse.net Git - vlc/blobdiff - Makefile
La plupart des causes de segfault de la video ont �t� �limin�es, les messages
[vlc] / Makefile
index 0b83c17526cd11e8d8d6a1f3f79ac749e0e5aba2..01373b35358bf5cc8740154c06e2b7e7219c5b02 100644 (file)
--- a/Makefile
+++ b/Makefile
 ################################################################################
 
 # Environment
-#CC = gcc
-#SHELL = /bin/sh
+CC=egcc
+SHELL=/bin/sh
+
+# Audio output settings
+AUDIO = dsp
+# Not yet supported
+#AUDIO += esd
+# Fallback method that should always work
+AUDIO += dummy
 
 # Video output settings
-VIDEO=X11
-#VIDEO=DGA (not yet supported)
-#VIDEO=FB
-#VIDEO=GGI (not yet supported)
-#VIDEO=BEOS (not yet supported)
-
-# Target architecture and optimization
-#ARCH=
-ARCH=MMX
+VIDEO = x11
+VIDEO += fb
+#VIDEO += ggi
+#VIDEO += glide
+# Not yet supported
+#VIDEO += beos
+#VIDEO += dga
+# Fallback method that should always work
+VIDEO += dummy
+
+# Target architecture
+ARCH=X86
 #ARCH=PPC
+#ARCH=SPARC
+
+# Target operating system
+SYS=LINUX
+#SYS=BSD
+#SYS=BEOS
+
+# For x86 architecture, choose MMX support
+MMX=YES
+#MMX=NO
 
 # Decoder choice - ?? old decoder will be removed soon
-DECODER=old
-#DECODER=new
+#DECODER=old
+DECODER=new
+
+# Debugging mode on or off (set to 1 to activate)
+DEBUG=1
 
 #----------------- do not change anything below this line ----------------------
 
@@ -35,45 +58,76 @@ DECODER=old
 # Configuration pre-processing
 ################################################################################
 
-# DEFINE will contain all the constants definitions decided in Makefile
-DEFINE = -DVIDEO_$(VIDEO)
+# Program version - may only be changed by the project leader
+PROGRAM_VERSION = 0.95.0
+
+# audio options
+audio := $(shell echo $(AUDIO) | tr 'A-Z' 'a-z')
+AUDIO := $(shell echo $(AUDIO) | tr 'a-z' 'A-Z')
+DEFINE += $(AUDIO:%=-DAUDIO_%)
 
-# video is a lowercase version of VIDEO used for filenames
-video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
+# 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)
+ifeq ($(DEBUG),1)
+PROGRAM_OPTIONS += DEBUG
+endif
+
+# PROGRAM_BUILD is a complete identification of the build
+PROGRAM_BUILD = `date -R` $(USER)@`hostname`
+
+# DEFINE will contain some of the constants definitions decided in Makefile, 
+# including ARCH_xx and SYS_xx. It will be passed to C compiler.
+DEFINE += -DARCH_$(ARCH)
+DEFINE += -DSYS_$(SYS)
+DEFINE += -DAUDIO_OPTIONS="\"$(audio)\""
+DEFINE += -DVIDEO_OPTIONS="\"$(video)\""
+DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\""
+DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\""
+DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
+ifeq ($(DEBUG),1)
+DEFINE += -DDEBUG
+endif
 
 ################################################################################
-# Tunning and other variables
+# Tuning and other variables - do not change anything except if you know
+# exactly what you are doing
 ################################################################################
 
-#
-# Transformation for video decompression (Fourier or cosine)
-#
-TRANSFORM=vdec_idct
-#TRANSFORM=vdec_idft
-
 #
 # C headers directories
 #
 INCLUDE += -Iinclude
 
-ifeq ($(VIDEO),X11)
-INCLUDE += -I/usr/X11R6/include/X11
+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
 
-ifeq ($(VIDEO),X11)
+ifneq (,$(findstring x11,$(video)))
 LIB += -L/usr/X11R6/lib
 LIB += -lX11
 LIB += -lXext 
-LIB += -lXpm
 endif
-
-# System dependant libraries
-#??LIB += -lXxf86dga
+ifneq (,$(findstring ggi,$(video)))
+LIB += -lggi
+endif
+ifneq (,$(findstring glide,$(video)))
+LIB += -lglide2x
+endif
 
 #
 # C compiler flags: compilation
@@ -86,27 +140,25 @@ 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 -s
+#CCFLAGS += -fomit-frame-pointer
 
-# Optimizations for x86 familiy, without MMX
-ifeq ($(ARCH),)
+# Optimizations for x86 familiy
+ifeq ($(ARCH),X86)
 CCFLAGS += -malign-double
 CCFLAGS += -march=pentiumpro
 #CCFLAGS += -march=pentium
 endif
 
-# Optimization for x86 with MMX support
-ifeq ($(ARCH),MMX)
-CCFLAGS += -malign-double
-CCFLAGS += -march=pentiumpro
-endif
-
 # Optimizations for PowerPC
 ifeq ($(ARCH),PPC)
 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
 endif
 
+# Optimizations for Sparc
+ifeq ($(ARCH),SPARC)
+CCFLAGS += -mhard-float
+endif
+
 #
 # C compiler flags: dependancies
 #
@@ -124,29 +176,29 @@ LCFLAGS += -Wall
 # C compiler flags: common flags
 #
 
-# Optimizations for x86 with MMX support
-ifeq ($(ARCH),MMX)
+# Eventual MMX optimizations for x86
+ifeq ($(ARCH),X86)
+ifeq ($(MMX), YES) # MMX is YES or AUTO
 CFLAGS += -DHAVE_MMX
 endif
+endif
 
 #
 # Additionnal debugging flags
 #
-# Debugging settings: electric fence, debuging symbols and profiling support. 
-# Note that electric fence and accurate profiling are quite uncompatible.
-#CCFLAGS += -g
-#CCFLAGS += -pg
-#LCFLAGS += -g 
-#LCFLAGS += -pg
-#LIB += -ldmalloc
-#LIB += -lefence
+
+# Debugging support
+ifeq ($(DEBUG),1)
+CFLAGS += -g
+#CFLAGS += -pg
+endif
 
 #################################################################################
 # Objects and files
 #################################################################################
 
 #
-# Objects
+# Objects
 # 
 interface_obj =                interface/main.o \
                                                interface/interface.o \
@@ -155,7 +207,7 @@ interface_obj =             interface/main.o \
                                                interface/intf_ctrl.o \
                                                interface/control.o \
                                                interface/intf_console.o \
-                                               interface/intf_$(video).o
+                                               $(video:%=interface/intf_%.o)
 
 input_obj =                    input/input_vlan.o \
                                                input/input_file.o \
@@ -167,18 +219,32 @@ input_obj =                       input/input_vlan.o \
                                                input/input.o
 
 audio_output_obj =             audio_output/audio_output.o \
-                                               audio_output/audio_dsp.o
+                                               $(audio:%=audio_output/aout_%.o)
 
 video_output_obj =             video_output/video_output.o \
-                                               video_output/video_$(video).o
+                                               video_output/video_text.o \
+                                               video_output/video_yuv.o \
+                                               $(video:%=video_output/vout_%.o)
+
+ac3_decoder_obj =              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
 
 audio_decoder_obj =            audio_decoder/audio_decoder.o \
                                                audio_decoder/audio_math.o
 
+spu_decoder_obj =              spu_decoder/spu_decoder.o
+
 #??generic_decoder_obj =               generic_decoder/generic_decoder.o
 # remeber to add it to OBJ 
 
 ifeq ($(DECODER),old)
+CFLAGS += -DOLD_DECODER
 video_decoder_obj =            video_decoder_ref/video_decoder.o \
                                                video_decoder_ref/display.o \
                                                video_decoder_ref/getblk.o \
@@ -194,39 +260,47 @@ else
 video_parser_obj =             video_parser/video_parser.o \
                                                video_parser/vpar_headers.o \
                                                video_parser/vpar_blocks.o \
-                                               video_parser/vpar_motion.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/$(TRANSFORM).o
+                                               video_decoder/vdec_idct.o
 endif
 
 misc_obj =                     misc/mtime.o \
                                                misc/rsc_files.o \
-                                               misc/netutils.o
-
-ifeq ($(VIDEO),X11)
-misc_obj+=                     misc/xutils.o
-endif
-
-ifeq ($(ARCH),MMX)
-ASM_OBJ =                      video_decoder_ref/idctmmx.o \
-                                               video_decoder_ref/yuv12-rgb16.o
-endif
+                                               misc/netutils.o \
+                                               misc/decoder_fifo.o
 
 C_OBJ = $(interface_obj) \
                $(input_obj) \
                $(audio_output_obj) \
                $(video_output_obj) \
+               $(ac3_decoder_obj) \
                $(audio_decoder_obj) \
+               $(spu_decoder_obj) \
                $(generic_decoder_obj) \
                $(video_parser_obj) \
                $(video_decoder_obj) \
                $(vlan_obj) \
                $(misc_obj)
 
+#
+# Assembler Objects
+# 
+ifeq ($(ARCH),X86)
+ifeq ($(MMX), YES)
+ifeq ($(DECODER),new)
+ASM_OBJ =                      video_decoder/vdec_idctmmx.o \
+                                               video_output/video_yuv_mmx.o
+else
+ASM_OBJ =                      video_decoder_ref/vdec_idctmmx.o \
+                                               video_output/video_yuv_mmx.o
+endif
+endif
+endif
+
 #
 # Other lists of files
 #
@@ -253,26 +327,37 @@ distclean: clean
        rm -f vlc gmon.out core
        rm -rf dep
 
+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>"
+
 FORCE:
 
 #
 # Real targets
 #
 vlc: $(C_OBJ) $(ASM_OBJ)
-       $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
+       $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)    
 
 #
 # Generic rules (see below)
 #
 $(dependancies): %.d: FORCE
-       @make -s --no-print-directory -f Makefile.dep $@
+       @$(MAKE) -s --no-print-directory -f Makefile.dep $@
 
+$(C_OBJ): %.o: Makefile.dep
 $(C_OBJ): %.o: dep/%.d
-
 $(C_OBJ): %.o: %.c
-       $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+       @echo "compiling $*.c"
+       @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+
+$(ASM_OBJ): %.o: Makefile.dep
 $(ASM_OBJ): %.o: %.S
-       $(CC) $(CFLAGS) -c -o $@ $<
+       @echo "assembling $*.S"
+       @$(CC) $(CFLAGS) -c -o $@ $<
 
 ################################################################################
 # Note on generic rules and dependancies