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 #----------------- do not change anything below this line ----------------------
30 ################################################################################
31 # Configuration pre-processing
32 ################################################################################
34 # DEFINE will contain all the constants definitions decided in Makefile
35 DEFINE = -DVIDEO_$(VIDEO)
37 # video is a lowercase version of VIDEO used for filenames
38 video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
40 ################################################################################
41 # Tunning and other variables
42 ################################################################################
45 # Transformation for video decompression (Fourier or cosine)
51 # C headers directories
56 INCLUDE += -I/usr/X11R6/include/X11
65 LIB += -L/usr/X11R6/lib
71 # System dependant libraries
75 # C compiler flags: compilation
77 CCFLAGS += $(DEFINE) $(INCLUDE)
79 CCFLAGS += -D_REENTRANT
80 CCFLAGS += -D_GNU_SOURCE
82 # Optimizations : don't compile debug versions with them
84 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
85 CCFLAGS += -fomit-frame-pointer
86 #CCFLAGS += -fomit-frame-pointer -s
88 # Optimizations for x86 familiy, without MMX
90 CCFLAGS += -malign-double
91 CCFLAGS += -march=pentiumpro
92 #CCFLAGS += -march=pentium
95 # Optimization for x86 with MMX support
97 CCFLAGS += -malign-double
98 CCFLAGS += -march=pentiumpro
101 # Optimizations for PowerPC
103 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
107 # C compiler flags: dependancies
109 DCFLAGS += $(INCLUDE)
113 # C compiler flags: linking
120 # C compiler flags: common flags
123 # Optimizations for x86 with MMX support
129 # Additionnal debugging flags
131 # Debugging settings: electric fence, debuging symbols and profiling support.
132 # Note that electric fence and accurate profiling are quite uncompatible.
140 #################################################################################
142 #################################################################################
147 interface_obj = interface/main.o \
148 interface/interface.o \
149 interface/intf_msg.o \
150 interface/intf_cmd.o \
151 interface/intf_ctrl.o \
152 interface/control.o \
153 interface/intf_console.o \
154 interface/intf_$(video).o
156 input_obj = input/input_vlan.o \
158 input/input_netlist.o \
159 input/input_network.o \
165 audio_output_obj = audio_output/audio_output.o \
166 audio_output/audio_dsp.o
168 video_output_obj = video_output/video_output.o \
169 video_output/video_$(video).o
171 audio_decoder_obj = audio_decoder/audio_decoder.o \
172 audio_decoder/audio_math.o
174 #??generic_decoder_obj = generic_decoder/generic_decoder.o
175 # remeber to add it to OBJ
177 video_decoder_obj = video_decoder_ref/video_decoder.o \
178 video_decoder_ref/display.o \
179 video_decoder_ref/getblk.o \
180 video_decoder_ref/gethdr.o \
181 video_decoder_ref/getpic.o \
182 video_decoder_ref/getvlc.o \
183 video_decoder_ref/idct.o \
184 video_decoder_ref/motion.o \
185 video_decoder_ref/mpeg2dec.o \
186 video_decoder_ref/recon.o \
187 video_decoder_ref/spatscal.o
188 # video_decoder_ref/$(TRANSFORM).o
190 #video_parser_obj = video_parser/video_parser.o \
191 # video_parser/vpar_headers.o \
192 # video_parser/vpar_blocks.o \
193 # video_parser/vpar_motion.o \
194 # video_parser/vpar_synchro.o \
195 # video_parser/video_fifo.o
197 #video_decoder_obj = video_decoder/video_decoder.o \
198 # video_decoder/vdec_idct.o \
199 # video_decoder/vdec_motion.o
201 misc_obj = misc/mtime.o \
206 misc_obj+= misc/xutils.o
210 ASM_OBJ = video_decoder_ref/idctmmx.o \
211 video_decoder_ref/yuv12-rgb16.o
214 C_OBJ = $(interface_obj) \
216 $(audio_output_obj) \
217 $(video_output_obj) \
218 $(audio_decoder_obj) \
219 $(generic_decoder_obj) \
220 $(video_parser_obj) \
221 $(video_decoder_obj) \
226 # Other lists of files
228 sources := $(C_OBJ:%.o=%.c)
229 dependancies := $(sources:%.c=dep/%.d)
231 # All symbols must be exported
234 ################################################################################
236 ################################################################################
244 rm -f $(C_OBJ) $(ASM_OBJ)
247 rm -f **/*.o **/*~ *.log
248 rm -f vlc gmon.out core
256 vlc: $(C_OBJ) $(ASM_OBJ)
257 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
260 # Generic rules (see below)
262 $(dependancies): %.d: FORCE
263 @make -s --no-print-directory -f Makefile.dep $@
265 $(C_OBJ): %.o: dep/%.d
268 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
270 $(CC) $(CFLAGS) -c -o $@ $<
272 ################################################################################
273 # Note on generic rules and dependancies
274 ################################################################################
276 # Note on dependancies: each .c file is associated with a .d file, which
277 # depends of it. The .o file associated with a .c file depends of the .d, of the
278 # .c itself, and of Makefile. The .d files are stored in a separate dep/
280 # The dep directory should be ignored by CVS.
282 # Note on inclusions: depending of the target, the dependancies files must
283 # or must not be included. The problem is that if we ask make to include a file,
284 # and this file does not exist, it is made before it can be included. In a
285 # general way, a .d file should be included if and only if the corresponding .o
286 # needs to be re-made.
288 # Two makefiles are used: the main one (this one) has regular generic rules,
289 # except for .o files, for which it calls the object Makefile. Dependancies
290 # are not included in this file.
291 # The object Makefile known how to make a .o from a .c, and includes
292 # dependancies for the target, but only those required.