]> git.sesse.net Git - vlc/blobdiff - Makefile
. remis le kludge du i_coding_type == I_CODING_TYPE en attendant qu'on
[vlc] / Makefile
index 797b9f5935bad2411c37a8d49e7cb5f78531a0c1..5e1bdbf944d35ac638cb9a6743599f813c42f466 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,8 +10,8 @@
 ################################################################################
 
 # Environment
-#CC = gcc
-#SHELL = /bin/sh
+#CC=gcc
+#SHELL=/bin/sh
 
 # Video output settings
 VIDEO=X11
@@ -26,11 +26,17 @@ ARCH=MMX
 #ARCH=PPC
 #ARCH=SPARC
 
+# Target operating system
+SYS=LINUX
+#SYS=BSD
+#SYS=BEOS
+
 # Decoder choice - ?? old decoder will be removed soon
-DECODER=old
-#DECODER=new
-# !!! don't forget to run this command after changing decoder type !!!
-# touch input/input.c input/input_ctrl.c include/vlc.h include/video_decoder.h
+#DECODER=old
+DECODER=new
+
+# Debugging mode on or off (set to 1 to activate)
+DEBUG=1
 
 #----------------- do not change anything below this line ----------------------
 
@@ -38,22 +44,38 @@ 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 = 1.0-dev
+
+# PROGRAM_OPTIONS is an identification string of the compilation options
+PROGRAM_OPTIONS = $(VIDEO) $(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 VIDEO_xx and ARCH_xx. It will be passed to C compiler.
+DEFINE += -DVIDEO_$(VIDEO) 
+DEFINE += -DARCH_$(ARCH)
+DEFINE += -DSYS_$(SYS)
+DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\""
+DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\""
+DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
+ifeq ($(DEBUG),1)
+DEFINE += -DDEBUG
+endif
 
 # video is a lowercase version of VIDEO used for filenames
 video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
 
 ################################################################################
-# Tunning and other variables
+# Tunning 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
 #
@@ -67,7 +89,7 @@ endif
 # Libraries
 #
 LIB += -lpthread
-LIB += -lm
+LIN += -lm
 
 ifeq ($(VIDEO),X11)
 LIB += -L/usr/X11R6/lib
@@ -78,9 +100,6 @@ ifeq ($(VIDEO),GGI)
 LIB += -lggi
 endif
 
-# System dependant libraries
-#??LIB += -lXxf86dga
-
 #
 # C compiler flags: compilation
 #
@@ -90,7 +109,6 @@ CCFLAGS += -D_REENTRANT
 CCFLAGS += -D_GNU_SOURCE
 
 # Optimizations : don't compile debug versions with them
-CCFLAGS += -g
 CCFLAGS += -O6
 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
 CCFLAGS += -fomit-frame-pointer
@@ -143,21 +161,19 @@ 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 \
@@ -182,6 +198,7 @@ audio_output_obj =          audio_output/audio_output.o \
 
 video_output_obj =             video_output/video_output.o \
                                                video_output/video_$(video).o \
+                                               video_output/video_text.o \
                                                video_output/video_yuv.o
 
 ac3_decoder_obj =              ac3_decoder/ac3_decoder.o \
@@ -196,7 +213,7 @@ ac3_decoder_obj =           ac3_decoder/ac3_decoder.o \
 audio_decoder_obj =            audio_decoder/audio_decoder.o \
                                                audio_decoder/audio_math.o
 
-subtitle_decoder_obj =         subtitle_decoder/subtitle_decoder.o
+spu_decoder_obj =              spu_decoder/spu_decoder.o
 
 #??generic_decoder_obj =               generic_decoder/generic_decoder.o
 # remeber to add it to OBJ 
@@ -218,43 +235,44 @@ 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 ($(ARCH),MMX)
-ifeq ($(DECODER),old)
-ASM_OBJ =                      video_decoder_ref/idctmmx.o \
-                                               video_output/video_yuv_mmx.o
-else
-ASM_OBJ =                      video_decoder/idctmmx.o \
-                                               video_output/video_yuv_mmx.o
-endif
-
-endif
-
 C_OBJ = $(interface_obj) \
                $(input_obj) \
                $(audio_output_obj) \
                $(video_output_obj) \
                $(ac3_decoder_obj) \
                $(audio_decoder_obj) \
-               $(subtitle_decoder_obj) \
+               $(spu_decoder_obj) \
                $(generic_decoder_obj) \
                $(video_parser_obj) \
                $(video_decoder_obj) \
                $(vlan_obj) \
                $(misc_obj)
 
+#
+# Assembler Objects
+# 
+ifeq ($(ARCH),MMX)
+ifeq ($(DECODER),old)
+ASM_OBJ =                      video_decoder_ref/idctmmx.o \
+                                               video_output/video_yuv_mmx.o
+else
+ASM_OBJ =                      video_decoder/idctmmx.o \
+                                               video_output/video_yuv_mmx.o
+endif
+endif
+
 #
 # Other lists of files
 #
@@ -281,13 +299,20 @@ 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)
@@ -295,12 +320,16 @@ vlc: $(C_OBJ) $(ASM_OBJ)
 $(dependancies): %.d: FORCE
        @$(MAKE) -s --no-print-directory -f Makefile.dep $@
 
+$(C_OBJ): %.o: Makefile 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 Makefile.dep
 $(ASM_OBJ): %.o: %.S
-       $(CC) $(CFLAGS) -c -o $@ $<
+       @echo "assembling $*.S"
+       @$(CC) $(CFLAGS) -c -o $@ $<
 
 ################################################################################
 # Note on generic rules and dependancies