1 # Generated automatically from Makefile.in by configure.
2 ################################################################################
3 # vlc (VideoLAN Client) main makefile
5 ################################################################################
6 # This makefile is the main makefile for the VideoLAN client.
7 ################################################################################
9 ################################################################################
11 ################################################################################
13 # Audio output settings
18 # Fallback method that should always work
21 # Video output settings
29 # Fallback method that should always work
40 # Fallback method that should always work
48 # Target operating system
54 # For x86 architecture, choose MMX support
56 # For x86 architecture, optimize for Pentium Pro
57 # (choose NO if you get `Invalid instruction' errors)
60 # Decoder choice - ?? old decoder will be removed soon
64 # Debugging mode on or off (set to 1 to activate)
67 #----------------- do not change anything below this line ----------------------
69 ################################################################################
70 # Configuration pre-processing
71 ################################################################################
73 # PROGRAM_OPTIONS is an identification string of the compilation options
74 PROGRAM_OPTIONS = $(SYS) $(ARCH)
76 PROGRAM_OPTIONS += DEBUG
79 # PROGRAM_BUILD is a complete identification of the build
80 # ( we can't use fancy options with date since OSes like Solaris
81 # or FreeBSD have strange date implementations )
82 PROGRAM_BUILD = `date` $(USER)
83 # XXX: beos does not support hostname
84 #PROGRAM_BUILD = `date` $(USER)@`hostname`
86 # DEFINE will contain some of the constants definitions decided in Makefile,
87 # including ARCH_xx and SYS_xx. It will be passed to C compiler.
88 DEFINE += -DARCH_$(shell echo $(ARCH) | cut -f1 -d' ')
89 DEFINE += -DSYS_$(SYS)
90 DEFINE += -DPLUGIN_PATH="\"$(PREFIX)/lib/videolan/vlc\""
91 DEFINE += -DPROGRAM_VERSION="\"0.1.99\""
92 DEFINE += -DPROGRAM_CODENAME="\"Onatopp\""
93 #DEFINE += -DPROGRAM_OPTIONS="\"$(shell echo $(PROGRAM_OPTIONS) | tr 'A-Z' 'a-z')\""
94 #DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
99 ################################################################################
100 # Tuning and other variables - do not change anything except if you know
101 # exactly what you are doing
102 ################################################################################
105 # C headers directories
107 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
114 LIB += -lthreads -ldl
118 LIB += -pthread -lgnugetopt
119 LIB += -L/usr/local/lib
123 LIB += -lpthread -ldl
127 LIB += -llibroot -llibgame -llibbe
133 # C compiler flags: compilation
135 CCFLAGS += $(DEFINE) $(INCLUDE)
137 CCFLAGS += -D_REENTRANT
138 CCFLAGS += -D_GNU_SOURCE
140 # Optimizations : don't compile debug versions with them
142 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
143 CCFLAGS += -fomit-frame-pointer
145 # Optimizations for x86 familiy
146 ifneq (,$(findstring X86,$(ARCH)))
147 CCFLAGS += -malign-double
148 #CCFLAGS += -march=pentium
149 # Eventual Pentium Pro optimizations
150 ifneq (,$(findstring PPRO,$(ARCH)))
152 CCFLAGS += -march=pentiumpro
155 # Eventual MMX optimizations for x86
156 ifneq (,$(findstring MMX,$(ARCH)))
161 # Optimizations for PowerPC
162 ifneq (,$(findstring PPC,$(ARCH)))
163 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
166 # Optimizations for Sparc
167 ifneq (,$(findstring SPARC,$(ARCH)))
168 CCFLAGS += -mhard-float
172 # C compiler flags: dependancies
174 DCFLAGS += $(INCLUDE)
178 # C compiler flags: linking
185 # Additionnal debugging flags
194 #################################################################################
196 #################################################################################
201 interface_obj = interface/main.o \
202 interface/interface.o \
203 interface/intf_msg.o \
204 interface/intf_cmd.o \
205 interface/intf_ctrl.o \
206 interface/intf_console.o
208 input_obj = input/input_vlan.o \
210 input/input_netlist.o \
211 input/input_network.o \
217 audio_output_obj = audio_output/audio_output.o
219 video_output_obj = video_output/video_output.o \
220 video_output/video_text.o \
221 video_output/video_yuv.o
223 ac3_decoder_obj = ac3_decoder/ac3_decoder_thread.o \
224 ac3_decoder/ac3_decoder.o \
225 ac3_decoder/ac3_parse.o \
226 ac3_decoder/ac3_exponent.o \
227 ac3_decoder/ac3_bit_allocate.o \
228 ac3_decoder/ac3_mantissa.o \
229 ac3_decoder/ac3_rematrix.o \
230 ac3_decoder/ac3_imdct.o \
231 ac3_decoder/ac3_downmix.o
233 audio_decoder_obj = audio_decoder/audio_decoder.o \
234 audio_decoder/audio_math.o
236 spu_decoder_obj = spu_decoder/spu_decoder.o
238 #??generic_decoder_obj = generic_decoder/generic_decoder.o
239 # remeber to add it to OBJ
241 ifeq ($(DECODER),old)
242 CFLAGS += -DOLD_DECODER
243 video_decoder_obj = video_decoder_ref/video_decoder.o \
244 video_decoder_ref/display.o \
245 video_decoder_ref/getblk.o \
246 video_decoder_ref/gethdr.o \
247 video_decoder_ref/getpic.o \
248 video_decoder_ref/getvlc.o \
249 video_decoder_ref/idct.o \
250 video_decoder_ref/motion.o \
251 video_decoder_ref/mpeg2dec.o \
252 video_decoder_ref/recon.o \
253 video_decoder_ref/spatscal.o
255 video_parser_obj = video_parser/video_parser.o \
256 video_parser/vpar_headers.o \
257 video_parser/vpar_blocks.o \
258 video_parser/vpar_synchro.o \
259 video_parser/video_fifo.o
261 video_decoder_obj = video_decoder/video_decoder.o \
262 video_decoder/vdec_motion.o \
263 video_decoder/vdec_motion_inner.o \
264 video_decoder/vdec_idct.o
267 misc_obj = misc/mtime.o \
273 C_OBJ = $(interface_obj) \
275 $(audio_output_obj) \
276 $(video_output_obj) \
278 $(audio_decoder_obj) \
280 $(generic_decoder_obj) \
281 $(video_parser_obj) \
282 $(video_decoder_obj) \
289 ifneq (,$(findstring X86,$(ARCH)))
290 ifneq (,$(findstring MMX,$(ARCH)))
291 ifeq ($(DECODER),new)
292 ASM_OBJ = video_decoder/vdec_idctmmx.o \
293 video_output/video_yuv_mmx.o
295 ASM_OBJ = video_decoder_ref/vdec_idctmmx.o \
296 video_output/video_yuv_mmx.o
304 intf_plugin = $(INTF:%=plugins/intf/intf_%.so)
305 aout_plugin = $(AOUT:%=plugins/aout/aout_%.so)
306 vout_plugin = $(VOUT:%=plugins/vout/vout_%.so)
308 PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
311 # Other lists of files
313 C_OBJ := $(C_OBJ:%.o=src/%.o)
314 ASM_OBJ := $(ASM_OBJ:%.o=src/%.o)
315 sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c)
316 dependancies := $(sources:%.c=.dep/%.d)
318 # All symbols must be exported
321 ################################################################################
323 ################################################################################
331 rm -f $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
334 rm -f **/*.o **/*.so **/*~ *.log
335 rm -f Makefile include/defs.h config.cache config.log
336 rm -f vlc gmon.out core
340 $(INSTALL) vlc $(PREFIX)/bin
341 mkdir -p $(PREFIX)/lib/videolan/vlc
342 $(INSTALL) $(PLUGIN_OBJ) $(PREFIX)/lib/videolan/vlc
345 @echo "Command line for C objects:"
346 @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
348 @echo "Command line for assembler objects:"
349 @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
356 vlc: $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
357 $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(ASM_OBJ)
360 # Generic rules (see below)
362 $(dependancies): %.d: FORCE
363 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
365 $(C_OBJ): %.o: Makefile.dep
366 $(C_OBJ): %.o: .dep/%.d
368 @echo "compiling $*.o from $*.c"
369 @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
371 $(ASM_OBJ): %.o: Makefile.dep
373 @echo "assembling $*.o from $*.S"
374 @$(CC) $(CFLAGS) -c -o $@ $<
376 $(PLUGIN_OBJ): %.so: Makefile.dep
377 $(PLUGIN_OBJ): %.so: .dep/%.d
380 plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
381 @echo "compiling $*.so from $*.c"
383 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
385 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
388 plugins/aout/aout_esd.so: %.so: %.c
389 @echo "compiling $*.so from $*.c"
391 @$(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
393 @$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
397 plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
398 plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
399 @echo "compiling $*.so from $*.c"
401 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
403 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
406 plugins/intf/intf_x11.so plugins/vout/vout_x11.so: %.so: %.c
407 @echo "compiling $*.so from $*.c"
408 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
410 plugins/intf/intf_glide.so plugins/vout/vout_glide.so: %.so: %.c
411 @echo "compiling $*.so from $*.c"
412 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
414 plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
415 @echo "compiling $*.so from $*.c"
416 @$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
419 ################################################################################
420 # Note on generic rules and dependancies
421 ################################################################################
423 # Note on dependancies: each .c file is associated with a .d file, which
424 # depends of it. The .o file associated with a .c file depends of the .d, of the
425 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
427 # The dep directory should be ignored by CVS.
429 # Note on inclusions: depending of the target, the dependancies files must
430 # or must not be included. The problem is that if we ask make to include a file,
431 # and this file does not exist, it is made before it can be included. In a
432 # general way, a .d file should be included if and only if the corresponding .o
433 # needs to be re-made.
435 # Two makefiles are used: the main one (this one) has regular generic rules,
436 # except for .o files, for which it calls the object Makefile. Dependancies
437 # are not included in this file.
438 # The object Makefile known how to make a .o from a .c, and includes
439 # dependancies for the target, but only those required.