]> git.sesse.net Git - vlc/blob - Makefile.in
7bae51a485cecc16f458fb2b46996cd8a8ad0aa8
[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                 src/interface/intf_urldecode.o \
197
198 INPUT =         src/input/input_ext-dec.o \
199                 src/input/input_ext-intf.o \
200                 src/input/input_dec.o \
201                 src/input/input_programs.o \
202                 src/input/input_netlist.o \
203                 src/input/input_clock.o \
204                 src/input/input.o \
205                 src/input/mpeg_system.o
206
207 AUDIO_OUTPUT =  src/audio_output/audio_output.o
208
209 VIDEO_OUTPUT =  src/video_output/video_output.o \
210                 src/video_output/video_text.o \
211                 src/video_output/video_spu.o \
212                 src/video_output/video_yuv.o
213
214 AC3_DECODER =   src/ac3_decoder/ac3_decoder_thread.o \
215                 src/ac3_decoder/ac3_decoder.o \
216                 src/ac3_decoder/ac3_parse.o \
217                 src/ac3_decoder/ac3_exponent.o \
218                 src/ac3_decoder/ac3_bit_allocate.o \
219                 src/ac3_decoder/ac3_mantissa.o \
220                 src/ac3_decoder/ac3_rematrix.o \
221                 src/ac3_decoder/ac3_imdct.o \
222                 src/ac3_decoder/ac3_downmix.o \
223                 src/ac3_decoder/ac3_downmix_c.o
224
225 LPCM_DECODER =  src/lpcm_decoder/lpcm_decoder_thread.o \
226                 src/lpcm_decoder/lpcm_decoder.o
227
228 AUDIO_DECODER = src/audio_decoder/audio_decoder.o \
229                 src/audio_decoder/adec_generic.o \
230                 src/audio_decoder/adec_layer1.o \
231                 src/audio_decoder/adec_layer2.o \
232                 src/audio_decoder/adec_math.o
233
234 SPU_DECODER =   src/spu_decoder/spu_decoder.o
235
236 #GEN_DECODER =  src/generic_decoder/generic_decoder.o
237
238 VIDEO_PARSER =  src/video_parser/video_parser.o \
239                 src/video_parser/vpar_headers.o \
240                 src/video_parser/vpar_blocks.o \
241                 src/video_parser/vpar_synchro.o \
242                 src/video_parser/video_fifo.o
243
244 VIDEO_DECODER = src/video_decoder/video_decoder.o
245
246 MISC =          src/misc/mtime.o \
247                 src/misc/tests.o \
248                 src/misc/rsc_files.o \
249                 src/misc/modules.o \
250                 src/misc/netutils.o
251
252
253 C_OBJ =         $(INTERFACE) \
254                 $(INPUT) \
255                 $(VIDEO_OUTPUT) \
256                 $(AUDIO_OUTPUT) \
257                 $(AC3_DECODER) \
258                 $(LPCM_DECODER) \
259                 $(AUDIO_DECODER) \
260                 $(SPU_DECODER) \
261                 $(GEN_DECODER) \
262                 $(VIDEO_PARSER) \
263                 $(VIDEO_DECODER) \
264                 $(MISC)
265
266
267 #
268 # CPP Objects
269
270 ifeq ($(SYS),beos)
271 CPP_OBJ =       src/misc/beos_specific.o
272 endif
273
274 #
275 # Assembler Objects
276
277 ifneq (,$(findstring 86,$(ARCH)))
278 ifneq (,$(findstring mmx,$(ARCH)))
279 ASM_OBJ =               
280 endif
281 endif
282
283 #
284 # Plugins
285 #
286 PLUGIN_ALSA =   plugins/alsa/alsa.o \
287                 plugins/alsa/aout_alsa.o
288
289 PLUGIN_BEOS =   plugins/beos/beos.o \
290                 plugins/beos/aout_beos.o \
291                 plugins/beos/intf_beos.o \
292                 plugins/beos/vout_beos.o \
293                 plugins/beos/DrawingTidbits.o \
294                 plugins/beos/TransportButton.o
295
296 PLUGIN_DSP =    plugins/dsp/dsp.o \
297                 plugins/dsp/aout_dsp.o
298
299 PLUGIN_DUMMY =  plugins/dummy/dummy.o \
300                 plugins/dummy/aout_dummy.o \
301                 plugins/dummy/intf_dummy.o \
302                 plugins/dummy/vout_dummy.o
303
304 PLUGIN_DVD =    plugins/dvd/dvd.o \
305                 plugins/dvd/input_dvd.o \
306                 plugins/dvd/dvd_netlist.o \
307                 plugins/dvd/dvd_ioctl.o \
308                 plugins/dvd/dvd_ifo.o \
309                 plugins/dvd/dvd_udf.o \
310                 plugins/dvd/dvd_css.o
311
312 PLUGIN_ESD =    plugins/esd/esd.o \
313                 plugins/esd/aout_esd.o
314
315 PLUGIN_FB =     plugins/fb/fb.o \
316                 plugins/fb/vout_fb.o
317
318 PLUGIN_GGI =    plugins/ggi/ggi.o \
319                 plugins/ggi/vout_ggi.o
320
321 PLUGIN_GLIDE =  plugins/glide/glide.o \
322                 plugins/glide/vout_glide.o
323
324 PLUGIN_GTK =    plugins/gtk/gtk.o \
325                 plugins/gtk/intf_gtk.o \
326                 plugins/gtk/gtk_callbacks.o \
327                 plugins/gtk/gtk_interface.o \
328                 plugins/gtk/gtk_support.o \
329                 plugins/gtk/gtk_playlist.o
330
331 PLUGIN_GNOME =  plugins/gnome/gnome.o \
332                 plugins/gnome/intf_gnome.o \
333                 plugins/gnome/gnome_callbacks.o \
334                 plugins/gnome/gnome_interface.o \
335                 plugins/gnome/gnome_support.o
336
337 PLUGIN_KDE =    plugins/kde/kde.o \
338                 plugins/kde/intf_kde.o \
339                 plugins/kde/kvlc.o
340
341 PLUGIN_IDCT =   plugins/idct/idct.o \
342                 plugins/idct/idct_common.o
343
344 PLUGIN_IDCTCLASSIC =    plugins/idct/idctclassic.o \
345                         plugins/idct/idct_common.o
346
347 PLUGIN_IDCTMMX =        plugins/idct/idctmmx.o \
348                         plugins/idct/idct_common.o
349
350 PLUGIN_IDCTMMXEXT =     plugins/idct/idctmmxext.o \
351                         plugins/idct/idct_common.o
352
353 PLUGIN_MGA =    plugins/mga/mga.o \
354                 plugins/mga/vout_mga.o
355
356 PLUGIN_MOTION = plugins/motion/motion.o \
357                 plugins/motion/vdec_motion_common.o \
358                 plugins/motion/vdec_motion_inner.o
359
360 PLUGIN_MOTIONMMX =      plugins/motion/motionmmx.o \
361                         plugins/motion/vdec_motion_common.o \
362                         plugins/motion/vdec_motion_inner_mmx.o
363
364 PLUGIN_MOTIONMMXEXT =   plugins/motion/motionmmxext.o \
365                         plugins/motion/vdec_motion_common.o \
366                         plugins/motion/vdec_motion_inner_mmxext.o
367
368 PLUGIN_NCURSES =        plugins/text/ncurses.o \
369                         plugins/text/intf_ncurses.o
370
371 PLUGIN_NULL =   plugins/null/null.o
372
373 PLUGIN_PS =     plugins/mpeg/ps.o \
374                 plugins/mpeg/input_ps.o
375
376 PLUGIN_SDL =    plugins/sdl/sdl.o \
377                 plugins/sdl/vout_sdl.o \
378                 plugins/sdl/aout_sdl.o 
379
380 PLUGIN_TS =     plugins/mpeg/ts.o \
381                 plugins/mpeg/input_ts.o
382
383 PLUGIN_X11=     plugins/x11/x11.o \
384                 plugins/x11/vout_x11.o
385
386 PLUGIN_YUV =    plugins/yuv/yuv.o \
387                 plugins/yuv/video_yuv.o \
388                 plugins/yuv/transforms_yuv.o
389
390 PLUGIN_YUVMMX = plugins/yuv/yuvmmx.o \
391                 plugins/yuv/video_yuvmmx.o \
392                 plugins/yuv/transforms_yuvmmx.o
393
394 STD_PLUGIN_OBJ = \
395                 $(PLUGIN_ALSA) \
396                 $(PLUGIN_DSP) \
397                 $(PLUGIN_DUMMY) \
398                 $(PLUGIN_DVD) \
399                 $(PLUGIN_ESD) \
400                 $(PLUGIN_FB) \
401                 $(PLUGIN_GGI) \
402                 $(PLUGIN_IDCT) \
403                 $(PLUGIN_IDCTCLASSIC) \
404                 $(PLUGIN_IDCTMMX) \
405                 $(PLUGIN_IDCTMMXEXT) \
406                 $(PLUGIN_MGA) \
407                 $(PLUGIN_MOTION) \
408                 $(PLUGIN_MOTIONMMX) \
409                 $(PLUGIN_MOTIONMMXEXT) \
410                 $(PLUGIN_NCURSES) \
411                 $(PLUGIN_NULL) \
412                 $(PLUGIN_PS) \
413                 $(PLUGIN_SDL) \
414                 $(PLUGIN_TS) \
415                 $(PLUGIN_X11) \
416                 $(PLUGIN_YUV) \
417                 $(PLUGIN_YUVMMX)
418
419 # list duplicates
420 STD_PLUGIN_COMMON =     plugins/idct/idct_common.o \
421                         plugins/motion/vdec_motion_common.o
422
423 # filter out duplicates from the plugin object lists
424 STD_PLUGIN_OBJ :=       $(filter-out $(STD_PLUGIN_COMMON), \
425                                  $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
426
427 NONSTD_PLUGIN_OBJ = \
428                 $(PLUGIN_GLIDE) \
429                 $(PLUGIN_GTK) \
430                 $(PLUGIN_GNOME)
431
432 NONSTD_CPP_PLUGIN_OBJ = \
433                 $(PLUGIN_BEOS) \
434                 $(PLUGIN_KDE)
435
436 #
437 # Other lists of files
438 #
439 objects := $(C_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(NONSTD_PLUGIN_OBJ)
440 cdependancies := $(objects:%.o=.dep/%.d)
441 cppobjects := $(CPP_OBJ) $(NONSTD_CPP_PLUGIN_OBJ)
442 cppdependancies := $(cppobjects:%.o=.dep/%.dpp)
443
444 # All symbols must be exported
445 export
446
447 ################################################################################
448 # Targets
449 ################################################################################
450
451 #
452 # Virtual targets
453 #
454 all: vlc @ALIASES@ plugins
455
456 clean:
457         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
458         rm -f plugins/*/*.o src/*/*.o lib/*.so
459         rm -f vlc kvlc gvlc
460
461 distclean: clean
462         rm -f src/*/*.o plugins/*/*.o **/*~ *.log
463         rm -f Makefile include/defs.h include/config.h
464         rm -f config.status config.cache config.log
465         rm -f gmon.out core build-stamp
466         rm -rf .dep
467
468 install:
469         mkdir -p $(DESTDIR)$(bindir)
470         $(INSTALL) vlc $(DESTDIR)$(bindir)
471 # ugly
472         for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
473         mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
474         $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
475         mkdir -p $(DESTDIR)$(datadir)/videolan
476         $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
477         $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
478         $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
479
480 show:
481         @echo CC: $(CC)
482         @echo CFLAGS: $(CFLAGS)
483         @echo DCFLAGS: $(DCFLAGS)
484         @echo LCFLAGS: $(LCFLAGS)
485         @echo C_OBJ: $(C_OBJ)
486         @echo CPP_OBJ: $(CPP_OBJ)
487         @echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
488         @echo NONSTD_PLUGIN_OBJ: $(NONSTD_PLUGIN_OBJ)
489         @echo NONSTD_CPP_PLUGIN_OBJ: $(NONSTD_CPP_PLUGIN_OBJ)
490         @echo objects: $(objects)
491         @echo cppobjects: $(cppobjects)
492
493 # ugliest of all, but I have no time to do it -- sam
494 snapshot:
495         rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
496         # copy archive in /tmp
497         find -type d | grep -v CVS | grep -v '^\.dep' | while read i ; \
498                 do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
499         done
500         find debian -mindepth 1 -maxdepth 1 -type d | \
501                 while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
502         # .c .h .in .cpp
503         find include src plugins -type f -name '*.[chi]*' | while read i ; \
504                 do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
505         done
506         # copy misc files
507         cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO \
508                 Makefile.in Makefile.dep configure configure.in install-sh \
509                 config.sub config.guess todo.pl \
510                         /tmp/vlc-@VLC_VERSION@/
511         for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
512                 changelog changelog-css rules rules-css vlc.1 vlc.dirs \
513                 vlc.menu ; do \
514                         cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
515         for file in default8x16.psf default8x9.psf gvlc.png vlc.png \
516                 gvlc.xpm vlc.xpm ; do \
517                         cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
518
519         # build css-enabled archives
520         (cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
521                 bzip2 -f -9 < vlc-@VLC_VERSION@.tar \
522                         > vlc-@VLC_VERSION@.tar.bz2 ; \
523                 gzip -f -9 vlc-@VLC_VERSION@.tar )
524         mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..
525
526         # clean up
527         rm -rf /tmp/vlc-@VLC_VERSION@*
528
529 plugins: $(PLUGINS:%=lib/%.so)
530
531 FORCE:
532
533 #
534 # GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat
535 # the namespace
536 #
537 gvlc kvlc: vlc
538         rm -f $@ && ln -s vlc $@
539
540
541 #
542 # Generic rules (see below)
543 #
544 $(cdependancies): %.d: FORCE
545         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
546
547 $(cppdependancies): %.dpp: FORCE
548         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
549
550 $(C_OBJ): %.o: Makefile.dep
551 $(C_OBJ): %.o: .dep/%.d
552 $(C_OBJ): %.o: %.c
553         $(CC) $(CFLAGS) -c -o $@ $<
554
555 $(CPP_OBJ): %.o: Makefile.dep
556 $(CPP_OBJ): %.o: .dep/%.dpp
557 $(CPP_OBJ): %.o: %.cpp
558         $(CC) $(CFLAGS) -c -o $@ $<
559
560 $(ASM_OBJ): %.o: Makefile.dep
561 $(ASM_OBJ): %.o: %.S
562         $(CC) $(CFLAGS) -c -o $@ $<
563
564 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
565 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
566 $(STD_PLUGIN_OBJ): %.o: %.c
567         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
568
569 $(PLUGIN_GTK): %.o: Makefile.dep
570 $(PLUGIN_GTK): %.o: .dep/%.d
571 $(PLUGIN_GTK): %.o: %.c
572         $(CC) $(CFLAGS) $(PCFLAGS) `glib-config --cflags glib` `gtk-config --cflags gtk` -c -o $@ $<
573
574 $(PLUGIN_GNOME): %.o: Makefile.dep
575 $(PLUGIN_GNOME): %.o: .dep/%.d
576 $(PLUGIN_GNOME): %.o: %.c
577         $(CC) $(CFLAGS) $(PCFLAGS) `glib-config --cflags glib` `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_KDE): %.o: Makefile.dep
585 $(PLUGIN_KDE): %.o: .dep/%.dpp
586 $(PLUGIN_KDE): %.o: %.cpp
587         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/kde -I/usr/include/qt -fno-rtti -c -o $@ $<
588
589 $(PLUGIN_BEOS): %.o: Makefile.dep
590 $(PLUGIN_BEOS): %.o: .dep/%.dpp
591 $(PLUGIN_BEOS): %.o: %.cpp
592         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
593
594 #
595 # Main application target
596 #
597
598 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
599 ifeq ($(SYS),beos)
600         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
601         rm -f ./plugins/_APP_
602         ln -s ../vlc ./plugins/_APP_
603 else
604         $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) 
605 endif
606
607 #
608 # Plugin targets
609 #
610
611 lib/beos.so: $(PLUGIN_BEOS)
612         $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot -ltracker
613
614 lib/esd.so: $(PLUGIN_ESD)
615 ifneq (,$(findstring bsd,$(SYS)))
616         $(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
617 else
618         $(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
619 endif
620
621 lib/dsp.so: $(PLUGIN_DSP)
622         $(CC) $(PCFLAGS) -shared -o $@ $^
623
624 lib/kde.so: $(PLUGIN_KDE)
625         $(CC) $(PCFLAGS) -shared -o $@ $^ -lkdeui -lkdecore -lqt -ldl
626
627 lib/alsa.so: $(PLUGIN_ALSA)
628         $(CC) $(PCFLAGS) -shared -o $@ $^ -lasound
629
630 lib/fb.so: $(PLUGIN_FB)
631         $(CC) $(PCFLAGS) -shared -o $@ $^
632
633 lib/x11.so: $(PLUGIN_X11)
634         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
635
636 lib/mga.so: $(PLUGIN_MGA)
637         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
638
639 lib/gtk.so: $(PLUGIN_GTK)
640         $(CC) $(PCFLAGS) -shared -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`
641
642 lib/gnome.so: $(PLUGIN_GNOME)
643         $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
644
645 lib/glide.so: $(PLUGIN_GLIDE)
646         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
647
648 lib/ggi.so: $(PLUGIN_GGI)
649         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
650
651 lib/sdl.so: $(PLUGIN_SDL)
652         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
653
654 lib/ncurses.so: $(PLUGIN_NCURSES)
655         $(CC) $(PCFLAGS) -shared -o $@ $^ -lncurses
656
657 ifeq ($(SYS),beos)
658 lib/null.so: $(PLUGIN_NULL)
659         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
660
661 lib/ps.so: $(PLUGIN_PS)
662         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
663
664 lib/ts.so: $(PLUGIN_TS)
665         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
666
667 lib/dvd.so: $(PLUGIN_DVD)
668         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
669
670 lib/dummy.so: $(PLUGIN_DUMMY)
671         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
672
673 lib/yuv.so: $(PLUGIN_YUV)
674         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
675
676 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
677         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
678
679 lib/motion.so: $(PLUGIN_MOTION)
680         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
681
682 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
683         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
684
685 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
686         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
687
688 lib/idct.so: $(PLUGIN_IDCT)
689         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
690
691 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
692         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
693
694 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
695         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
696
697 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
698         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
699 else
700 lib/null.so: $(PLUGIN_NULL)
701         $(CC) $(PCFLAGS) -shared -o $@ $^
702
703 lib/ps.so: $(PLUGIN_PS)
704         $(CC) $(PCFLAGS) -shared -o $@ $^
705
706 lib/ts.so: $(PLUGIN_TS)
707         $(CC) $(PCFLAGS) -shared -o $@ $^
708
709 lib/dvd.so: $(PLUGIN_DVD)
710         $(CC) $(PCFLAGS) -shared -o $@ $^
711
712 lib/dummy.so: $(PLUGIN_DUMMY)
713         $(CC) $(PCFLAGS) -shared -o $@ $^
714
715 lib/yuv.so: $(PLUGIN_YUV)
716         $(CC) $(PCFLAGS) -shared -o $@ $^
717
718 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
719         $(CC) $(PCFLAGS) -shared -o $@ $^
720
721 lib/motion.so: $(PLUGIN_MOTION)
722         $(CC) $(PCFLAGS) -shared -o $@ $^
723
724 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
725         $(CC) $(PCFLAGS) -shared -o $@ $^
726
727 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
728         $(CC) $(PCFLAGS) -shared -o $@ $^
729
730 lib/idct.so: $(PLUGIN_IDCT)
731         $(CC) $(PCFLAGS) -shared -o $@ $^
732
733 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
734         $(CC) $(PCFLAGS) -shared -o $@ $^
735
736 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
737         $(CC) $(PCFLAGS) -shared -o $@ $^
738
739 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
740         $(CC) $(PCFLAGS) -shared -o $@ $^
741 endif
742
743 ################################################################################
744 # Note on generic rules and dependancies
745 ################################################################################
746
747 # Note on dependancies: each .c file is associated with a .d file, which
748 # depends of it. The .o file associated with a .c file depends of the .d, of the
749 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
750 # directory.
751 # The dep directory should be ignored by CVS.
752
753 # Note on inclusions: depending of the target, the dependancies files must
754 # or must not be included. The problem is that if we ask make to include a file,
755 # and this file does not exist, it is made before it can be included. In a
756 # general way, a .d file should be included if and only if the corresponding .o
757 # needs to be re-made.
758
759 # Two makefiles are used: the main one (this one) has regular generic rules,
760 # except for .o files, for which it calls the object Makefile. Dependancies
761 # are not included in this file.
762 # The object Makefile known how to make a .o from a .c, and includes
763 # dependancies for the target, but only those required.