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
29 # Decoder choice - ?? old decoder will be removed soon
32 # !!! don't forget to run this command after changing decoder type !!!
33 # touch input/input.c input/input_ctrl.c include/vlc.h include/video_decoder.h
35 #----------------- do not change anything below this line ----------------------
37 ################################################################################
38 # Configuration pre-processing
39 ################################################################################
41 # DEFINE will contain all the constants definitions decided in Makefile
42 DEFINE = -DVIDEO_$(VIDEO)
44 # video is a lowercase version of VIDEO used for filenames
45 video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
47 ################################################################################
48 # Tunning and other variables
49 ################################################################################
52 # Transformation for video decompression (Fourier or cosine)
58 # C headers directories
63 INCLUDE += -I/usr/X11R6/include
73 LIB += -L/usr/X11R6/lib
81 # System dependant libraries
85 # C compiler flags: compilation
87 CCFLAGS += $(DEFINE) $(INCLUDE)
89 CCFLAGS += -D_REENTRANT
90 CCFLAGS += -D_GNU_SOURCE
92 # Optimizations : don't compile debug versions with them
95 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
96 CCFLAGS += -fomit-frame-pointer
98 # Optimizations for x86 familiy, without MMX
100 CCFLAGS += -malign-double
101 CCFLAGS += -march=pentiumpro
102 #CCFLAGS += -march=pentium
105 # Optimization for x86 with MMX support
107 CCFLAGS += -malign-double
108 CCFLAGS += -march=pentiumpro
111 # Optimizations for PowerPC
113 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
116 # Optimizations for Sparc
118 CCFLAGS += -mhard-float
122 # C compiler flags: dependancies
124 DCFLAGS += $(INCLUDE)
128 # C compiler flags: linking
135 # C compiler flags: common flags
138 # Optimizations for x86 with MMX support
144 # Additionnal debugging flags
146 # Debugging settings: electric fence, debuging symbols and profiling support.
147 # Note that electric fence and accurate profiling are quite uncompatible.
155 #################################################################################
157 #################################################################################
162 interface_obj = interface/main.o \
163 interface/interface.o \
164 interface/intf_msg.o \
165 interface/intf_cmd.o \
166 interface/intf_ctrl.o \
167 interface/control.o \
168 interface/intf_console.o \
169 interface/intf_$(video).o
171 input_obj = input/input_vlan.o \
173 input/input_netlist.o \
174 input/input_network.o \
180 audio_output_obj = audio_output/audio_output.o \
181 audio_output/audio_dsp.o
183 video_output_obj = video_output/video_output.o \
184 video_output/video_$(video).o \
185 video_output/video_yuv.o
187 ac3_decoder_obj = ac3_decoder/ac3_decoder.o \
188 ac3_decoder/ac3_parse.o \
189 ac3_decoder/ac3_exponent.o \
190 ac3_decoder/ac3_bit_allocate.o \
191 ac3_decoder/ac3_mantissa.o \
192 ac3_decoder/ac3_rematrix.o \
193 ac3_decoder/ac3_imdct.o \
194 ac3_decoder/ac3_downmix.o
196 audio_decoder_obj = audio_decoder/audio_decoder.o \
197 audio_decoder/audio_math.o
199 subtitle_decoder_obj = subtitle_decoder/subtitle_decoder.o
201 #??generic_decoder_obj = generic_decoder/generic_decoder.o
202 # remeber to add it to OBJ
204 ifeq ($(DECODER),old)
205 CFLAGS += -DOLD_DECODER
206 video_decoder_obj = video_decoder_ref/video_decoder.o \
207 video_decoder_ref/display.o \
208 video_decoder_ref/getblk.o \
209 video_decoder_ref/gethdr.o \
210 video_decoder_ref/getpic.o \
211 video_decoder_ref/getvlc.o \
212 video_decoder_ref/idct.o \
213 video_decoder_ref/motion.o \
214 video_decoder_ref/mpeg2dec.o \
215 video_decoder_ref/recon.o \
216 video_decoder_ref/spatscal.o
218 video_parser_obj = video_parser/video_parser.o \
219 video_parser/vpar_headers.o \
220 video_parser/vpar_blocks.o \
221 video_parser/vpar_motion.o \
222 video_parser/vpar_synchro.o \
223 video_parser/video_fifo.o
225 video_decoder_obj = video_decoder/video_decoder.o \
226 video_decoder/vdec_motion.o \
227 video_decoder/$(TRANSFORM).o
230 misc_obj = misc/mtime.o \
235 ifeq ($(DECODER),old)
236 ASM_OBJ = video_decoder_ref/idctmmx.o \
237 video_output/video_yuv_mmx.o
239 ASM_OBJ = video_decoder/idctmmx.o \
240 video_output/video_yuv_mmx.o
245 C_OBJ = $(interface_obj) \
247 $(audio_output_obj) \
248 $(video_output_obj) \
250 $(audio_decoder_obj) \
251 $(subtitle_decoder_obj) \
252 $(generic_decoder_obj) \
253 $(video_parser_obj) \
254 $(video_decoder_obj) \
259 # Other lists of files
261 sources := $(C_OBJ:%.o=%.c)
262 dependancies := $(sources:%.c=dep/%.d)
264 # All symbols must be exported
267 ################################################################################
269 ################################################################################
277 rm -f $(C_OBJ) $(ASM_OBJ)
280 rm -f **/*.o **/*~ *.log
281 rm -f vlc gmon.out core
289 vlc: $(C_OBJ) $(ASM_OBJ)
290 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
293 # Generic rules (see below)
295 $(dependancies): %.d: FORCE
296 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
298 $(C_OBJ): %.o: dep/%.d
301 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
303 $(CC) $(CFLAGS) -c -o $@ $<
305 ################################################################################
306 # Note on generic rules and dependancies
307 ################################################################################
309 # Note on dependancies: each .c file is associated with a .d file, which
310 # depends of it. The .o file associated with a .c file depends of the .d, of the
311 # .c itself, and of Makefile. The .d files are stored in a separate dep/
313 # The dep directory should be ignored by CVS.
315 # Note on inclusions: depending of the target, the dependancies files must
316 # or must not be included. The problem is that if we ask make to include a file,
317 # and this file does not exist, it is made before it can be included. In a
318 # general way, a .d file should be included if and only if the corresponding .o
319 # needs to be re-made.
321 # Two makefiles are used: the main one (this one) has regular generic rules,
322 # except for .o files, for which it calls the object Makefile. Dependancies
323 # are not included in this file.
324 # The object Makefile known how to make a .o from a .c, and includes
325 # dependancies for the target, but only those required.