1 ################################################################################
2 # vlc (VideoLAN Client) main makefile
4 ################################################################################
5 # This makefile is the main makefile for the VideoLAN client.
6 ################################################################################
8 ################################################################################
10 ################################################################################
16 # Audio output settings
19 # Video output settings
23 # You probably won't need this one
34 # Target operating system
39 # For x86 architecture, choose MMX support
43 # Decoder choice - ?? old decoder will be removed soon
47 # Debugging mode on or off (set to 1 to activate)
50 #----------------- do not change anything below this line ----------------------
52 ################################################################################
53 # Configuration pre-processing
54 ################################################################################
56 # Program version - may only be changed by the project leader
57 PROGRAM_VERSION = 1.0-dev
59 # AUDIO_OPTIONS describes all used audio options
61 aout_method = audio_output/aout_dummy.o
62 ifeq ($(AUDIO_DSP), YES)
65 aout_method += audio_output/aout_dsp.o
68 # VIDEO_OPTIONS describes all used video options
70 intf_method = interface/intf_dummy.o
71 vout_method = video_output/vout_dummy.o
72 ifeq ($(VIDEO_GLIDE), YES)
73 VIDEO_OPTIONS += glide
74 DEFINE += -DVIDEO_GLIDE
75 intf_method += interface/intf_glide.o
76 vout_method += video_output/vout_glide.o
78 ifeq ($(VIDEO_X11), YES)
81 intf_method += interface/intf_x11.o
82 vout_method += video_output/vout_x11.o
84 ifeq ($(VIDEO_GGI), YES)
87 intf_method += interface/intf_ggi.o
88 vout_method += video_output/vout_ggi.o
90 ifeq ($(VIDEO_FB), YES)
93 intf_method += interface/intf_fb.o
94 vout_method += video_output/vout_fb.o
96 ifeq ($(VIDEO_BEOS), YES)
98 DEFINE += -DVIDEO_BEOS
99 intf_method += interface/intf_beos.o
100 vout_method += video_output/vout_beos.o
102 ifeq ($(VIDEO_DGA), YES)
104 DEFINE += -DVIDEO_DGA
105 intf_method += interface/intf_dga.o
106 vout_method += video_output/vout_dga.o
109 # PROGRAM_OPTIONS is an identification string of the compilation options
110 PROGRAM_OPTIONS = $(ARCH) $(SYS)
112 PROGRAM_OPTIONS += DEBUG
115 # PROGRAM_BUILD is a complete identification of the build
116 PROGRAM_BUILD = `date -R` $(USER)@`hostname`
118 # DEFINE will contain some of the constants definitions decided in Makefile,
119 # including ARCH_xx and SYS_xx. It will be passed to C compiler.
120 DEFINE += -DARCH_$(ARCH)
121 DEFINE += -DSYS_$(SYS)
122 DEFINE += -DAUDIO_OPTIONS="\"$(shell echo $(AUDIO_OPTIONS) | tr 'A-Z' 'a-z')\""
123 DEFINE += -DVIDEO_OPTIONS="\"$(shell echo $(VIDEO_OPTIONS) | tr 'A-Z' 'a-z')\""
124 DEFINE += -DPROGRAM_VERSION="\"$(PROGRAM_VERSION)\""
125 DEFINE += -DPROGRAM_OPTIONS="\"$(PROGRAM_OPTIONS)\""
126 DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
131 ################################################################################
132 # Tuning and other variables - do not change anything except if you know
133 # exactly what you are doing
134 ################################################################################
137 # C headers directories
141 ifeq ($(VIDEO_X11),YES)
142 INCLUDE += -I/usr/X11R6/include
145 ifeq ($(VIDEO_GLIDE),YES)
146 INCLUDE += -I/usr/include/glide
155 ifeq ($(VIDEO_X11),YES)
156 LIB += -L/usr/X11R6/lib
160 ifeq ($(VIDEO_GGI),YES)
163 ifeq ($(VIDEO_GLIDE),YES)
168 # C compiler flags: compilation
170 CCFLAGS += $(DEFINE) $(INCLUDE)
172 CCFLAGS += -D_REENTRANT
173 CCFLAGS += -D_GNU_SOURCE
175 # Optimizations : don't compile debug versions with them
177 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
178 CCFLAGS += -fomit-frame-pointer
180 # Optimizations for x86 familiy
182 CCFLAGS += -malign-double
183 CCFLAGS += -march=pentiumpro
184 #CCFLAGS += -march=pentium
187 # Optimizations for PowerPC
189 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
192 # Optimizations for Sparc
194 CCFLAGS += -mhard-float
198 # C compiler flags: dependancies
200 DCFLAGS += $(INCLUDE)
204 # C compiler flags: linking
211 # C compiler flags: common flags
214 # Eventual MMX optimizations for x86
216 ifeq ($(MMX), YES) # MMX is YES or AUTO
222 # Additionnal debugging flags
231 #################################################################################
233 #################################################################################
238 interface_obj = interface/main.o \
239 interface/interface.o \
240 interface/intf_msg.o \
241 interface/intf_cmd.o \
242 interface/intf_ctrl.o \
243 interface/control.o \
244 interface/intf_console.o \
247 input_obj = input/input_vlan.o \
249 input/input_netlist.o \
250 input/input_network.o \
256 audio_output_obj = audio_output/audio_output.o \
257 audio_output/audio_dsp.o
259 video_output_obj = video_output/video_output.o \
260 video_output/video_text.o \
261 video_output/video_yuv.o \
264 ac3_decoder_obj = ac3_decoder/ac3_decoder.o \
265 ac3_decoder/ac3_parse.o \
266 ac3_decoder/ac3_exponent.o \
267 ac3_decoder/ac3_bit_allocate.o \
268 ac3_decoder/ac3_mantissa.o \
269 ac3_decoder/ac3_rematrix.o \
270 ac3_decoder/ac3_imdct.o \
271 ac3_decoder/ac3_downmix.o
273 audio_decoder_obj = audio_decoder/audio_decoder.o \
274 audio_decoder/audio_math.o
276 spu_decoder_obj = spu_decoder/spu_decoder.o
278 #??generic_decoder_obj = generic_decoder/generic_decoder.o
279 # remeber to add it to OBJ
281 ifeq ($(DECODER),old)
282 CFLAGS += -DOLD_DECODER
283 video_decoder_obj = video_decoder_ref/video_decoder.o \
284 video_decoder_ref/display.o \
285 video_decoder_ref/getblk.o \
286 video_decoder_ref/gethdr.o \
287 video_decoder_ref/getpic.o \
288 video_decoder_ref/getvlc.o \
289 video_decoder_ref/idct.o \
290 video_decoder_ref/motion.o \
291 video_decoder_ref/mpeg2dec.o \
292 video_decoder_ref/recon.o \
293 video_decoder_ref/spatscal.o
295 video_parser_obj = video_parser/video_parser.o \
296 video_parser/vpar_headers.o \
297 video_parser/vpar_blocks.o \
298 video_parser/vpar_synchro.o \
299 video_parser/video_fifo.o
301 video_decoder_obj = video_decoder/video_decoder.o \
302 video_decoder/vdec_motion.o \
303 video_decoder/vdec_idct.o
306 misc_obj = misc/mtime.o \
310 C_OBJ = $(interface_obj) \
312 $(audio_output_obj) \
313 $(video_output_obj) \
315 $(audio_decoder_obj) \
317 $(generic_decoder_obj) \
318 $(video_parser_obj) \
319 $(video_decoder_obj) \
328 ifeq ($(DECODER),new)
329 ASM_OBJ = video_decoder/idctmmx.o \
330 video_output/video_yuv_mmx.o
332 ASM_OBJ = video_decoder_ref/idctmmx.o \
333 video_output/video_yuv_mmx.o
339 # Other lists of files
341 sources := $(C_OBJ:%.o=%.c)
342 dependancies := $(sources:%.c=dep/%.d)
344 # All symbols must be exported
347 ################################################################################
349 ################################################################################
357 rm -f $(C_OBJ) $(ASM_OBJ)
360 rm -f **/*.o **/*~ *.log
361 rm -f vlc gmon.out core
365 @echo "Command line for C objects:"
366 @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
368 @echo "Command line for assembler objects:"
369 @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
376 vlc: $(C_OBJ) $(ASM_OBJ)
377 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
380 # Generic rules (see below)
382 $(dependancies): %.d: FORCE
383 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
385 $(C_OBJ): %.o: Makefile Makefile.dep
386 $(C_OBJ): %.o: dep/%.d
388 @echo "compiling $*.c"
389 @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
391 $(ASM_OBJ): %.o: Makefile Makefile.dep
393 @echo "assembling $*.S"
394 @$(CC) $(CFLAGS) -c -o $@ $<
396 ################################################################################
397 # Note on generic rules and dependancies
398 ################################################################################
400 # Note on dependancies: each .c file is associated with a .d file, which
401 # depends of it. The .o file associated with a .c file depends of the .d, of the
402 # .c itself, and of Makefile. The .d files are stored in a separate dep/
404 # The dep directory should be ignored by CVS.
406 # Note on inclusions: depending of the target, the dependancies files must
407 # or must not be included. The problem is that if we ask make to include a file,
408 # and this file does not exist, it is made before it can be included. In a
409 # general way, a .d file should be included if and only if the corresponding .o
410 # needs to be re-made.
412 # Two makefiles are used: the main one (this one) has regular generic rules,
413 # except for .o files, for which it calls the object Makefile. Dependancies
414 # are not included in this file.
415 # The object Makefile known how to make a .o from a .c, and includes
416 # dependancies for the target, but only those required.