# Configuration
################################################################################
+# Environment
#CC = gcc
#SHELL = /bin/sh
+# Video output settings
+VIDEO=X11
+#VIDEO=DGA (not yet supported)
+#VIDEO=FB
+#VIDEO=GGI
+#VIDEO=BEOS (not yet supported)
+
+# Target architecture and optimization
+#ARCH=
+ARCH=MMX
+#ARCH=PPC
+
+# 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
+
+#----------------- do not change anything below this line ----------------------
+
+################################################################################
+# Configuration pre-processing
+################################################################################
+
+# DEFINE will contain all the constants definitions decided in Makefile
+DEFINE = -DVIDEO_$(VIDEO)
+
+# video is a lowercase version of VIDEO used for filenames
+video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
+
################################################################################
-# Settings and other variables
+# Tunning and other variables
################################################################################
+#
+# Transformation for video decompression (Fourier or cosine)
+#
+TRANSFORM=vdec_idct
+#TRANSFORM=vdec_idft
+
#
# C headers directories
#
INCLUDE += -Iinclude
-INCLUDE += -I/usr/X11R6/include/X11
+
+ifeq ($(VIDEO),X11)
+INCLUDE += -I/usr/X11R6/include
+endif
#
# Libraries
#
+LIB += -lpthread
+LIB += -lm
+
+ifeq ($(VIDEO),X11)
LIB += -L/usr/X11R6/lib
LIB += -lX11
LIB += -lXext
-LIB += -lpthread
-LIB += -lXpm
+endif
+ifeq ($(VIDEO),GGI)
+LIB += -lggi
+endif
+
+# System dependant libraries
+#??LIB += -lXxf86dga
#
# C compiler flags: compilation
#
-CCFLAGS += $(INCLUDE)
+CCFLAGS += $(DEFINE) $(INCLUDE)
CCFLAGS += -Wall
CCFLAGS += -D_REENTRANT
CCFLAGS += -D_GNU_SOURCE
# Optimizations : don't compile debug versions with them
-#CCFLAGS += -O2
-#CCFLAGS += -O8
-#CCFLAGS += -s -fargument-noalias-global -fexpensive-optimizations -ffast-math -funroll-loops -fomit-frame-pointer #-march=pentiumpro
-#(Uncomment -march=pentiumpro if it applies)
-
+CCFLAGS += -O6
+CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
+CCFLAGS += -fomit-frame-pointer
+#CCFLAGS += -fomit-frame-pointer -s
+
+# Optimizations for x86 familiy, without MMX
+ifeq ($(ARCH),)
+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
#
# C compiler flags: dependancies
#
LCFLAGS += $(LIB)
LCFLAGS += -Wall
-
-#
-# C compiler flags: functions flow
-#
-FCFLAGS += $(INCLUDE)
-FCFLAGS += -A
-FCFLAGS += -P
-FCFLAGS += -v
-FCFLAGS += -a
-FCFLAGS += -X errno.h
-FCFLAGS += -X fcntl.h
-FCFLAGS += -X signal.h
-FCFLAGS += -X stdio.h
-FCFLAGS += -X stdlib.h
-FCFLAGS += -X string.h
-FCFLAGS += -X unistd.h
-FCFLAGS += -X sys/ioctl.h
-FCFLAGS += -X sys/stat.h
-FCFLAGS += -X X11/Xlib.h
-FFILTER = grep -v "intf_.*Msg.*\.\.\."
+#LCFLAGS += -s
#
# C compiler flags: common flags
#
-# CFLAGS
+
+# Optimizations for x86 with MMX support
+ifeq ($(ARCH),MMX)
+CFLAGS += -DHAVE_MMX
+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
+#CCFLAGS += -g
+#CCFLAGS += -pg
+#LCFLAGS += -g
+#LCFLAGS += -pg
#LIB += -ldmalloc
#LIB += -lefence
interface/intf_cmd.o \
interface/intf_ctrl.o \
interface/control.o \
- interface/xconsole.o
+ interface/intf_console.o \
+ interface/intf_$(video).o
input_obj = input/input_vlan.o \
input/input_file.o \
audio_output/audio_dsp.o
video_output_obj = video_output/video_output.o \
- video_output/video_x11.o \
- video_output/video_graphics.o
+ video_output/video_$(video).o \
+ video_output/video_yuv.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
-generic_decoder_obj = generic_decoder/generic_decoder.o
-
-video_decoder_obj = video_decoder/video_decoder.o
+subtitle_decoder_obj = subtitle_decoder/subtitle_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 \
+ video_decoder_ref/gethdr.o \
+ video_decoder_ref/getpic.o \
+ video_decoder_ref/getvlc.o \
+ video_decoder_ref/idct.o \
+ video_decoder_ref/motion.o \
+ video_decoder_ref/mpeg2dec.o \
+ video_decoder_ref/recon.o \
+ video_decoder_ref/spatscal.o
+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
+endif
misc_obj = misc/mtime.o \
- misc/xutils.o \
misc/rsc_files.o \
misc/netutils.o
-OBJ = $(interface_obj) \
+ifeq ($(ARCH),MMX)
+ASM_OBJ = video_decoder_ref/idctmmx.o \
+ video_output/video_yuv_mmx.o
+endif
+
+C_OBJ = $(interface_obj) \
$(input_obj) \
$(audio_output_obj) \
$(video_output_obj) \
+ $(ac3_decoder_obj) \
$(audio_decoder_obj) \
+ $(subtitle_decoder_obj) \
$(generic_decoder_obj) \
+ $(video_parser_obj) \
$(video_decoder_obj) \
$(vlan_obj) \
$(misc_obj)
-
#
# Other lists of files
#
-sources := $(OBJ:%.o=%.c)
+sources := $(C_OBJ:%.o=%.c)
dependancies := $(sources:%.c=dep/%.d)
# All symbols must be exported
all: vlc
clean:
- rm -f $(OBJ)
+ rm -f $(C_OBJ) $(ASM_OBJ)
distclean: clean
rm -f **/*.o **/*~ *.log
- rm -f vlc gmon.out core Documentation/cflow
+ rm -f vlc gmon.out core
rm -rf dep
FORCE:
#
# Real targets
#
-vlc: $(OBJ)
- $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(OBJ)
-
-Documentation/cflow: $(sources)
- cflow $(FCFLAGS) $(CFLAGS) $(sources) | $(FFILTER) > $@
+vlc: $(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: dep/%.d
-$(OBJ): %.o: dep/%.d
-$(OBJ): %.o: %.c
+$(C_OBJ): %.o: %.c
$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+$(ASM_OBJ): %.o: %.S
+ $(CC) $(CFLAGS) -c -o $@ $<
################################################################################
# Note on generic rules and dependancies