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
30 # Fallback method that should always work
42 # Fallback method that should always work
50 # Target operating system
56 # For x86 architecture, choose MMX support
58 # For x86 architecture, optimize for Pentium Pro
59 # (choose NO if you get `Invalid instruction' errors)
62 # Decoder choice - ?? old decoder will be removed soon
66 # Debugging mode on or off (set to 1 to activate)
69 #----------------- do not change anything below this line ----------------------
71 ################################################################################
72 # Configuration pre-processing
73 ################################################################################
75 # PROGRAM_OPTIONS is an identification string of the compilation options
76 PROGRAM_OPTIONS = $(SYS) $(ARCH)
78 PROGRAM_OPTIONS += DEBUG
81 # PROGRAM_BUILD is a complete identification of the build
82 # ( we can't use fancy options with date since OSes like Solaris
83 # or FreeBSD have strange date implementations )
84 PROGRAM_BUILD = `date` $(USER)
85 # XXX: beos does not support hostname
86 #PROGRAM_BUILD = `date` $(USER)@`hostname`
88 # DEFINE will contain some of the constants definitions decided in Makefile,
89 # including ARCH_xx and SYS_xx. It will be passed to C compiler.
90 DEFINE += -DARCH_$(shell echo $(ARCH) | cut -f1 -d' ')
91 DEFINE += -DSYS_$(SYS)
92 DEFINE += -DPLUGIN_PATH="\"$(PREFIX)/lib/videolan/vlc\""
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_thread.o \
234 audio_decoder/audio_decoder.o \
235 audio_decoder/audio_math.o
237 spu_decoder_obj = spu_decoder/spu_decoder.o
239 #??generic_decoder_obj = generic_decoder/generic_decoder.o
240 # remeber to add it to OBJ
242 ifeq ($(DECODER),old)
243 CFLAGS += -DOLD_DECODER
244 video_decoder_obj = video_decoder_ref/video_decoder.o \
245 video_decoder_ref/display.o \
246 video_decoder_ref/getblk.o \
247 video_decoder_ref/gethdr.o \
248 video_decoder_ref/getpic.o \
249 video_decoder_ref/getvlc.o \
250 video_decoder_ref/idct.o \
251 video_decoder_ref/motion.o \
252 video_decoder_ref/mpeg2dec.o \
253 video_decoder_ref/recon.o \
254 video_decoder_ref/spatscal.o
256 video_parser_obj = video_parser/video_parser.o \
257 video_parser/vpar_headers.o \
258 video_parser/vpar_blocks.o \
259 video_parser/vpar_synchro.o \
260 video_parser/video_fifo.o
262 video_decoder_obj = video_decoder/video_decoder.o \
263 video_decoder/vdec_motion.o \
264 video_decoder/vdec_motion_inner.o \
265 video_decoder/vdec_idct.o
268 misc_obj = misc/mtime.o \
274 C_OBJ = $(interface_obj) \
276 $(audio_output_obj) \
277 $(video_output_obj) \
279 $(audio_decoder_obj) \
281 $(generic_decoder_obj) \
282 $(video_parser_obj) \
283 $(video_decoder_obj) \
290 ifneq (,$(findstring X86,$(ARCH)))
291 ifneq (,$(findstring MMX,$(ARCH)))
292 ifeq ($(DECODER),new)
293 ASM_OBJ = video_decoder/vdec_idctmmx.o \
294 video_output/video_yuv_mmx.o
296 ASM_OBJ = video_decoder_ref/vdec_idctmmx.o \
297 video_output/video_yuv_mmx.o
305 intf_plugin = $(INTF:%=plugins/intf/intf_%.so)
306 aout_plugin = $(AOUT:%=plugins/aout/aout_%.so)
307 vout_plugin = $(VOUT:%=plugins/vout/vout_%.so)
309 PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
312 # Other lists of files
314 C_OBJ := $(C_OBJ:%.o=src/%.o)
315 ASM_OBJ := $(ASM_OBJ:%.o=src/%.o)
316 sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c)
317 dependancies := $(sources:%.c=.dep/%.d)
319 # All symbols must be exported
322 ################################################################################
324 ################################################################################
332 rm -f $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
335 rm -f **/*.o **/*.so **/*~ *.log
336 rm -f Makefile include/defs.h config.cache config.log
337 rm -f vlc gmon.out core
341 $(INSTALL) vlc $(PREFIX)/bin
342 mkdir -p $(PREFIX)/lib/videolan/vlc
343 $(INSTALL) $(PLUGIN_OBJ) $(PREFIX)/lib/videolan/vlc
346 @echo "Command line for C objects:"
347 @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
349 @echo "Command line for assembler objects:"
350 @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
357 vlc: $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
358 $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(ASM_OBJ)
361 # Generic rules (see below)
363 $(dependancies): %.d: FORCE
364 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
366 $(C_OBJ): %.o: Makefile.dep
367 $(C_OBJ): %.o: .dep/%.d
369 @echo "compiling $*.o from $*.c"
370 @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
372 $(ASM_OBJ): %.o: Makefile.dep
374 @echo "assembling $*.o from $*.S"
375 @$(CC) $(CFLAGS) -c -o $@ $<
377 $(PLUGIN_OBJ): %.so: Makefile.dep
378 $(PLUGIN_OBJ): %.so: .dep/%.d
381 plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
382 @echo "compiling $*.so from $*.c"
384 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
386 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
389 plugins/aout/aout_esd.so: %.so: %.c
390 @echo "compiling $*.so from $*.c"
392 @$(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
394 @$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
398 plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
399 plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
400 @echo "compiling $*.so from $*.c"
402 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
404 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
407 plugins/intf/intf_x11.so plugins/vout/vout_x11.so: %.so: %.c
408 @echo "compiling $*.so from $*.c"
409 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
411 plugins/intf/intf_gnome.so: %.so: %.c
412 @echo "compiling $*.so from $*.c"
413 @$(CC) $(CCFLAGS) $(CFLAGS) $(LCFLAGS) `gnome-config --libs --cflags gnomeui` -shared -o $@ $< plugins/intf/intf_gnome_callbacks.c plugins/intf/intf_gnome_interface.c plugins/intf/intf_gnome_support.c
415 plugins/vout/vout_gnome.so: %.so: %.c
416 @echo "compiling $*.so from $*.c"
417 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
419 plugins/intf/intf_glide.so plugins/vout/vout_glide.so: %.so: %.c
420 @echo "compiling $*.so from $*.c"
421 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
423 plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
424 @echo "compiling $*.so from $*.c"
425 @$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
428 ################################################################################
429 # Note on generic rules and dependancies
430 ################################################################################
432 # Note on dependancies: each .c file is associated with a .d file, which
433 # depends of it. The .o file associated with a .c file depends of the .d, of the
434 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
436 # The dep directory should be ignored by CVS.
438 # Note on inclusions: depending of the target, the dependancies files must
439 # or must not be included. The problem is that if we ask make to include a file,
440 # and this file does not exist, it is made before it can be included. In a
441 # general way, a .d file should be included if and only if the corresponding .o
442 # needs to be re-made.
444 # Two makefiles are used: the main one (this one) has regular generic rules,
445 # except for .o files, for which it calls the object Makefile. Dependancies
446 # are not included in this file.
447 # The object Makefile known how to make a .o from a .c, and includes
448 # dependancies for the target, but only those required.