]> git.sesse.net Git - vlc/blob - Makefile.in
* configure.in and Makefile.in patches for better SDL support and
[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 prefix=@prefix@
23 bindir=@bindir@
24 datadir=@datadir@
25 libdir=@libdir@
26
27 CC=@CC@
28 SHELL=@SHELL@
29
30 LIB_SDL=@LIB_SDL@
31 LIB_GLIDE=@LIB_GLIDE@
32 LIB_GGI=@LIB_GGI@
33
34 #----------------- do not change anything below this line ----------------------
35
36 ################################################################################
37 # Configuration pre-processing
38 ################################################################################
39
40 # PROGRAM_OPTIONS is an identification string of the compilation options
41 PROGRAM_OPTIONS = $(SYS) $(ARCH)
42 ifeq ($(DEBUG),1)
43 PROGRAM_OPTIONS += DEBUG
44 DEFINE += -DDEBUG
45 endif
46 ifeq ($(STATS),1)
47 PROGRAM_OPTIONS += DEBUG
48 DEFINE += -DSTATS
49 endif
50
51 # PROGRAM_BUILD is a complete identification of the build
52 # (we can't use fancy options with date since OSes like Solaris
53 # or FreeBSD have strange date implementations)
54 PROGRAM_BUILD = `date` $(USER)
55 # XXX: beos does not support hostname (how lame...)
56 #PROGRAM_BUILD = `date` $(USER)@`hostname`
57
58 # DEFINE will contain some of the constants definitions decided in Makefile, 
59 # including SYS_xx. It will be passed to C compiler.
60 DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z. A-Z_)
61
62 # On Linux activate 64-bit off_t (by default under BSD)
63 ifneq (,$(findstring linux,$(SYS)))
64 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
65 endif
66
67 ################################################################################
68 # Tuning and other variables - do not change anything except if you know
69 # exactly what you are doing
70 ################################################################################
71
72 #
73 # C headers directories
74 #
75 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
76
77 #
78 # Libraries
79 #
80 ifeq ($(SYS),gnu)
81 LIB += -lthreads -ldl
82 endif
83
84 ifneq (,$(findstring bsd,$(SYS)))
85 LIB += -pthread -lgnugetopt
86 LIB += -L/usr/local/lib
87 endif
88
89 ifneq (,$(findstring linux,$(SYS)))
90 LIB += -lpthread -ldl
91 endif
92
93 ifneq (,$(findstring solaris,$(SYS)))
94 LIB += -ldl -lsocket -lnsl -lpthread
95 endif
96
97 ifeq ($(SYS),beos)
98 LIB += -lbe -lroot -lgame
99 else
100 LIB += -lm
101 endif
102
103 #
104 # C compiler flags: mainstream compilation
105 #
106 CFLAGS += $(DEFINE) $(INCLUDE)
107 CFLAGS += -Wall -Winline
108 CFLAGS += -D_REENTRANT
109 CFLAGS += -D_GNU_SOURCE
110
111 # flags needed for clean beos compilation
112 ifeq ($(SYS),beos)
113 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
114 endif
115
116 # Optimizations : don't compile debug versions with them
117 ifeq ($(OPTIMS),1)
118 CFLAGS += -O3
119 CFLAGS += -ffast-math -funroll-loops
120 CFLAGS += -fomit-frame-pointer
121
122 # Optimizations for x86 familiy
123 ifneq (,$(findstring 86,$(ARCH)))
124 # Optional Pentium Pro optimizations
125 ifneq (,$(findstring ppro,$(ARCH)))
126 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
127 else
128 CFLAGS += -march=pentium -mcpu=pentium
129 endif
130 endif
131
132 # Optimizations for PowerPC
133 ifneq (,$(findstring powerpc,$(ARCH)))
134 # 604e
135 CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
136 # G3
137 #CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
138 # G4
139 #CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
140 endif
141
142 # Optimizations for Sparc
143 ifneq (,$(findstring sparc,$(ARCH)))
144 CFLAGS += -mhard-float
145 endif
146
147 #end of optimisations
148 endif
149
150 # Optional MMX optimizations for x86
151 ifneq (,$(findstring mmx,$(ARCH)))
152 CFLAGS += -DHAVE_MMX
153 endif
154
155 #
156 # C compiler flags: plugin compilation
157 #
158 PCFLAGS += -fPIC
159
160 #
161 # C compiler flags: dependancies
162 #
163 DCFLAGS += $(INCLUDE)
164 DCFLAGS += -MM
165
166 #
167 # C compiler flags: linking
168 #
169 LCFLAGS += $(LIB)
170 LCFLAGS += -Wall
171 #LCFLAGS += -s
172
173 #
174 # Debugging and profiling support (unless optimisations are active)
175 #
176 ifneq ($(OPTIMS),1)
177 CFLAGS += -g
178 endif
179
180 #################################################################################
181 # Objects and files
182 #################################################################################
183
184 #
185 # C Objects
186
187 INTERFACE =     src/interface/main.o \
188                 src/interface/interface.o \
189                 src/interface/intf_msg.o \
190                 src/interface/intf_cmd.o \
191                 src/interface/intf_ctrl.o \
192                 src/interface/intf_plst.o \
193                 src/interface/intf_channels.o \
194                 src/interface/intf_console.o
195
196 INPUT =         src/input/input_ext-dec.o \
197                 src/input/input_ext-intf.o \
198                 src/input/input_dec.o \
199                 src/input/input_programs.o \
200                 src/input/input_netlist.o \
201                 src/input/input_clock.o \
202                 src/input/input.o \
203                 src/input/mpeg_system.o
204
205 AUDIO_OUTPUT =  src/audio_output/audio_output.o
206
207 VIDEO_OUTPUT =  src/video_output/video_output.o \
208                 src/video_output/video_text.o \
209                 src/video_output/video_spu.o \
210                 src/video_output/video_yuv.o
211
212 AC3_DECODER =   src/ac3_decoder/ac3_decoder_thread.o \
213                 src/ac3_decoder/ac3_decoder.o \
214                 src/ac3_decoder/ac3_parse.o \
215                 src/ac3_decoder/ac3_exponent.o \
216                 src/ac3_decoder/ac3_bit_allocate.o \
217                 src/ac3_decoder/ac3_mantissa.o \
218                 src/ac3_decoder/ac3_rematrix.o \
219                 src/ac3_decoder/ac3_imdct.o \
220                 src/ac3_decoder/ac3_downmix.o
221
222 LPCM_DECODER =  src/lpcm_decoder/lpcm_decoder_thread.o \
223                 src/lpcm_decoder/lpcm_decoder.o
224
225 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
226                 src/audio_decoder/adec_generic.o \
227                 src/audio_decoder/adec_layer1.o \
228                 src/audio_decoder/adec_layer2.o \
229                 src/audio_decoder/adec_math.o
230
231 SPU_DECODER =   src/spu_decoder/spu_decoder.o
232
233 #GEN_DECODER =  src/generic_decoder/generic_decoder.o
234
235 VIDEO_PARSER =  src/video_parser/video_parser.o \
236                 src/video_parser/vpar_headers.o \
237                 src/video_parser/vpar_blocks.o \
238                 src/video_parser/vpar_synchro.o \
239                 src/video_parser/video_fifo.o
240
241 VIDEO_DECODER = src/video_decoder/video_decoder.o
242
243 MISC =          src/misc/mtime.o \
244                 src/misc/tests.o \
245                 src/misc/rsc_files.o \
246                 src/misc/modules.o \
247                 src/misc/netutils.o
248
249
250 C_OBJ =         $(INTERFACE) \
251                 $(INPUT) \
252                 $(VIDEO_OUTPUT) \
253                 $(AUDIO_OUTPUT) \
254                 $(AC3_DECODER) \
255                 $(LPCM_DECODER) \
256                 $(AUDIO_DECODER) \
257                 $(SPU_DECODER) \
258                 $(GEN_DECODER) \
259                 $(VIDEO_PARSER) \
260                 $(VIDEO_DECODER) \
261                 $(MISC)
262
263
264 #
265 # CPP Objects
266
267 ifeq ($(SYS),beos)
268 CPP_OBJ =       src/misc/beos_specific.o
269 endif
270
271 #
272 # Assembler Objects
273
274 ifneq (,$(findstring 86,$(ARCH)))
275 ifneq (,$(findstring mmx,$(ARCH)))
276 ASM_OBJ =               
277 endif
278 endif
279
280 #
281 # Plugins
282 #
283 PLUGIN_ALSA =   plugins/alsa/alsa.o \
284                 plugins/alsa/aout_alsa.o
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_DVD =    plugins/dvd/dvd.o \
300                 plugins/dvd/input_dvd.o \
301                 plugins/dvd/dvd_ifo.o \
302                 plugins/dvd/dvd_udf.o \
303                 plugins/dvd/dvd_css.o
304
305 PLUGIN_ESD =    plugins/esd/esd.o \
306                 plugins/esd/aout_esd.o
307
308 PLUGIN_FB =     plugins/fb/fb.o \
309                 plugins/fb/vout_fb.o
310
311 PLUGIN_GGI =    plugins/ggi/ggi.o \
312                 plugins/ggi/vout_ggi.o
313
314 PLUGIN_GLIDE =  plugins/glide/glide.o \
315                 plugins/glide/intf_glide.o \
316                 plugins/glide/vout_glide.o
317
318 PLUGIN_GNOME =  plugins/gnome/gnome.o \
319                 plugins/gnome/intf_gnome.o \
320                 plugins/gnome/gnome_callbacks.o \
321                 plugins/gnome/gnome_interface.o \
322                 plugins/gnome/gnome_support.o
323
324 PLUGIN_IDCT =   plugins/idct/idct.o \
325                 plugins/idct/idct_common.o
326
327 PLUGIN_IDCTCLASSIC =    plugins/idct/idctclassic.o \
328                         plugins/idct/idct_common.o
329
330 PLUGIN_IDCTMMX =        plugins/idct/idctmmx.o \
331                         plugins/idct/idct_common.o
332
333 PLUGIN_IDCTMMXEXT =     plugins/idct/idctmmxext.o \
334                         plugins/idct/idct_common.o
335
336 PLUGIN_MGA =    plugins/mga/mga.o \
337                 plugins/mga/intf_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.