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)
20 #VIDEO=GGI (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/X11
69 LIB += -L/usr/X11R6/lib
75 # System dependant libraries
79 # C compiler flags: compilation
81 CCFLAGS += $(DEFINE) $(INCLUDE)
83 CCFLAGS += -D_REENTRANT
84 CCFLAGS += -D_GNU_SOURCE
86 # Optimizations : don't compile debug versions with them
88 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
89 CCFLAGS += -fomit-frame-pointer
90 #CCFLAGS += -fomit-frame-pointer -s
92 # Optimizations for x86 familiy, without MMX
94 CCFLAGS += -malign-double
95 CCFLAGS += -march=pentiumpro
96 #CCFLAGS += -march=pentium
99 # Optimization for x86 with MMX support
101 CCFLAGS += -malign-double
102 CCFLAGS += -march=pentiumpro
105 # Optimizations for PowerPC
107 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
111 # C compiler flags: dependancies
113 DCFLAGS += $(INCLUDE)
117 # C compiler flags: linking
124 # C compiler flags: common flags
127 # Optimizations for x86 with MMX support
133 # Additionnal debugging flags
135 # Debugging settings: electric fence, debuging symbols and profiling support.
136 # Note that electric fence and accurate profiling are quite uncompatible.
144 #################################################################################
146 #################################################################################
151 interface_obj = interface/main.o \
152 interface/interface.o \
153 interface/intf_msg.o \
154 interface/intf_cmd.o \
155 interface/intf_ctrl.o \
156 interface/control.o \
157 interface/intf_console.o \
158 interface/intf_$(video).o
160 input_obj = input/input_vlan.o \
162 input/input_netlist.o \
163 input/input_network.o \
169 audio_output_obj = audio_output/audio_output.o \
170 audio_output/audio_dsp.o
172 video_output_obj = video_output/video_output.o \
173 video_output/video_$(video).o
175 audio_decoder_obj = audio_decoder/audio_decoder.o \
176 audio_decoder/audio_math.o
178 #??generic_decoder_obj = generic_decoder/generic_decoder.o
179 # remeber to add it to OBJ
181 ifeq ($(DECODER),old)
182 video_decoder_obj = video_decoder_ref/video_decoder.o \
183 video_decoder_ref/display.o \
184 video_decoder_ref/getblk.o \
185 video_decoder_ref/gethdr.o \
186 video_decoder_ref/getpic.o \
187 video_decoder_ref/getvlc.o \
188 video_decoder_ref/idct.o \
189 video_decoder_ref/motion.o \
190 video_decoder_ref/mpeg2dec.o \
191 video_decoder_ref/recon.o \
192 video_decoder_ref/spatscal.o
194 video_parser_obj = video_parser/video_parser.o \
195 video_parser/vpar_headers.o \
196 video_parser/vpar_blocks.o \
197 video_parser/vpar_motion.o \
198 video_parser/vpar_synchro.o \
199 video_parser/video_fifo.o
201 video_decoder_obj = video_decoder/video_decoder.o \
202 video_decoder/vdec_motion.o \
203 video_decoder/$(TRANSFORM).o
206 misc_obj = misc/mtime.o \
211 misc_obj+= misc/xutils.o
215 ASM_OBJ = video_decoder_ref/idctmmx.o \
216 video_decoder_ref/yuv12-rgb16.o
219 C_OBJ = $(interface_obj) \
221 $(audio_output_obj) \
222 $(video_output_obj) \
223 $(audio_decoder_obj) \
224 $(generic_decoder_obj) \
225 $(video_parser_obj) \
226 $(video_decoder_obj) \
231 # Other lists of files
233 sources := $(C_OBJ:%.o=%.c)
234 dependancies := $(sources:%.c=dep/%.d)
236 # All symbols must be exported
239 ################################################################################
241 ################################################################################
249 rm -f $(C_OBJ) $(ASM_OBJ)
252 rm -f **/*.o **/*~ *.log
253 rm -f vlc gmon.out core
261 vlc: $(C_OBJ) $(ASM_OBJ)
262 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
265 # Generic rules (see below)
267 $(dependancies): %.d: FORCE
268 @make -s --no-print-directory -f Makefile.dep $@
270 $(C_OBJ): %.o: dep/%.d
273 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
275 $(CC) $(CFLAGS) -c -o $@ $<
277 ################################################################################
278 # Note on generic rules and dependancies
279 ################################################################################
281 # Note on dependancies: each .c file is associated with a .d file, which
282 # depends of it. The .o file associated with a .c file depends of the .d, of the
283 # .c itself, and of Makefile. The .d files are stored in a separate dep/
285 # The dep directory should be ignored by CVS.
287 # Note on inclusions: depending of the target, the dependancies files must
288 # or must not be included. The problem is that if we ask make to include a file,
289 # and this file does not exist, it is made before it can be included. In a
290 # general way, a .d file should be included if and only if the corresponding .o
291 # needs to be re-made.
293 # Two makefiles are used: the main one (this one) has regular generic rules,
294 # except for .o files, for which it calls the object Makefile. Dependancies
295 # are not included in this file.
296 # The object Makefile known how to make a .o from a .c, and includes
297 # dependancies for the target, but only those required.