1 ################################################################################
2 # vlc (VideoLAN Client) main makefile
4 ################################################################################
5 # This makefile is the main makefile for the VideoLAN client.
6 ################################################################################
8 ################################################################################
10 ################################################################################
16 # Video output settings
18 #VIDEO=DGA (not yet supported)
21 #VIDEO=BEOS (not yet supported)
23 # Target architecture and optimization
28 # Decoder choice - ?? old decoder will be removed soon
32 #----------------- do not change anything below this line ----------------------
34 ################################################################################
35 # Configuration pre-processing
36 ################################################################################
38 # DEFINE will contain all the constants definitions decided in Makefile
39 DEFINE = -DVIDEO_$(VIDEO)
41 # video is a lowercase version of VIDEO used for filenames
42 video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
44 ################################################################################
45 # Tunning and other variables
46 ################################################################################
49 # Transformation for video decompression (Fourier or cosine)
55 # C headers directories
60 INCLUDE += -I/usr/X11R6/include
70 LIB += -L/usr/X11R6/lib
78 # System dependant libraries
82 # C compiler flags: compilation
84 CCFLAGS += $(DEFINE) $(INCLUDE)
86 CCFLAGS += -D_REENTRANT
87 CCFLAGS += -D_GNU_SOURCE
89 # Optimizations : don't compile debug versions with them
91 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
92 CCFLAGS += -fomit-frame-pointer
93 #CCFLAGS += -fomit-frame-pointer -s
95 # Optimizations for x86 familiy, without MMX
97 CCFLAGS += -malign-double
98 CCFLAGS += -march=pentiumpro
99 #CCFLAGS += -march=pentium
102 # Optimization for x86 with MMX support
104 CCFLAGS += -malign-double
105 CCFLAGS += -march=pentiumpro
108 # Optimizations for PowerPC
110 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
114 # C compiler flags: dependancies
116 DCFLAGS += $(INCLUDE)
120 # C compiler flags: linking
127 # C compiler flags: common flags
130 # Optimizations for x86 with MMX support
136 # Additionnal debugging flags
138 # Debugging settings: electric fence, debuging symbols and profiling support.
139 # Note that electric fence and accurate profiling are quite uncompatible.
147 #################################################################################
149 #################################################################################
154 interface_obj = interface/main.o \
155 interface/interface.o \
156 interface/intf_msg.o \
157 interface/intf_cmd.o \
158 interface/intf_ctrl.o \
159 interface/control.o \
160 interface/intf_console.o \
161 interface/intf_$(video).o
163 input_obj = input/input_vlan.o \
165 input/input_netlist.o \
166 input/input_network.o \
172 audio_output_obj = audio_output/audio_output.o \
173 audio_output/audio_dsp.o
175 video_output_obj = video_output/video_output.o \
176 video_output/video_$(video).o \
177 video_output/video_yuv_c.o
179 ac3_decoder_obj = ac3_decoder/ac3_decoder.o
181 audio_decoder_obj = audio_decoder/audio_decoder.o \
182 audio_decoder/audio_math.o
184 #??generic_decoder_obj = generic_decoder/generic_decoder.o
185 # remeber to add it to OBJ
187 ifeq ($(DECODER),old)
188 video_decoder_obj = video_decoder_ref/video_decoder.o \
189 video_decoder_ref/display.o \
190 video_decoder_ref/getblk.o \
191 video_decoder_ref/gethdr.o \
192 video_decoder_ref/getpic.o \
193 video_decoder_ref/getvlc.o \
194 video_decoder_ref/idct.o \
195 video_decoder_ref/motion.o \
196 video_decoder_ref/mpeg2dec.o \
197 video_decoder_ref/recon.o \
198 video_decoder_ref/spatscal.o
200 video_parser_obj = video_parser/video_parser.o \
201 video_parser/vpar_headers.o \
202 video_parser/vpar_blocks.o \
203 video_parser/vpar_motion.o \
204 video_parser/vpar_synchro.o \
205 video_parser/video_fifo.o
207 video_decoder_obj = video_decoder/video_decoder.o \
208 video_decoder/vdec_motion.o \
209 video_decoder/$(TRANSFORM).o
212 misc_obj = misc/mtime.o \
217 ASM_OBJ = video_decoder_ref/idctmmx.o \
218 video_output/video_yuv_mmx.o
221 C_OBJ = $(interface_obj) \
223 $(audio_output_obj) \
224 $(video_output_obj) \
226 $(audio_decoder_obj) \
227 $(generic_decoder_obj) \
228 $(video_parser_obj) \
229 $(video_decoder_obj) \
234 # Other lists of files
236 sources := $(C_OBJ:%.o=%.c)
237 dependancies := $(sources:%.c=dep/%.d)
239 # All symbols must be exported
242 ################################################################################
244 ################################################################################
252 rm -f $(C_OBJ) $(ASM_OBJ)
255 rm -f **/*.o **/*~ *.log
256 rm -f vlc gmon.out core
264 vlc: $(C_OBJ) $(ASM_OBJ)
265 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
268 # Generic rules (see below)
270 $(dependancies): %.d: FORCE
271 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
273 $(C_OBJ): %.o: dep/%.d
276 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
278 $(CC) $(CFLAGS) -c -o $@ $<
280 ################################################################################
281 # Note on generic rules and dependancies
282 ################################################################################
284 # Note on dependancies: each .c file is associated with a .d file, which
285 # depends of it. The .o file associated with a .c file depends of the .d, of the
286 # .c itself, and of Makefile. The .d files are stored in a separate dep/
288 # The dep directory should be ignored by CVS.
290 # Note on inclusions: depending of the target, the dependancies files must
291 # or must not be included. The problem is that if we ask make to include a file,
292 # and this file does not exist, it is made before it can be included. In a
293 # general way, a .d file should be included if and only if the corresponding .o
294 # needs to be re-made.
296 # Two makefiles are used: the main one (this one) has regular generic rules,
297 # except for .o files, for which it calls the object Makefile. Dependancies
298 # are not included in this file.
299 # The object Makefile known how to make a .o from a .c, and includes
300 # dependancies for the target, but only those required.