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
69 LIB += -L/usr/X11R6/lib
77 # System dependant libraries
81 # C compiler flags: compilation
83 CCFLAGS += $(DEFINE) $(INCLUDE)
85 CCFLAGS += -D_REENTRANT
86 CCFLAGS += -D_GNU_SOURCE
88 # Optimizations : don't compile debug versions with them
90 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
91 CCFLAGS += -fomit-frame-pointer
92 #CCFLAGS += -fomit-frame-pointer -s
94 # Optimizations for x86 familiy, without MMX
96 CCFLAGS += -malign-double
97 CCFLAGS += -march=pentiumpro
98 #CCFLAGS += -march=pentium
101 # Optimization for x86 with MMX support
103 CCFLAGS += -malign-double
104 CCFLAGS += -march=pentiumpro
107 # Optimizations for PowerPC
109 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
113 # C compiler flags: dependancies
115 DCFLAGS += $(INCLUDE)
119 # C compiler flags: linking
126 # C compiler flags: common flags
129 # Optimizations for x86 with MMX support
135 # Additionnal debugging flags
137 # Debugging settings: electric fence, debuging symbols and profiling support.
138 # Note that electric fence and accurate profiling are quite uncompatible.
146 #################################################################################
148 #################################################################################
153 interface_obj = interface/main.o \
154 interface/interface.o \
155 interface/intf_msg.o \
156 interface/intf_cmd.o \
157 interface/intf_ctrl.o \
158 interface/control.o \
159 interface/intf_console.o \
160 interface/intf_$(video).o
162 input_obj = input/input_vlan.o \
164 input/input_netlist.o \
165 input/input_network.o \
171 audio_output_obj = audio_output/audio_output.o \
172 audio_output/audio_dsp.o
174 video_output_obj = video_output/video_output.o \
175 video_output/video_$(video).o
177 audio_decoder_obj = audio_decoder/audio_decoder.o \
178 audio_decoder/audio_math.o
180 #??generic_decoder_obj = generic_decoder/generic_decoder.o
181 # remeber to add it to OBJ
183 ifeq ($(DECODER),old)
184 video_decoder_obj = video_decoder_ref/video_decoder.o \
185 video_decoder_ref/display.o \
186 video_decoder_ref/getblk.o \
187 video_decoder_ref/gethdr.o \
188 video_decoder_ref/getpic.o \
189 video_decoder_ref/getvlc.o \
190 video_decoder_ref/idct.o \
191 video_decoder_ref/motion.o \
192 video_decoder_ref/mpeg2dec.o \
193 video_decoder_ref/recon.o \
194 video_decoder_ref/spatscal.o
196 video_parser_obj = video_parser/video_parser.o \
197 video_parser/vpar_headers.o \
198 video_parser/vpar_blocks.o \
199 video_parser/vpar_motion.o \
200 video_parser/vpar_synchro.o \
201 video_parser/video_fifo.o
203 video_decoder_obj = video_decoder/video_decoder.o \
204 video_decoder/vdec_motion.o \
205 video_decoder/$(TRANSFORM).o
208 misc_obj = misc/mtime.o \
213 misc_obj+= misc/xutils.o
217 ASM_OBJ = video_decoder_ref/idctmmx.o \
218 video_output/yuv_mmx.o
221 C_OBJ = $(interface_obj) \
223 $(audio_output_obj) \
224 $(video_output_obj) \
225 $(audio_decoder_obj) \
226 $(generic_decoder_obj) \
227 $(video_parser_obj) \
228 $(video_decoder_obj) \
233 # Other lists of files
235 sources := $(C_OBJ:%.o=%.c)
236 dependancies := $(sources:%.c=dep/%.d)
238 # All symbols must be exported
241 ################################################################################
243 ################################################################################
251 rm -f $(C_OBJ) $(ASM_OBJ)
254 rm -f **/*.o **/*~ *.log
255 rm -f vlc gmon.out core
263 vlc: $(C_OBJ) $(ASM_OBJ)
264 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
267 # Generic rules (see below)
269 $(dependancies): %.d: FORCE
270 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
272 $(C_OBJ): %.o: dep/%.d
275 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
277 $(CC) $(CFLAGS) -c -o $@ $<
279 ################################################################################
280 # Note on generic rules and dependancies
281 ################################################################################
283 # Note on dependancies: each .c file is associated with a .d file, which
284 # depends of it. The .o file associated with a .c file depends of the .d, of the
285 # .c itself, and of Makefile. The .d files are stored in a separate dep/
287 # The dep directory should be ignored by CVS.
289 # Note on inclusions: depending of the target, the dependancies files must
290 # or must not be included. The problem is that if we ask make to include a file,
291 # and this file does not exist, it is made before it can be included. In a
292 # general way, a .d file should be included if and only if the corresponding .o
293 # needs to be re-made.
295 # Two makefiles are used: the main one (this one) has regular generic rules,
296 # except for .o files, for which it calls the object Makefile. Dependancies
297 # are not included in this file.
298 # The object Makefile known how to make a .o from a .c, and includes
299 # dependancies for the target, but only those required.