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.o
179 ac3_decoder_obj = ac3_decoder/ac3_decoder.o \
180 ac3_decoder/ac3_parse.o \
181 ac3_decoder/ac3_exponent.o \
182 ac3_decoder/ac3_bit_allocate.o \
183 ac3_decoder/ac3_mantissa.o \
184 ac3_decoder/ac3_rematrix.o \
185 ac3_decoder/ac3_imdct.o \
186 ac3_decoder/ac3_downmix.o
188 audio_decoder_obj = audio_decoder/audio_decoder.o \
189 audio_decoder/audio_math.o
191 #??generic_decoder_obj = generic_decoder/generic_decoder.o
192 # remeber to add it to OBJ
194 ifeq ($(DECODER),old)
195 video_decoder_obj = video_decoder_ref/video_decoder.o \
196 video_decoder_ref/display.o \
197 video_decoder_ref/getblk.o \
198 video_decoder_ref/gethdr.o \
199 video_decoder_ref/getpic.o \
200 video_decoder_ref/getvlc.o \
201 video_decoder_ref/idct.o \
202 video_decoder_ref/motion.o \
203 video_decoder_ref/mpeg2dec.o \
204 video_decoder_ref/recon.o \
205 video_decoder_ref/spatscal.o
207 video_parser_obj = video_parser/video_parser.o \
208 video_parser/vpar_headers.o \
209 video_parser/vpar_blocks.o \
210 video_parser/vpar_motion.o \
211 video_parser/vpar_synchro.o \
212 video_parser/video_fifo.o
214 video_decoder_obj = video_decoder/video_decoder.o \
215 video_decoder/vdec_motion.o \
216 video_decoder/$(TRANSFORM).o
219 misc_obj = misc/mtime.o \
224 ASM_OBJ = video_decoder_ref/idctmmx.o \
225 video_output/video_yuv_mmx.o
228 C_OBJ = $(interface_obj) \
230 $(audio_output_obj) \
231 $(video_output_obj) \
233 $(audio_decoder_obj) \
234 $(generic_decoder_obj) \
235 $(video_parser_obj) \
236 $(video_decoder_obj) \
241 # Other lists of files
243 sources := $(C_OBJ:%.o=%.c)
244 dependancies := $(sources:%.c=dep/%.d)
246 # All symbols must be exported
249 ################################################################################
251 ################################################################################
259 rm -f $(C_OBJ) $(ASM_OBJ)
262 rm -f **/*.o **/*~ *.log
263 rm -f vlc gmon.out core
271 vlc: $(C_OBJ) $(ASM_OBJ)
272 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
275 # Generic rules (see below)
277 $(dependancies): %.d: FORCE
278 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
280 $(C_OBJ): %.o: dep/%.d
283 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
285 $(CC) $(CFLAGS) -c -o $@ $<
287 ################################################################################
288 # Note on generic rules and dependancies
289 ################################################################################
291 # Note on dependancies: each .c file is associated with a .d file, which
292 # depends of it. The .o file associated with a .c file depends of the .d, of the
293 # .c itself, and of Makefile. The .d files are stored in a separate dep/
295 # The dep directory should be ignored by CVS.
297 # Note on inclusions: depending of the target, the dependancies files must
298 # or must not be included. The problem is that if we ask make to include a file,
299 # and this file does not exist, it is made before it can be included. In a
300 # general way, a .d file should be included if and only if the corresponding .o
301 # needs to be re-made.
303 # Two makefiles are used: the main one (this one) has regular generic rules,
304 # except for .o files, for which it calls the object Makefile. Dependancies
305 # are not included in this file.
306 # The object Makefile known how to make a .o from a .c, and includes
307 # dependancies for the target, but only those required.