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
22 # Target architecture and optimization
27 #----------------- do not change anything below this line ----------------------
29 ################################################################################
30 # Configuration pre-processing
31 ################################################################################
33 # DEFINE will contain all the constants definitions decided in Makefile
34 DEFINE = -DVIDEO_$(VIDEO)
36 # video is a lowercase version of VIDEO used for filenames
37 video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
39 ################################################################################
40 # Tunning and other variables
41 ################################################################################
44 # Transformation for video decompression (Fourier or cosine)
50 # C headers directories
55 INCLUDE += -I/usr/X11R6/include/X11
64 LIB += -L/usr/X11R6/lib
70 # System dependant libraries
74 # C compiler flags: compilation
76 CCFLAGS += $(DEFINE) $(INCLUDE)
78 CCFLAGS += -D_REENTRANT
79 CCFLAGS += -D_GNU_SOURCE
81 # Optimizations : don't compile debug versions with them
83 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
84 CCFLAGS += -fomit-frame-pointer
85 #CCFLAGS += -fomit-frame-pointer -s
87 # Optimizations for x86 familiy, without MMX
89 CCFLAGS += -malign-double
90 CCFLAGS += -march=pentiumpro
91 #CCFLAGS += -march=pentium
94 # Optimization for x86 with MMX support
96 CCFLAGS += -malign-double
97 CCFLAGS += -march=pentiumpro
100 # Optimizations for PowerPC
102 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
106 # C compiler flags: dependancies
108 DCFLAGS += $(INCLUDE)
112 # C compiler flags: linking
119 # C compiler flags: common flags
122 # Optimizations for x86 with MMX support
128 # Additionnal debugging flags
130 # Debugging settings: electric fence, debuging symbols and profiling support.
131 # Note that electric fence and accurate profiling are quite uncompatible.
139 #################################################################################
141 #################################################################################
146 interface_obj = interface/main.o \
147 interface/interface.o \
148 interface/intf_msg.o \
149 interface/intf_cmd.o \
150 interface/intf_ctrl.o \
151 interface/control.o \
152 interface/intf_console.o \
153 interface/intf_$(video).o
155 input_obj = input/input_vlan.o \
157 input/input_netlist.o \
158 input/input_network.o \
164 audio_output_obj = audio_output/audio_output.o \
165 audio_output/audio_dsp.o
167 video_output_obj = video_output/video_output.o \
168 video_output/video_$(video).o
170 audio_decoder_obj = audio_decoder/audio_decoder.o \
171 audio_decoder/audio_math.o
173 #??generic_decoder_obj = generic_decoder/generic_decoder.o
174 # remeber to add it to OBJ
176 video_decoder_obj = video_decoder_ref/video_decoder.o \
177 video_decoder_ref/display.o \
178 video_decoder_ref/getblk.o \
179 video_decoder_ref/gethdr.o \
180 video_decoder_ref/getpic.o \
181 video_decoder_ref/getvlc.o \
182 video_decoder_ref/idct.o \
183 video_decoder_ref/motion.o \
184 video_decoder_ref/mpeg2dec.o \
185 video_decoder_ref/recon.o \
186 video_decoder_ref/spatscal.o
187 # video_decoder_ref/$(TRANSFORM).o
189 #video_parser_obj = video_parser/video_parser.o \
190 # video_parser/vpar_headers.o \
191 # video_parser/vpar_blocks.o \
192 # video_parser/vpar_motion.o \
193 # video_parser/vpar_synchro.o \
194 # video_parser/video_fifo.o
196 #video_decoder_obj = video_decoder/video_decoder.o \
197 # video_decoder/vdec_idct.o \
198 # video_decoder/vdec_motion.o
200 misc_obj = misc/mtime.o \
207 ASM_OBJ = video_decoder_ref/idctmmx.o \
208 video_decoder_ref/yuv12-rgb16.o
211 C_OBJ = $(interface_obj) \
213 $(audio_output_obj) \
214 $(video_output_obj) \
215 $(audio_decoder_obj) \
216 $(generic_decoder_obj) \
217 $(video_parser_obj) \
218 $(video_decoder_obj) \
223 # Other lists of files
225 sources := $(C_OBJ:%.o=%.c)
226 dependancies := $(sources:%.c=dep/%.d)
228 # All symbols must be exported
231 ################################################################################
233 ################################################################################
241 rm -f $(C_OBJ) $(ASM_OBJ)
244 rm -f **/*.o **/*~ *.log
245 rm -f vlc gmon.out core
253 vlc: $(C_OBJ) $(ASM_OBJ)
254 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
257 # Generic rules (see below)
259 $(dependancies): %.d: FORCE
260 @make -s --no-print-directory -f Makefile.dep $@
262 $(C_OBJ): %.o: dep/%.d
265 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
267 $(CC) $(CFLAGS) -c -o $@ $<
269 ################################################################################
270 # Note on generic rules and dependancies
271 ################################################################################
273 # Note on dependancies: each .c file is associated with a .d file, which
274 # depends of it. The .o file associated with a .c file depends of the .d, of the
275 # .c itself, and of Makefile. The .d files are stored in a separate dep/
277 # The dep directory should be ignored by CVS.
279 # Note on inclusions: depending of the target, the dependancies files must
280 # or must not be included. The problem is that if we ask make to include a file,
281 # and this file does not exist, it is made before it can be included. In a
282 # general way, a .d file should be included if and only if the corresponding .o
283 # needs to be re-made.
285 # Two makefiles are used: the main one (this one) has regular generic rules,
286 # except for .o files, for which it calls the object Makefile. Dependancies
287 # are not included in this file.
288 # The object Makefile known how to make a .o from a .c, and includes
289 # dependancies for the target, but only those required.