]> git.sesse.net Git - vlc/blob - Makefile.in
* Ported Glide and MGA plugins to the new module API. MGA never worked,
[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 INSTALL=@INSTALL@
20 ARCH=@ARCH@
21
22 exec_prefix=@exec_prefix@
23 prefix=@prefix@
24 bindir=@bindir@
25 datadir=@datadir@
26 libdir=@libdir@
27
28 CC=@CC@
29 SHELL=@SHELL@
30
31 LIB_SDL=@LIB_SDL@
32 LIB_GLIDE=@LIB_GLIDE@
33 LIB_GGI=@LIB_GGI@
34
35 #----------------- do not change anything below this line ----------------------
36
37 ################################################################################
38 # Configuration pre-processing
39 ################################################################################
40
41 # PROGRAM_OPTIONS is an identification string of the compilation options
42 PROGRAM_OPTIONS = $(SYS) $(ARCH)
43 ifeq ($(DEBUG),1)
44 PROGRAM_OPTIONS += DEBUG
45 DEFINE += -DDEBUG
46 endif
47 ifeq ($(STATS),1)
48 PROGRAM_OPTIONS += DEBUG
49 DEFINE += -DSTATS
50 endif
51
52 # PROGRAM_BUILD is a complete identification of the build
53 # (we can't use fancy options with date since OSes like Solaris
54 # or FreeBSD have strange date implementations)
55 PROGRAM_BUILD = `date` $(USER)
56 # XXX: beos does not support hostname (how lame...)
57 #PROGRAM_BUILD = `date` $(USER)@`hostname`
58
59 # DEFINE will contain some of the constants definitions decided in Makefile, 
60 # including SYS_xx. It will be passed to C compiler.
61 DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z. A-Z_)
62
63 # On Linux activate 64-bit off_t (by default under BSD)
64 ifneq (,$(findstring linux,$(SYS)))
65 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
66 endif
67
68 ################################################################################
69 # Tuning and other variables - do not change anything except if you know
70 # exactly what you are doing
71 ################################################################################
72
73 #
74 # C headers directories
75 #
76 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
77
78 #
79 # Libraries
80 #
81 ifeq ($(SYS),gnu)
82 LIB += -lthreads -ldl
83 endif
84
85 ifneq (,$(findstring bsd,$(SYS)))
86 LIB += -pthread -lgnugetopt
87 LIB += -L/usr/local/lib
88 endif
89
90 ifneq (,$(findstring linux,$(SYS)))
91 LIB += -lpthread -ldl
92 endif
93
94 ifneq (,$(findstring solaris,$(SYS)))
95 LIB += -ldl -lsocket -lnsl -lpthread
96 endif
97
98 ifeq ($(SYS),beos)
99 LIB += -lbe -lroot -lgame
100 else
101 LIB += -lm
102 endif
103
104 #
105 # C compiler flags: mainstream compilation
106 #
107 CFLAGS += $(DEFINE) $(INCLUDE)
108 CFLAGS += -Wall -Winline
109 CFLAGS += -D_REENTRANT
110 CFLAGS += -D_GNU_SOURCE
111
112 # flags needed for clean beos compilation
113 ifeq ($(SYS),beos)
114 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
115 endif
116
117 # Optimizations : don't compile debug versions with them
118 ifeq ($(OPTIMS),1)
119 CFLAGS += -O3
120 CFLAGS += -ffast-math -funroll-loops
121 CFLAGS += -fomit-frame-pointer
122
123 # Optimizations for x86 familiy
124 ifneq (,$(findstring 86,$(ARCH)))
125 # Optional Pentium Pro optimizations
126 ifneq (,$(findstring ppro,$(ARCH)))
127 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
128 else
129 CFLAGS += -march=pentium -mcpu=pentium
130 endif
131 endif
132
133 # Optimizations for PowerPC
134 ifneq (,$(findstring powerpc,$(ARCH)))
135 # 604e
136 CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
137 # G3
138 #CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
139 # G4
140 #CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
141 endif
142
143 # Optimizations for Sparc
144 ifneq (,$(findstring sparc,$(ARCH)))
145 CFLAGS += -mhard-float
146 endif
147
148 #end of optimisations
149 endif
150
151 # Optional MMX optimizations for x86
152 ifneq (,$(findstring mmx,$(ARCH)))
153 CFLAGS += -DHAVE_MMX
154 endif
155
156 #
157 # C compiler flags: plugin compilation
158 #
159 PCFLAGS += -fPIC
160
161 #
162 # C compiler flags: dependancies
163 #
164 DCFLAGS += $(INCLUDE)
165 DCFLAGS += -MM
166
167 #
168 # C compiler flags: linking
169 #
170 LCFLAGS += $(LIB)
171 LCFLAGS += -Wall
172 #LCFLAGS += -s
173
174 #
175 # Debugging and profiling support (unless optimisations are active)
176 #
177 ifneq ($(OPTIMS),1)
178 CFLAGS += -g
179 endif
180
181 #################################################################################
182 # Objects and files
183 #################################################################################
184
185 #
186 # C Objects
187
188 INTERFACE =     src/interface/main.o \
189                 src/interface/interface.o \
190                 src/interface/intf_msg.o \
191                 src/interface/intf_cmd.o \
192                 src/interface/intf_ctrl.o \
193                 src/interface/intf_plst.o \
194                 src/interface/intf_channels.o \
195                 src/interface/intf_console.o
196
197 INPUT =         src/input/input_ext-dec.o \
198                 src/input/input_ext-intf.o \
199                 src/input/input_dec.o \
200                 src/input/input_programs.o \
201                 src/input/input_netlist.o \
202                 src/input/input_clock.o \
203                 src/input/input.o \
204                 src/input/mpeg_system.o
205
206 AUDIO_OUTPUT =  src/audio_output/audio_output.o
207
208 VIDEO_OUTPUT =  src/video_output/video_output.o \
209                 src/video_output/video_text.o \
210                 src/video_output/video_spu.o \
211                 src/video_output/video_yuv.o
212
213 AC3_DECODER =   src/ac3_decoder/ac3_decoder_thread.o \
214                 src/ac3_decoder/ac3_decoder.o \
215                 src/ac3_decoder/ac3_parse.o \
216                 src/ac3_decoder/ac3_exponent.o \
217                 src/ac3_decoder/ac3_bit_allocate.o \
218                 src/ac3_decoder/ac3_mantissa.o \
219                 src/ac3_decoder/ac3_rematrix.o \
220                 src/ac3_decoder/ac3_imdct.o \
221                 src/ac3_decoder/ac3_downmix.o
222
223 LPCM_DECODER =  src/lpcm_decoder/lpcm_decoder_thread.o \
224                 src/lpcm_decoder/lpcm_decoder.o
225
226 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
227                 src/audio_decoder/adec_generic.o \
228                 src/audio_decoder/adec_layer1.o \
229                 src/audio_decoder/adec_layer2.o \
230                 src/audio_decoder/adec_math.o
231
232 SPU_DECODER =   src/spu_decoder/spu_decoder.o
233
234 #GEN_DECODER =  src/generic_decoder/generic_decoder.o
235
236 VIDEO_PARSER =  src/video_parser/video_parser.o \
237                 src/video_parser/vpar_headers.o \
238                 src/video_parser/vpar_blocks.o \
239                 src/video_parser/vpar_synchro.o \
240                 src/video_parser/video_fifo.o
241
242 VIDEO_DECODER = src/video_decoder/video_decoder.o
243
244 MISC =          src/misc/mtime.o \
245                 src/misc/tests.o \
246                 src/misc/rsc_files.o \
247                 src/misc/modules.o \
248                 src/misc/netutils.o
249
250
251 C_OBJ =         $(INTERFACE) \
252                 $(INPUT) \
253                 $(VIDEO_OUTPUT) \
254                 $(AUDIO_OUTPUT) \
255                 $(AC3_DECODER) \
256                 $(LPCM_DECODER) \
257                 $(AUDIO_DECODER) \
258                 $(SPU_DECODER) \
259                 $(GEN_DECODER) \
260                 $(VIDEO_PARSER) \
261                 $(VIDEO_DECODER) \
262                 $(MISC)
263
264
265 #
266 # CPP Objects
267
268 ifeq ($(SYS),beos)
269 CPP_OBJ =       src/misc/beos_specific.o
270 endif
271
272 #
273 # Assembler Objects
274
275 ifneq (,$(findstring 86,$(ARCH)))
276 ifneq (,$(findstring mmx,$(ARCH)))
277 ASM_OBJ =               
278 endif
279 endif
280
281 #
282 # Plugins
283 #
284 PLUGIN_ALSA =   plugins/alsa/alsa.o \
285                 plugins/alsa/aout_alsa.o
286
287 PLUGIN_BEOS =   plugins/beos/beos.o \
288                 plugins/beos/aout_beos.o \
289                 plugins/beos/intf_beos.o \
290                 plugins/beos/vout_beos.o
291
292 PLUGIN_DSP =    plugins/dsp/dsp.o \
293                 plugins/dsp/aout_dsp.o
294
295 PLUGIN_DUMMY =  plugins/dummy/dummy.o \
296                 plugins/dummy/aout_dummy.o \
297                 plugins/dummy/intf_dummy.o \
298                 plugins/dummy/vout_dummy.o
299
300 PLUGIN_DVD =    plugins/dvd/dvd.o \
301                 plugins/dvd/input_dvd.o \
302                 plugins/dvd/dvd_ioctl.o \
303                 plugins/dvd/dvd_ifo.o \
304                 plugins/dvd/dvd_udf.o \
305                 plugins/dvd/dvd_css.o
306
307 PLUGIN_ESD =    plugins/esd/esd.o \
308                 plugins/esd/aout_esd.o
309
310 PLUGIN_FB =     plugins/fb/fb.o \
311                 plugins/fb/vout_fb.o
312
313 PLUGIN_GGI =    plugins/ggi/ggi.o \
314                 plugins/ggi/vout_ggi.o
315
316 PLUGIN_GLIDE =  plugins/glide/glide.o \
317                 plugins/glide/vout_glide.o
318
319 PLUGIN_GNOME =  plugins/gnome/gnome.o \
320                 plugins/gnome/intf_gnome.o \
321                 plugins/gnome/gnome_callbacks.o \
322                 plugins/gnome/gnome_interface.o \
323                 plugins/gnome/gnome_support.o
324
325 PLUGIN_IDCT =   plugins/idct/idct.o \
326                 plugins/idct/idct_common.o
327
328 PLUGIN_IDCTCLASSIC =    plugins/idct/idctclassic.o \
329                         plugins/idct/idct_common.o
330
331 PLUGIN_IDCTMMX =        plugins/idct/idctmmx.o \
332                         plugins/idct/idct_common.o
333
334 PLUGIN_IDCTMMXEXT =     plugins/idct/idctmmxext.o \
335                         plugins/idct/idct_common.o
336
337 PLUGIN_MGA =    plugins/mga/mga.o \
338                 plugins/mga/vout_mga.o
339
340 PLUGIN_MOTION = plugins/motion/motion.o \
341                 plugins/motion/vdec_motion_common.o \
342                 plugins/motion/vdec_motion_inner.o
343
344 PLUGIN_MOTIONMMX =      plugins/motion/motionmmx.o \
345                         plugins/motion/vdec_motion_common.o \
346                         plugins/motion/vdec_motion_inner_mmx.o
347
348 PLUGIN_MOTIONMMXEXT =   plugins/motion/motionmmxext.o \
349                         plugins/motion/vdec_motion_common.o \
350                         plugins/motion/vdec_motion_inner_mmxext.o
351
352 PLUGIN_NCURSES =        plugins/text/ncurses.o \
353                         plugins/text/intf_ncurses.o
354
355 PLUGIN_NULL =   plugins/null/null.o
356
357 PLUGIN_PS =     plugins/mpeg/ps.o \
358                 plugins/mpeg/input_ps.o
359
360 PLUGIN_SDL =    plugins/sdl/sdl.o \
361                 plugins/sdl/vout_sdl.o \
362                 plugins/sdl/aout_sdl.o 
363
364 PLUGIN_TS =     plugins/mpeg/ts.o \
365                 plugins/mpeg/input_ts.o
366
367 PLUGIN_X11=     plugins/x11/x11.o \
368                 plugins/x11/vout_x11.o
369
370 PLUGIN_YUV =    plugins/yuv/yuv.o \
371                 plugins/yuv/video_yuv.o \
372                 plugins/yuv/transforms_yuv.o
373
374 PLUGIN_YUVMMX = plugins/yuv/yuvmmx.o \
375                 plugins/yuv/video_yuvmmx.o \
376                 plugins/yuv/transforms_yuvmmx.o
377
378 STD_PLUGIN_OBJ = \
379                 $(PLUGIN_ALSA) \
380                 $(PLUGIN_DSP) \
381                 $(PLUGIN_DUMMY) \
382                 $(PLUGIN_DVD) \
383                 $(PLUGIN_ESD) \
384                 $(PLUGIN_FB) \
385                 $(PLUGIN_GGI) \
386                 $(PLUGIN_IDCT) \
387                 $(PLUGIN_IDCTCLASSIC) \
388                 $(PLUGIN_IDCTMMX) \
389                 $(PLUGIN_IDCTMMXEXT) \
390                 $(PLUGIN_MGA) \
391                 $(PLUGIN_MOTION) \
392                 $(PLUGIN_MOTIONMMX) \
393                 $(PLUGIN_MOTIONMMXEXT) \
394                 $(PLUGIN_NCURSES) \
395                 $(PLUGIN_NULL) \
396                 $(PLUGIN_PS) \
397                 $(PLUGIN_SDL) \
398                 $(PLUGIN_TS) \
399                 $(PLUGIN_X11) \
400                 $(PLUGIN_YUV) \
401                 $(PLUGIN_YUVMMX)
402
403 # list duplicates
404 STD_PLUGIN_COMMON =     plugins/idct/idct_common.o \
405                         plugins/motion/vdec_motion_common.o
406
407 # filter out duplicates from the plugin object lists
408 STD_PLUGIN_OBJ :=       $(filter-out $(STD_PLUGIN_COMMON), \
409                                  $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
410
411 NONSTD_PLUGIN_OBJ = \
412                 $(PLUGIN_GLIDE) \
413                 $(PLUGIN_GNOME)
414
415 NONSTD_CPP_PLUGIN_OBJ = \
416                 $(PLUGIN_BEOS)
417
418 #
419 # Other lists of files
420 #
421 objects := $(C_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(NONSTD_PLUGIN_OBJ)
422 cdependancies := $(objects:%.o=.dep/%.d)
423 cppobjects := $(CPP_OBJ) $(NONSTD_CPP_PLUGIN_OBJ)
424 cppdependancies := $(cppobjects:%.o=.dep/%.dpp)
425
426 # All symbols must be exported
427 export
428
429 ################################################################################
430 # Targets
431 ################################################################################
432
433 #
434 # Virtual targets
435 #
436 all: vlc @ALIASES@ plugins
437
438 clean:
439         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
440         rm -f plugins/*/*.o src/*/*.o lib/*.so
441         rm -f vlc @ALIASES@
442
443 distclean: clean
444         rm -f src/*/*.o plugins/*/*.o **/*~ *.log
445         rm -f Makefile include/defs.h include/config.h
446         rm -f config.status config.cache config.log
447         rm -f gmon.out core build-stamp
448         rm -rf .dep
449
450 install:
451         mkdir -p $(DESTDIR)$(bindir)
452         $(INSTALL) vlc $(DESTDIR)$(bindir)
453 # ugly
454         for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
455         mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
456         $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
457         mkdir -p $(DESTDIR)$(datadir)/videolan
458         $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
459         $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
460
461 show:
462         @echo CC: $(CC)
463         @echo CFLAGS: $(CFLAGS)
464         @echo DCFLAGS: $(DCFLAGS)
465         @echo LCFLAGS: $(LCFLAGS)
466         @echo C_OBJ: $(C_OBJ)
467         @echo CPP_OBJ: $(CPP_OBJ)
468         @echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
469         @echo NONSTD_PLUGIN_OBJ: $(NONSTD_PLUGIN_OBJ)
470         @echo NONSTD_CPP_PLUGIN_OBJ: $(NONSTD_CPP_PLUGIN_OBJ)
471         @echo objects: $(objects)
472         @echo cppobjects: $(cppobjects)
473
474 # ugliest of all, but I have no time to do it -- sam
475 snapshot:
476         rm -rf /tmp/vlc-@VLC_VERSION@ /tmp/vlc-@VLC_VERSION@nocss
477         # copy archive in /tmp
478         find -type d | while read i ; \
479                 do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
480         done
481         find debian -mindepth 1 -maxdepth 1 -type d | grep -v CVS | \
482                 while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
483         # CVS entries
484         find . -type f | grep CVS | while read i ; \
485                 do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
486         done
487         # .c .h .in .cpp
488         find include src plugins -type f -name '*.[chi]*' | while read i ; \
489                 do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
490         done
491         # copy misc files
492         cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO \
493                 Makefile.in Makefile.dep configure configure.in install-sh \
494                 config.sub config.guess todo.pl \
495                         /tmp/vlc-@VLC_VERSION@/
496         for file in control vlc-gnome.menu vlc.copyright vlc.docs changelog \
497                 rules vlc.1 vlc.dirs vlc.menu ; do \
498                         cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
499         for file in default8x16.psf default8x9.psf gvlc.png vlc.png ; do \
500                 cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
501
502         # build css-enabled archives
503         (cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
504                 bzip2 -f -9 < vlc-@VLC_VERSION@.tar \
505                         > vlc-@VLC_VERSION@.tar.bz2 ; \
506                 gzip -f -9 vlc-@VLC_VERSION@.tar )
507         mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..
508
509         # removing CSS stuff
510 #       find /tmp/vlc-@VLC_VERSION@ -type f -name '*css*' | xargs rm -f
511 #       for x in Makefile.in src/input/input_dvd.c src/input/input_dvd.h ; do \
512 #       rm -f /tmp/vlc-@VLC_VERSION@/$$x ; \
513 #       perl -ne 'if (/^#e(lse|ndif)/) { $$i=0; } \
514 #                       if (/^#if.*DVD/) { $$i=1; print "#if 0\n"; } \
515 #                       elsif (!$$i || /^#/) { print $$_; }' \
516 #               < $$x | grep -vi css >| /tmp/vlc-@VLC_VERSION@/$$x ; \
517 #       done
518 #       rm -f /tmp/vlc-@VLC_VERSION@/debian/changelog
519 #       sed 's/\(^vlc ([^-]*\)-/\1nocss-/' < debian/changelog \
520 #               > /tmp/vlc-@VLC_VERSION@/debian/changelog
521 #
522 #       # build nocss archives
523 #       (cd /tmp ; mv vlc-@VLC_VERSION@ vlc-@VLC_VERSION@nocss ; \
524 #               tar cf vlc-@VLC_VERSION@nocss.tar vlc-@VLC_VERSION@nocss ; \
525 #               bzip2 -f -9 < vlc-@VLC_VERSION@nocss.tar \
526 #                       > vlc-@VLC_VERSION@nocss.tar.bz2 ; \
527 #               gzip -f -9 vlc-@VLC_VERSION@nocss.tar )
528 #       mv /tmp/vlc-@VLC_VERSION@nocss.tar.gz \
529 #               /tmp/vlc-@VLC_VERSION@nocss.tar.bz2 ..
530 #
531 #       # clean up
532         rm -rf /tmp/vlc-@VLC_VERSION@*
533
534 plugins: $(PLUGINS:%=lib/%.so)
535
536 FORCE:
537
538 #
539 # Gnome and Framebuffer aliases - don't add new aliases which could bloat
540 # the namespace
541 #
542 gvlc fbvlc: vlc
543         rm -f $@ && ln -s vlc $@
544
545
546 #
547 # Generic rules (see below)
548 #
549 $(cdependancies): %.d: FORCE
550         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
551
552 $(cppdependancies): %.dpp: FORCE
553         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
554
555 $(C_OBJ): %.o: Makefile.dep
556 $(C_OBJ): %.o: .dep/%.d
557 $(C_OBJ): %.o: %.c
558         $(CC) $(CFLAGS) -c -o $@ $<
559
560 $(CPP_OBJ): %.o: Makefile.dep
561 $(CPP_OBJ): %.o: .dep/%.dpp
562 $(CPP_OBJ): %.o: %.cpp
563         $(CC) $(CFLAGS) -c -o $@ $<
564
565 $(ASM_OBJ): %.o: Makefile.dep
566 $(ASM_OBJ): %.o: %.S
567         $(CC) $(CFLAGS) -c -o $@ $<
568
569 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
570 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
571 $(STD_PLUGIN_OBJ): %.o: %.c
572         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
573
574 $(PLUGIN_GNOME): %.o: Makefile.dep
575 $(PLUGIN_GNOME): %.o: .dep/%.d
576 $(PLUGIN_GNOME): %.o: %.c
577         $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
578
579 $(PLUGIN_GLIDE): %.o: Makefile.dep
580 $(PLUGIN_GLIDE): %.o: .dep/%.d
581 $(PLUGIN_GLIDE): %.o: %.c
582         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
583
584 $(PLUGIN_BEOS): %.o: Makefile.dep
585 $(PLUGIN_BEOS): %.o: .dep/%.dpp
586 $(PLUGIN_BEOS): %.o: %.cpp
587         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
588
589 #
590 # Main application target
591 #
592
593 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
594 ifeq ($(SYS),beos)
595         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
596         rm -f ./plugins/_APP_
597         ln -s ../vlc ./plugins/_APP_
598 else
599         $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) 
600 endif
601
602 #
603 # Plugin targets
604 #
605
606 lib/beos.so: $(PLUGIN_BEOS)
607         $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot
608
609 lib/esd.so: $(PLUGIN_ESD)
610 ifneq (,$(findstring bsd,$(SYS)))
611         $(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
612 else
613         $(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
614 endif
615
616 lib/dsp.so: $(PLUGIN_DSP)
617         $(CC) $(PCFLAGS) -shared -o $@ $^
618
619 lib/alsa.so: $(PLUGIN_ALSA)
620         $(CC) $(PCFLAGS) -shared -o $@ $^ -lasound
621
622 lib/fb.so: $(PLUGIN_FB)
623         $(CC) $(PCFLAGS) -shared -o $@ $^
624
625 lib/x11.so: $(PLUGIN_X11)
626         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
627
628 lib/mga.so: $(PLUGIN_MGA)
629         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
630
631 lib/gnome.so: $(PLUGIN_GNOME)
632         $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
633
634 lib/glide.so: $(PLUGIN_GLIDE)
635         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
636
637 lib/ggi.so: $(PLUGIN_GGI)
638         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
639
640 lib/sdl.so: $(PLUGIN_SDL)
641         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
642
643 lib/ncurses.so: $(PLUGIN_NCURSES)
644         $(CC) $(PCFLAGS) -shared -o $@ $^ -lcurses
645
646 ifeq ($(SYS),beos)
647 lib/null.so: $(PLUGIN_NULL)
648         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
649
650 lib/ps.so: $(PLUGIN_PS)
651         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
652
653 lib/ts.so: $(PLUGIN_TS)
654         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
655
656 lib/dvd.so: $(PLUGIN_DVD)
657         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
658
659 lib/dummy.so: $(PLUGIN_DUMMY)
660         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
661
662 lib/yuv.so: $(PLUGIN_YUV)
663         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
664
665 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
666         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
667
668 lib/motion.so: $(PLUGIN_MOTION)
669         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
670
671 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
672         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
673
674 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
675         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
676
677 lib/idct.so: $(PLUGIN_IDCT)
678         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
679
680 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
681         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
682
683 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
684         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
685
686 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
687         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
688 else
689 lib/null.so: $(PLUGIN_NULL)
690         $(CC) $(PCFLAGS) -shared -o $@ $^
691
692 lib/ps.so: $(PLUGIN_PS)
693         $(CC) $(PCFLAGS) -shared -o $@ $^
694
695 lib/ts.so: $(PLUGIN_TS)
696         $(CC) $(PCFLAGS) -shared -o $@ $^
697
698 lib/dvd.so: $(PLUGIN_DVD)
699         $(CC) $(PCFLAGS) -shared -o $@ $^
700
701 lib/dummy.so: $(PLUGIN_DUMMY)
702         $(CC) $(PCFLAGS) -shared -o $@ $^
703
704 lib/yuv.so: $(PLUGIN_YUV)
705         $(CC) $(PCFLAGS) -shared -o $@ $^
706
707 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
708         $(CC) $(PCFLAGS) -shared -o $@ $^
709
710 lib/motion.so: $(PLUGIN_MOTION)
711         $(CC) $(PCFLAGS) -shared -o $@ $^
712
713 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
714         $(CC) $(PCFLAGS) -shared -o $@ $^
715
716 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
717         $(CC) $(PCFLAGS) -shared -o $@ $^
718
719 lib/idct.so: $(PLUGIN_IDCT)
720         $(CC) $(PCFLAGS) -shared -o $@ $^
721
722 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
723         $(CC) $(PCFLAGS) -shared -o $@ $^
724
725 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
726         $(CC) $(PCFLAGS) -shared -o $@ $^
727
728 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
729         $(CC) $(PCFLAGS) -shared -o $@ $^
730 endif
731
732 ################################################################################
733 # Note on generic rules and dependancies
734 ################################################################################
735
736 # Note on dependancies: each .c file is associated with a .d file, which
737 # depends of it. The .o file associated with a .c file depends of the .d, of the
738 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
739 # directory.
740 # The dep directory should be ignored by CVS.
741
742 # Note on inclusions: depending of the target, the dependancies files must
743 # or must not be included. The problem is that if we ask make to include a file,
744 # and this file does not exist, it is made before it can be included. In a
745 # general way, a .d file should be included if and only if the corresponding .o
746 # needs to be re-made.
747
748 # Two makefiles are used: the main one (this one) has regular generic rules,
749 # except for .o files, for which it calls the object Makefile. Dependancies
750 # are not included in this file.
751 # The object Makefile known how to make a .o from a .c, and includes
752 # dependancies for the target, but only those required.