]> git.sesse.net Git - vlc/blob - Makefile.in
* Splitted up p_method_data/p_plugin_data ;
[vlc] / Makefile.in
1 ################################################################################
2 # vlc (VideoLAN Client) main makefile
3 # (c)1998 VideoLAN
4 ################################################################################
5 # This makefile is the main makefile for the VideoLAN client.
6 ################################################################################
7
8 ################################################################################
9 # Configuration
10 ################################################################################
11
12 # Debugging mode on or off (set to 1 to activate)
13 DEBUG=@DEBUG@
14 STATS=@STATS@
15 OPTIMS=@OPTIMS@
16
17 SYS=@SYS@
18 PLUGINS=@PLUGINS@
19 SNAPSHOTDIR=vlc-@VLC_VERSION@
20 INSTALL=@INSTALL@
21 ARCH=@ARCH@
22 prefix=@prefix@
23 CC=@CC@
24 SHELL=@SHELL@
25
26
27 #----------------- do not change anything below this line ----------------------
28
29 ################################################################################
30 # Configuration pre-processing
31 ################################################################################
32
33 # PROGRAM_OPTIONS is an identification string of the compilation options
34 PROGRAM_OPTIONS = $(SYS) $(ARCH)
35 ifeq ($(DEBUG),1)
36 PROGRAM_OPTIONS += DEBUG
37 DEFINE += -DDEBUG
38 endif
39 ifeq ($(STATS),1)
40 PROGRAM_OPTIONS += DEBUG
41 DEFINE += -DSTATS
42 endif
43
44 # PROGRAM_BUILD is a complete identification of the build
45 # ( we can't use fancy options with date since OSes like Solaris
46 # or FreeBSD have strange date implementations )
47 PROGRAM_BUILD = `date` $(USER)
48 # XXX: beos does not support hostname
49 #PROGRAM_BUILD = `date` $(USER)@`hostname`
50
51 # DEFINE will contain some of the constants definitions decided in Makefile, 
52 # including SYS_xx. It will be passed to C compiler.
53 DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z A-Z)
54
55 ################################################################################
56 # Tuning and other variables - do not change anything except if you know
57 # exactly what you are doing
58 ################################################################################
59
60 #
61 # C headers directories
62 #
63 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
64
65 #
66 # Libraries
67 #
68 ifeq ($(SYS),gnu)
69 LIB += -lthreads -ldl
70 endif
71
72 ifneq (,$(findstring bsd,$(SYS)))
73 LIB += -pthread -lgnugetopt
74 LIB += -L/usr/local/lib
75 endif
76
77 ifneq (,$(findstring linux,$(SYS)))
78 LIB += -lpthread -ldl
79 endif
80
81 ifneq (,$(findstring solaris,$(SYS)))
82 LIB += -ldl -lsocket -lnsl -lposix4 -lpthread
83 endif
84
85 ifeq ($(SYS),beos)
86 LIB += -lbe -lroot -lgame
87 else
88 LIB += -lm
89 endif
90
91 #
92 # C compiler flags: mainstream compilation
93 #
94 CFLAGS += $(DEFINE) $(INCLUDE)
95 CFLAGS += -Wall -Winline
96 CFLAGS += -D_REENTRANT
97 CFLAGS += -D_GNU_SOURCE
98
99 # flags needed for clean beos compilation
100 ifeq ($(SYS),beos)
101 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
102 endif
103
104 # Optimizations : don't compile debug versions with them
105 ifeq ($(OPTIMS),1)
106 CFLAGS += -O6
107 CFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
108 CFLAGS += -funroll-all-loops -fstrict-aliasing
109 #CFLAGS += -fomit-frame-pointer
110
111 # Optimizations for x86 familiy
112 ifneq (,$(findstring 86,$(ARCH)))
113 CFLAGS += -malign-double
114 # Optional Pentium Pro optimizations
115 ifneq (,$(findstring ppro,$(ARCH)))
116 ifneq ($(SYS), BSD)
117 CFLAGS += -march=pentiumpro
118 endif
119 else
120 CFLAGS += -march=pentium
121 endif
122 endif
123
124 # Optimizations for PowerPC
125 ifneq (,$(findstring powerpc,$(ARCH)))
126 # 604e
127 CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
128 # G3
129 #CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
130 # G4
131 #CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
132 endif
133
134 # Optimizations for Sparc
135 ifneq (,$(findstring sparc,$(ARCH)))
136 CFLAGS += -mhard-float
137 endif
138
139 #end of optimisations
140 endif
141
142 # Optional MMX optimizations for x86
143 ifneq (,$(findstring mmx,$(ARCH)))
144 CFLAGS += -DHAVE_MMX
145 endif
146
147 #
148 # C compiler flags: plugin compilation
149 #
150 ifneq (,$(findstring solaris,$(SYS)))
151 PCFLAGS += -fPIC
152 endif
153
154 #
155 # C compiler flags: dependancies
156 #
157 DCFLAGS += $(INCLUDE)
158 DCFLAGS += -MM
159
160 #
161 # C compiler flags: linking
162 #
163 LCFLAGS += $(LIB)
164 LCFLAGS += -Wall
165 #LCFLAGS += -s
166
167 #
168 # Debugging and profiling support (unless optimisations are active)
169 #
170 ifneq ($(OPTIMS),1)
171 CFLAGS += -g
172 endif
173
174 #################################################################################
175 # Objects and files
176 #################################################################################
177
178 #
179 # C Objects
180
181 INTERFACE =     src/interface/main.o \
182                 src/interface/interface.o \
183                 src/interface/intf_msg.o \
184                 src/interface/intf_cmd.o \
185                 src/interface/intf_ctrl.o \
186                 src/interface/intf_console.o
187
188 INPUT =         src/input/input_ps.o \
189                 src/input/input_ts.o \
190                 src/input/mpeg_system.o \
191                 src/input/input_ext-dec.o \
192                 src/input/input_programs.o \
193                 src/input/input_netlist.o \
194                 src/input/input.o
195
196 AUDIO_OUTPUT =  src/audio_output/audio_output.o
197
198 VIDEO_OUTPUT =  src/video_output/video_output.o \
199                 src/video_output/video_text.o \
200                 src/video_output/video_spu.o \
201                 src/video_output/video_yuv.o
202
203 AC3_DECODER =   src/ac3_decoder/ac3_decoder_thread.o \
204                 src/ac3_decoder/ac3_decoder.o \
205                 src/ac3_decoder/ac3_parse.o \
206                 src/ac3_decoder/ac3_exponent.o \
207                 src/ac3_decoder/ac3_bit_allocate.o \
208                 src/ac3_decoder/ac3_mantissa.o \
209                 src/ac3_decoder/ac3_rematrix.o \
210                 src/ac3_decoder/ac3_imdct.o \
211                 src/ac3_decoder/ac3_downmix.o
212
213 LPCM_DECODER =  src/lpcm_decoder/lpcm_decoder_thread.o \
214                 src/lpcm_decoder/lpcm_decoder.o
215
216 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
217                 src/audio_decoder/adec_generic.o \
218                 src/audio_decoder/adec_layer1.o \
219                 src/audio_decoder/adec_layer2.o \
220                 src/audio_decoder/adec_math.o
221
222 SPU_DECODER =   src/spu_decoder/spu_decoder.o
223
224 #GEN_DECODER =  src/generic_decoder/generic_decoder.o
225
226
227 VIDEO_PARSER =  src/video_parser/video_parser.o \
228                 src/video_parser/vpar_headers.o \
229                 src/video_parser/vpar_blocks.o \
230                 src/video_parser/vpar_synchro.o \
231                 src/video_parser/video_fifo.o
232
233 ifneq (,$(findstring mmx,$(ARCH)))
234         vdec_motion_inner = src/video_decoder/vdec_motion_inner_mmx.o
235 else
236         vdec_motion_inner = src/video_decoder/vdec_motion_inner.o
237 endif
238
239 VIDEO_DECODER = src/video_decoder/video_decoder.o \
240                 src/video_decoder/vdec_motion.o \
241                 src/video_decoder/vdec_idct.o \
242                 $(vdec_motion_inner)
243
244 MISC =          src/misc/mtime.o \
245                 src/misc/tests.o \
246                 src/misc/rsc_files.o \
247                 src/misc/netutils.o \
248                 src/misc/playlist.o \
249                 src/misc/plugins.o
250
251
252 C_OBJ =         $(INTERFACE) \
253                 $(INPUT) \
254                 $(VIDEO_OUTPUT) \
255                 $(AUDIO_OUTPUT) \
256                 $(AC3_DECODER) \
257                 $(LPCM_DECODER) \
258                 $(AUDIO_DECODER) \
259                 $(SPU_DECODER) \
260                 $(GEN_DECODER) \
261                 $(VIDEO_PARSER) \
262                 $(VIDEO_DECODER) \
263                 $(MISC)
264
265
266 #
267 # CPP Objects
268
269 ifeq ($(SYS),beos)
270 CPP_OBJ =       src/misc/beos_specific.o
271 endif
272
273 #
274 # Assembler Objects
275
276 ifneq (,$(findstring 86,$(ARCH)))
277 ifneq (,$(findstring mmx,$(ARCH)))
278 ASM_OBJ =       src/video_decoder/vdec_idctmmx.o \
279                 src/video_output/video_yuv_mmx.o
280 endif
281 endif
282
283 #
284 # Plugins
285 #
286 PLUGIN_BEOS =   plugins/beos/beos.o \
287                 plugins/beos/aout_beos.o \
288                 plugins/beos/intf_beos.o \
289                 plugins/beos/vout_beos.o
290
291 PLUGIN_DSP =    plugins/dsp/dsp.o \
292                 plugins/dsp/aout_dsp.o \
293
294 PLUGIN_DUMMY =  plugins/dummy/dummy.o \
295                 plugins/dummy/aout_dummy.o \
296                 plugins/dummy/intf_dummy.o \
297                 plugins/dummy/vout_dummy.o
298
299 PLUGIN_ESD =    plugins/esd/esd.o \
300                 plugins/esd/aout_esd.o
301
302 PLUGIN_FB =     plugins/fb/fb.o \
303                 plugins/fb/intf_fb.o \
304                 plugins/fb/vout_fb.o
305
306 PLUGIN_GGI =    plugins/ggi/ggi.o \
307                 plugins/ggi/intf_ggi.o \
308                 plugins/ggi/vout_ggi.o
309
310 PLUGIN_SDL =    plugins/sdl/sdl.o \
311                 plugins/sdl/intf_sdl.o \
312                 plugins/sdl/vout_sdl.o 
313 #               plugins/sdl/video_yuv.o \
314 #               plugins/sdl/video_yuvall.o
315
316 PLUGIN_GLIDE =  plugins/glide/glide.o \
317                 plugins/glide/intf_glide.o \
318                 plugins/glide/vout_glide.o
319
320 PLUGIN_GNOME =  plugins/gnome/gnome.o \
321                 plugins/gnome/intf_gnome.o \
322                 plugins/gnome/intf_gnome_callbacks.o \
323                 plugins/gnome/intf_gnome_interface.o \
324                 plugins/gnome/intf_gnome_support.o \
325                 plugins/gnome/vout_gnome.o
326
327 PLUGIN_MGA =    plugins/mga/mga.o \
328                 plugins/mga/intf_mga.o \
329                 plugins/mga/vout_mga.o
330
331 PLUGIN_X11=     plugins/x11/x11.o \
332                 plugins/x11/intf_x11.o \
333                 plugins/x11/vout_x11.o
334
335 PLUGIN_YUV =    plugins/yuv/yuv.o \
336                 plugins/yuv/video_yuv.o \
337                 plugins/yuv/video_yuv8.o \
338                 plugins/yuv/video_yuv15.o \
339                 plugins/yuv/video_yuv16.o \
340                 plugins/yuv/video_yuv24.o \
341                 plugins/yuv/video_yuv32.o
342
343 PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
344                 plugins/yuvmmx/video_yuv.o \
345                 plugins/yuvmmx/video_yuv8.o \
346                 plugins/yuvmmx/video_yuv15.o \
347                 plugins/yuvmmx/video_yuv16.o \
348                 plugins/yuvmmx/video_yuv24.o \
349                 plugins/yuvmmx/video_yuv32.o
350
351 PLUGIN_ALSA =   plugins/alsa/alsa.o \
352                 plugins/alsa/aout_alsa.o
353
354 STD_PLUGIN_OBJ =$(PLUGIN_BEOS) \
355                 $(PLUGIN_DSP) \
356                 $(PLUGIN_DUMMY) \
357                 $(PLUGIN_ESD) \
358                 $(PLUGIN_FB) \
359                 $(PLUGIN_GGI) \
360                 $(PLUGIN_MGA) \
361                 $(PLUGIN_X11) \
362                 $(PLUGIN_YUV) \
363                 $(PLUGIN_YUVMMX) \
364                 $(PLUGIN_SDL) \
365                 $(PLUGIN_ALSA)
366
367 #
368 # Other lists of files
369 #
370 objects := $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
371 dependancies := $(objects:%.o=.dep/%.d)
372
373 # All symbols must be exported
374 export
375
376 ################################################################################
377 # Targets
378 ################################################################################
379
380 #
381 # Virtual targets
382 #
383 all: vlc @ALIASES@ plugins
384
385 clean:
386         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
387         rm -f vlc @ALIASES@ lib/*.so
388
389 distclean: clean
390         rm -f src/*/*.o plugins/*/*.o **/*~ *.log
391         rm -f Makefile include/defs.h include/config.h
392         rm -f config.status config.cache config.log
393         rm -f gmon.out core build-stamp
394         rm -rf .dep
395         rm -rf debian/tmp debian/files debian/*.debhelper debian/*.substvars
396         find debian/* -type d -maxdepth 0 -name 'vlc-*' | xargs rm -rf
397
398 install:
399         mkdir -p $(prefix)/bin
400         $(INSTALL) vlc $(prefix)/bin
401 # ugly
402         for alias in "" @ALIASES@ ; do if test $$alias ; then ln -s vlc $(prefix)/bin/$$alias ; fi ; done
403         mkdir -p $(prefix)/lib/videolan/vlc
404         $(INSTALL) -m 644 $(PLUGINS) $(prefix)/lib/videolan/vlc
405         mkdir -p $(prefix)/share/videolan
406         $(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan
407         $(INSTALL) -m 644 share/*.png $(prefix)/share/videolan
408
409 show:
410         @echo CC: $(CC)
411         @echo CFLAGS: $(CFLAGS)
412         @echo DCFLAGS: $(DCFLAGS)
413         @echo LCFLAGS: $(LCFLAGS)
414
415 # ugliest of all, but I have no time to do it -- sam
416 snapshot:
417         rm -rf /tmp/${SNAPSHOTDIR}
418         mkdir /tmp/${SNAPSHOTDIR}
419         cp -a * /tmp/${SNAPSHOTDIR}
420                 (cd /tmp/${SNAPSHOTDIR} ; \
421                 make distclean ; \
422                 find . -type d -name CVS | xargs rm -rf ; \
423                 find . -type f -name '.*.swp' | xargs rm -f ; \
424                 find . -type f -name '.cvsignore' | xargs rm -f ; \
425                 cd .. ; \
426                 tar czvf ${SNAPSHOTDIR}.tar.gz ${SNAPSHOTDIR} ; \
427                 tar cIvf ${SNAPSHOTDIR}.tar.bz2 ${SNAPSHOTDIR} )
428         rm -rf /tmp/${SNAPSHOTDIR}
429         mv /tmp/${SNAPSHOTDIR}.tar.gz ..
430         mv /tmp/${SNAPSHOTDIR}.tar.bz2 ..
431         @echo "Sources are in ../${SNAPSHOTDIR}.tar.[gz,bz2]"
432
433 plugins: $(PLUGINS:%=lib/%.so)
434
435 FORCE:
436
437 #
438 # Gnome and Framebuffer aliases - don't add new aliases which could bloat
439 # the namespace
440 #
441 gvlc fbvlc: vlc
442         rm -f $@ && ln -s vlc $@
443
444
445 #
446 # Generic rules (see below)
447 #
448 $(dependancies): %.d: FORCE
449         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
450
451 $(C_OBJ): %.o: Makefile.dep
452 $(C_OBJ): %.o: .dep/%.d
453 $(C_OBJ): %.o: %.c
454         $(CC) $(CFLAGS) -c -o $@ $<
455
456 $(CPP_OBJ): %.o: %.cpp
457         $(CC) $(CFLAGS) -c -o $@ $<
458
459 $(ASM_OBJ): %.o: Makefile.dep
460 $(ASM_OBJ): %.o: %.S
461         $(CC) $(CFLAGS) -c -o $@ $<
462
463 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
464 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
465 $(STD_PLUGIN_OBJ): %.o: %.c
466         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
467
468 $(PLUGIN_GNOME): %.o: Makefile.dep
469 $(PLUGIN_GNOME): %.o: %.c
470         $(CC) $(CFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
471
472 $(PLUGIN_GLIDE): %.o: Makefile.dep
473 $(PLUGIN_GLIDE): %.o: %.c
474         $(CC) $(CFLAGS) -I/usr/include/glide -c -o $@ $<
475
476 #
477 # Real targets
478 #
479 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
480 ifeq ($(SYS),beos)
481         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
482         rm -f ./plugins/_APP_
483         ln -s ../vlc ./plugins/_APP_
484 else
485         $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)      
486 endif
487
488 lib/beos.so: $(PLUGIN_BEOS)
489         $(CC) $(CFLAGS) $(LCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
490
491 lib/esd.so: $(PLUGIN_ESD)
492 ifneq (,$(findstring bsd,$(SYS)))
493         $(CC) -shared -lesd -o $@ $^
494 else
495         $(CC) -shared -laudiofile -lesd -o $@ $^
496 endif
497
498 lib/dsp.so: $(PLUGIN_DSP)
499         $(CC) -shared -o $@ $^
500
501 lib/alsa.so: $(PLUGIN_ALSA)
502         $(CC) -shared -o $@ $^
503
504 lib/dummy.so: $(PLUGIN_DUMMY)
505         $(CC) -shared -o $@ $^
506
507 lib/fb.so: $(PLUGIN_FB)
508         $(CC) -shared -o $@ $^
509
510 lib/x11.so: $(PLUGIN_X11)
511         $(CC) -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
512
513 lib/mga.so: $(PLUGIN_MGA)
514         $(CC) -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
515
516 lib/gnome.so: $(PLUGIN_GNOME)
517         $(CC) -shared `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` -o $@ $^
518
519 lib/glide.so: $(PLUGIN_GLIDE)
520         $(CC) -shared -lglide2x -o $@ $^
521
522 lib/ggi.so: $(PLUGIN_GGI)
523         $(CC) -shared -lggi -o $@ $^
524
525 lib/sdl.so: $(PLUGIN_SDL)
526         $(CC) -shared -lSDL -o $@ $^
527
528 lib/yuv.so: $(PLUGIN_YUV)
529 ifeq ($(SYS),beos)
530         $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
531 else
532         $(CC) -shared -o $@ $^
533 endif
534
535 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
536 ifeq ($(SYS),beos)
537         $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
538 else
539         $(CC) $(LCFLAGS) -shared -o $@ $^
540 endif
541
542 ################################################################################
543 # Note on generic rules and dependancies
544 ################################################################################
545
546 # Note on dependancies: each .c file is associated with a .d file, which
547 # depends of it. The .o file associated with a .c file depends of the .d, of the
548 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
549 # directory.
550 # The dep directory should be ignored by CVS.
551
552 # Note on inclusions: depending of the target, the dependancies files must
553 # or must not be included. The problem is that if we ask make to include a file,
554 # and this file does not exist, it is made before it can be included. In a
555 # general way, a .d file should be included if and only if the corresponding .o
556 # needs to be re-made.
557
558 # Two makefiles are used: the main one (this one) has regular generic rules,
559 # except for .o files, for which it calls the object Makefile. Dependancies
560 # are not included in this file.
561 # The object Makefile known how to make a .o from a .c, and includes
562 # dependancies for the target, but only those required.