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 ----------------------
74 ################################################################################
75 # Configuration pre-processing
76 ################################################################################
78 # PROGRAM_OPTIONS is an identification string of the compilation options
79 PROGRAM_OPTIONS = $(SYS) $(ARCH)
81 PROGRAM_OPTIONS += DEBUG
84 # PROGRAM_BUILD is a complete identification of the build
85 # ( we can't use fancy options with date since OSes like Solaris
86 # or FreeBSD have strange date implementations )
87 PROGRAM_BUILD = `date` $(USER)
88 # XXX: beos does not support hostname
89 #PROGRAM_BUILD = `date` $(USER)@`hostname`
91 # DEFINE will contain some of the constants definitions decided in Makefile,
92 # including ARCH_xx and SYS_xx. It will be passed to C compiler.
93 DEFINE += -DARCH_$(shell echo $(ARCH) | cut -f1 -d' ')
94 DEFINE += -DSYS_$(SYS)
95 DEFINE += -DPLUGIN_PATH="\"$(prefix)/lib/videolan/vlc\""
96 DEFINE += -DDATA_PATH="\"$(prefix)/share/videolan/vlc\""
97 #DEFINE += -DPROGRAM_OPTIONS="\"$(shell echo $(PROGRAM_OPTIONS) | tr 'A-Z' 'a-z')\""
98 #DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
103 ################################################################################
104 # Tuning and other variables - do not change anything except if you know
105 # exactly what you are doing
106 ################################################################################
109 # C headers directories
111 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
118 LIB += -lthreads -ldl
122 LIB += -pthread -lgnugetopt
123 LIB += -L/usr/local/lib
127 LIB += -lpthread -ldl
131 LIB += -llibroot -llibgame -llibbe
137 # C compiler flags: compilation
139 CCFLAGS += $(DEFINE) $(INCLUDE)
141 CCFLAGS += -D_REENTRANT
142 CCFLAGS += -D_GNU_SOURCE
144 # Optimizations : don't compile debug versions with them
146 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
147 CCFLAGS += -fomit-frame-pointer
149 # Optimizations for x86 familiy
150 ifneq (,$(findstring X86,$(ARCH)))
151 CCFLAGS += -malign-double
152 #CCFLAGS += -march=pentium
153 # Eventual Pentium Pro optimizations
154 ifneq (,$(findstring PPRO,$(ARCH)))
156 CCFLAGS += -march=pentiumpro
159 # Eventual MMX optimizations for x86
160 ifneq (,$(findstring MMX,$(ARCH)))
165 # Optimizations for PowerPC
166 ifneq (,$(findstring PPC,$(ARCH)))
167 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
170 # Optimizations for Sparc
171 ifneq (,$(findstring SPARC,$(ARCH)))
172 CCFLAGS += -mhard-float
176 # C compiler flags: dependancies
178 DCFLAGS += $(INCLUDE)
182 # C compiler flags: linking
189 # Additionnal debugging flags
198 #################################################################################
200 #################################################################################
205 interface_obj = interface/main.o \
206 interface/interface.o \
207 interface/intf_msg.o \
208 interface/intf_cmd.o \
209 interface/intf_ctrl.o \
210 interface/intf_console.o
212 input_obj = input/input_vlan.o \
214 input/input_netlist.o \
215 input/input_network.o \
221 audio_output_obj = audio_output/audio_output.o
223 video_output_obj = video_output/video_output.o \
224 video_output/video_text.o \
225 video_output/video_spu.o \
226 video_output/video_yuv.o
228 ac3_decoder_obj = ac3_decoder/ac3_decoder_thread.o \
229 ac3_decoder/ac3_decoder.o \
230 ac3_decoder/ac3_parse.o \
231 ac3_decoder/ac3_exponent.o \
232 ac3_decoder/ac3_bit_allocate.o \
233 ac3_decoder/ac3_mantissa.o \
234 ac3_decoder/ac3_rematrix.o \
235 ac3_decoder/ac3_imdct.o \
236 ac3_decoder/ac3_downmix.o
238 audio_decoder_obj = audio_decoder/audio_decoder_thread.o \
239 audio_decoder/audio_decoder.o \
240 audio_decoder/audio_math.o
242 spu_decoder_obj = spu_decoder/spu_decoder.o
244 #??generic_decoder_obj = generic_decoder/generic_decoder.o
245 # remeber to add it to OBJ
247 ifeq ($(DECODER),old)
248 CFLAGS += -DOLD_DECODER
249 video_decoder_obj = video_decoder_ref/video_decoder.o \
250 video_decoder_ref/display.o \
251 video_decoder_ref/getblk.o \
252 video_decoder_ref/gethdr.o \
253 video_decoder_ref/getpic.o \
254 video_decoder_ref/getvlc.o \
255 video_decoder_ref/idct.o \
256 video_decoder_ref/motion.o \
257 video_decoder_ref/mpeg2dec.o \
258 video_decoder_ref/recon.o \
259 video_decoder_ref/spatscal.o
261 video_parser_obj = video_parser/video_parser.o \
262 video_parser/vpar_headers.o \
263 video_parser/vpar_blocks.o \
264 video_parser/vpar_synchro.o \
265 video_parser/video_fifo.o
267 video_decoder_obj = video_decoder/video_decoder.o \
268 video_decoder/vdec_motion.o \
269 video_decoder/vdec_motion_inner.o \
270 video_decoder/vdec_idct.o
273 misc_obj = misc/mtime.o \
279 C_OBJ = $(interface_obj) \
281 $(audio_output_obj) \
282 $(video_output_obj) \
284 $(audio_decoder_obj) \
286 $(generic_decoder_obj) \
287 $(video_parser_obj) \
288 $(video_decoder_obj) \
295 ifneq (,$(findstring X86,$(ARCH)))
296 ifneq (,$(findstring MMX,$(ARCH)))
297 ifeq ($(DECODER),new)
298 ASM_OBJ = video_decoder/vdec_idctmmx.o \
299 video_output/video_yuv_mmx.o
301 ASM_OBJ = video_decoder_ref/vdec_idctmmx.o \
302 video_output/video_yuv_mmx.o
310 intf_plugin = $(INTF:%=plugins/intf/intf_%.so)
311 aout_plugin = $(AOUT:%=plugins/aout/aout_%.so)
312 vout_plugin = $(VOUT:%=plugins/vout/vout_%.so)
314 PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
317 # Other lists of files
319 C_OBJ := $(C_OBJ:%.o=src/%.o)
320 ASM_OBJ := $(ASM_OBJ:%.o=src/%.o)
321 sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c)
322 dependancies := $(sources:%.c=.dep/%.d)
324 # All symbols must be exported
327 ################################################################################
329 ################################################################################
337 rm -f $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
340 rm -f **/*.o **/*.so **/*~ *.log
341 rm -f Makefile include/defs.h config.cache config.log
342 rm -f vlc gmon.out core
346 $(INSTALL) vlc $(prefix)/bin
347 mkdir -p $(prefix)/lib/videolan/vlc
348 $(INSTALL) $(PLUGIN_OBJ) $(prefix)/lib/videolan/vlc
349 $(INSTALL) share/*.psf $(prefix)/share/videolan/vlc
350 $(INSTALL) share/*.png $(prefix)/share/videolan/vlc
353 @echo "Command line for C objects:"
354 @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
356 @echo "Command line for assembler objects:"
357 @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
364 vlc: $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
365 $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(ASM_OBJ)
368 # Generic rules (see below)
370 $(dependancies): %.d: FORCE
371 @$(MAKE) -s --no-print-directory -f Makefile.dep $@
373 $(C_OBJ): %.o: Makefile.dep
374 $(C_OBJ): %.o: .dep/%.d
376 @echo "compiling $*.o from $*.c"
377 @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
379 $(ASM_OBJ): %.o: Makefile.dep
381 @echo "assembling $*.o from $*.S"
382 @$(CC) $(CFLAGS) -c -o $@ $<
384 $(PLUGIN_OBJ): %.so: Makefile.dep
385 $(PLUGIN_OBJ): %.so: .dep/%.d
388 plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
389 @echo "compiling $*.so from $*.c"
391 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
393 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
396 plugins/aout/aout_esd.so: %.so: %.c
397 @echo "compiling $*.so from $*.c"
399 @$(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
401 @$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
405 plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
406 plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
407 @echo "compiling $*.so from $*.c"
409 @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
411 @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
414 plugins/intf/intf_x11.so plugins/vout/vout_x11.so: %.so: %.c
415 @echo "compiling $*.so from $*.c"
416 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
418 plugins/intf/intf_gnome.so: %.so: %.c
419 @echo "compiling $*.so from $*.c"
420 @$(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
422 plugins/vout/vout_gnome.so: %.so: %.c
423 @echo "compiling $*.so from $*.c"
424 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
426 plugins/intf/intf_glide.so plugins/vout/vout_glide.so: %.so: %.c
427 @echo "compiling $*.so from $*.c"
428 @$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
430 plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
431 @echo "compiling $*.so from $*.c"
432 @$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
435 ################################################################################
436 # Note on generic rules and dependancies
437 ################################################################################
439 # Note on dependancies: each .c file is associated with a .d file, which
440 # depends of it. The .o file associated with a .c file depends of the .d, of the
441 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
443 # The dep directory should be ignored by CVS.
445 # Note on inclusions: depending of the target, the dependancies files must
446 # or must not be included. The problem is that if we ask make to include a file,
447 # and this file does not exist, it is made before it can be included. In a
448 # general way, a .d file should be included if and only if the corresponding .o
449 # needs to be re-made.
451 # Two makefiles are used: the main one (this one) has regular generic rules,
452 # except for .o files, for which it calls the object Makefile. Dependancies
453 # are not included in this file.
454 # The object Makefile known how to make a .o from a .c, and includes
455 # dependancies for the target, but only those required.