]> git.sesse.net Git - vlc/blob - Makefile.in
* Bug fixes and enhancements in the Gtk+/Gnome interfaces.
[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_playlist.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_QT =     plugins/qt/qt.o \
338                 plugins/qt/intf_qt.o
339
340 PLUGIN_KDE =    plugins/kde/kde.o \
341                 plugins/kde/intf_kde.o
342
343 PLUGIN_IDCT =   plugins/idct/idct.o \
344                 plugins/idct/idct_common.o
345
346 PLUGIN_IDCTCLASSIC =    plugins/idct/idctclassic.o \
347                         plugins/idct/idct_common.o
348
349 PLUGIN_IDCTMMX =        plugins/idct/idctmmx.o \
350                         plugins/idct/idct_common.o
351
352 PLUGIN_IDCTMMXEXT =     plugins/idct/idctmmxext.o \
353                         plugins/idct/idct_common.o
354
355 PLUGIN_MGA =    plugins/mga/mga.o \
356                 plugins/mga/vout_mga.o
357
358 PLUGIN_MOTION = plugins/motion/motion.o \
359                 plugins/motion/vdec_motion_common.o \
360                 plugins/motion/vdec_motion_inner.o
361
362 PLUGIN_MOTIONMMX =      plugins/motion/motionmmx.o \
363                         plugins/motion/vdec_motion_common.o \
364                         plugins/motion/vdec_motion_inner_mmx.o
365
366 PLUGIN_MOTIONMMXEXT =   plugins/motion/motionmmxext.o \
367                         plugins/motion/vdec_motion_common.o \
368                         plugins/motion/vdec_motion_inner_mmxext.o
369
370 PLUGIN_NCURSES =        plugins/text/ncurses.o \
371                         plugins/text/intf_ncurses.o
372
373 PLUGIN_NULL =   plugins/null/null.o
374
375 PLUGIN_PS =     plugins/mpeg/ps.o \
376                 plugins/mpeg/input_ps.o
377
378 PLUGIN_SDL =    plugins/sdl/sdl.o \
379                 plugins/sdl/vout_sdl.o \
380                 plugins/sdl/aout_sdl.o 
381
382 PLUGIN_TS =     plugins/mpeg/ts.o \
383                 plugins/mpeg/input_ts.o
384
385 PLUGIN_X11=     plugins/x11/x11.o \
386                 plugins/x11/vout_x11.o
387
388 PLUGIN_YUV =    plugins/yuv/yuv.o \
389                 plugins/yuv/video_yuv.o \
390                 plugins/yuv/transforms_yuv.o
391
392 PLUGIN_YUVMMX = plugins/yuv/yuvmmx.o \
393                 plugins/yuv/video_yuvmmx.o \
394                 plugins/yuv/transforms_yuvmmx.o
395
396 STD_PLUGIN_OBJ = \
397                 $(PLUGIN_ALSA) \
398                 $(PLUGIN_DSP) \
399                 $(PLUGIN_DUMMY) \
400                 $(PLUGIN_DVD) \
401                 $(PLUGIN_ESD) \
402                 $(PLUGIN_FB) \
403                 $(PLUGIN_GGI) \
404                 $(PLUGIN_IDCT) \
405                 $(PLUGIN_IDCTCLASSIC) \
406                 $(PLUGIN_IDCTMMX) \
407                 $(PLUGIN_IDCTMMXEXT) \
408                 $(PLUGIN_MGA) \
409                 $(PLUGIN_MOTION) \
410                 $(PLUGIN_MOTIONMMX) \
411                 $(PLUGIN_MOTIONMMXEXT) \
412                 $(PLUGIN_NCURSES) \
413                 $(PLUGIN_NULL) \
414                 $(PLUGIN_PS) \
415                 $(PLUGIN_SDL) \
416                 $(PLUGIN_TS) \
417                 $(PLUGIN_X11) \
418                 $(PLUGIN_YUV) \
419                 $(PLUGIN_YUVMMX)
420
421 # list duplicates
422 STD_PLUGIN_COMMON =     plugins/idct/idct_common.o \
423                         plugins/motion/vdec_motion_common.o
424
425 # filter out duplicates from the plugin object lists
426 STD_PLUGIN_OBJ :=       $(filter-out $(STD_PLUGIN_COMMON), \
427                                  $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
428
429 NONSTD_PLUGIN_OBJ = \
430                 $(PLUGIN_GLIDE) \
431                 $(PLUGIN_GTK) \
432                 $(PLUGIN_GNOME)
433
434 NONSTD_CPP_PLUGIN_OBJ = \
435                 $(PLUGIN_BEOS) \
436                 $(PLUGIN_QT) \
437                 $(PLUGIN_KDE)
438
439 #
440 # Other lists of files
441 #
442 objects := $(C_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(NONSTD_PLUGIN_OBJ)
443 cdependancies := $(objects:%.o=.dep/%.d)
444 cppobjects := $(CPP_OBJ) $(NONSTD_CPP_PLUGIN_OBJ)
445 cppdependancies := $(cppobjects:%.o=.dep/%.dpp)
446
447 # All symbols must be exported
448 export
449
450 ################################################################################
451 # Targets
452 ################################################################################
453
454 #
455 # Virtual targets
456 #
457 all: vlc @ALIASES@ plugins
458
459 clean:
460         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
461         rm -f plugins/*/*.o src/*/*.o lib/*.so
462         rm -f vlc gvlc kvlc qvlc
463
464 distclean: clean
465         rm -f src/*/*.o plugins/*/*.o **/*~ *.log
466         rm -f Makefile include/defs.h include/config.h
467         rm -f config.status config.cache config.log
468         rm -f gmon.out core build-stamp
469         rm -rf .dep
470
471 install:
472         mkdir -p $(DESTDIR)$(bindir)
473         $(INSTALL) vlc $(DESTDIR)$(bindir)
474 # ugly
475         for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
476         mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
477         $(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
478         mkdir -p $(DESTDIR)$(datadir)/videolan
479         $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
480         $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
481         $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
482
483 show:
484         @echo CC: $(CC)
485         @echo CFLAGS: $(CFLAGS)
486         @echo DCFLAGS: $(DCFLAGS)
487         @echo LCFLAGS: $(LCFLAGS)
488         @echo C_OBJ: $(C_OBJ)
489         @echo CPP_OBJ: $(CPP_OBJ)
490         @echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
491         @echo NONSTD_PLUGIN_OBJ: $(NONSTD_PLUGIN_OBJ)
492         @echo NONSTD_CPP_PLUGIN_OBJ: $(NONSTD_CPP_PLUGIN_OBJ)
493         @echo objects: $(objects)
494         @echo cppobjects: $(cppobjects)
495
496 # ugliest of all, but I have no time to do it -- sam
497 snapshot:
498         rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
499         # copy archive in /tmp
500         find -type d | grep -v CVS | grep -v '\.dep' | while read i ; \
501                 do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
502         done
503         find debian -mindepth 1 -maxdepth 1 -type d | \
504                 while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
505         # .c .h .in .cpp
506         find include src plugins -type f -name '*.[chi]*' | while read i ; \
507                 do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
508         done
509         # copy misc files
510         cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO \
511                 Makefile.in Makefile.dep configure configure.in install-sh \
512                 config.sub config.guess todo.pl \
513                         /tmp/vlc-@VLC_VERSION@/
514         for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
515                 changelog changelog-css rules rules-css vlc.1 vlc.dirs \
516                 vlc.menu ; do \
517                         cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
518         for file in default8x16.psf default8x9.psf gvlc.png vlc.png \
519                 gvlc.xpm vlc.xpm ; do \
520                         cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done
521
522         # build css-enabled archives
523         (cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
524                 bzip2 -f -9 < vlc-@VLC_VERSION@.tar \
525                         > vlc-@VLC_VERSION@.tar.bz2 ; \
526                 gzip -f -9 vlc-@VLC_VERSION@.tar )
527         mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..
528
529         # clean up
530         rm -rf /tmp/vlc-@VLC_VERSION@*
531
532 plugins: $(PLUGINS:%=lib/%.so)
533
534 FORCE:
535
536 #
537 # GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat
538 # the namespace
539 #
540 gvlc kvlc qvlc: vlc
541         rm -f $@ && ln -s vlc $@
542
543
544 #
545 # Generic rules (see below)
546 #
547 $(cdependancies): %.d: FORCE
548         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
549
550 $(cppdependancies): %.dpp: FORCE
551         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
552
553 $(C_OBJ): %.o: Makefile.dep
554 $(C_OBJ): %.o: .dep/%.d
555 $(C_OBJ): %.o: %.c
556         $(CC) $(CFLAGS) -c -o $@ $<
557
558 $(CPP_OBJ): %.o: Makefile.dep
559 $(CPP_OBJ): %.o: .dep/%.dpp
560 $(CPP_OBJ): %.o: %.cpp
561         $(CC) $(CFLAGS) -c -o $@ $<
562
563 $(ASM_OBJ): %.o: Makefile.dep
564 $(ASM_OBJ): %.o: %.S
565         $(CC) $(CFLAGS) -c -o $@ $<
566
567 $(STD_PLUGIN_OBJ): %.o: Makefile.dep
568 $(STD_PLUGIN_OBJ): %.o: .dep/%.d
569 $(STD_PLUGIN_OBJ): %.o: %.c
570         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
571
572 $(PLUGIN_GTK): %.o: Makefile.dep
573 $(PLUGIN_GTK): %.o: .dep/%.d
574 $(PLUGIN_GTK): %.o: %.c
575         $(CC) $(CFLAGS) $(PCFLAGS) `gtk-config --cflags gtk` -c -o $@ $<
576
577 $(PLUGIN_GNOME): %.o: Makefile.dep
578 $(PLUGIN_GNOME): %.o: .dep/%.d
579 $(PLUGIN_GNOME): %.o: %.c
580         $(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gtk gnomeui` -c -o $@ $<
581
582 $(PLUGIN_GLIDE): %.o: Makefile.dep
583 $(PLUGIN_GLIDE): %.o: .dep/%.d
584 $(PLUGIN_GLIDE): %.o: %.c
585         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
586
587 $(PLUGIN_QT): %.o: Makefile.dep
588 $(PLUGIN_QT): %.o: .dep/%.dpp
589 $(PLUGIN_QT): %.o: %.moc
590         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/qt -c -o $@ $(<:%.moc=%.cpp)
591 $(PLUGIN_QT:%.o=%.moc): %.moc: %.cpp
592         moc -i $< -o $@
593
594 $(PLUGIN_KDE): %.o: Makefile.dep
595 $(PLUGIN_KDE): %.o: .dep/%.dpp
596 $(PLUGIN_KDE): %.o: %.cpp
597         $(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/kde -I/usr/include/qt -fno-rtti -c -o $@ $<
598
599 $(PLUGIN_BEOS): %.o: Makefile.dep
600 $(PLUGIN_BEOS): %.o: .dep/%.dpp
601 $(PLUGIN_BEOS): %.o: %.cpp
602         $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
603
604 #
605 # Main application target
606 #
607
608 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
609 ifeq ($(SYS),beos)
610         $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
611         rm -f ./plugins/_APP_
612         ln -s ../vlc ./plugins/_APP_
613 else
614         $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) 
615 endif
616
617 #
618 # Plugin targets
619 #
620
621 lib/beos.so: $(PLUGIN_BEOS)
622         $(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot -ltracker
623
624 lib/esd.so: $(PLUGIN_ESD)
625 ifneq (,$(findstring bsd,$(SYS)))
626         $(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
627 else
628         $(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
629 endif
630
631 lib/dsp.so: $(PLUGIN_DSP)
632         $(CC) $(PCFLAGS) -shared -o $@ $^
633
634 lib/qt.so: $(PLUGIN_QT)
635         $(CC) $(PCFLAGS) -shared -o $@ $^ -lqt
636
637 lib/kde.so: $(PLUGIN_KDE)
638         $(CC) $(PCFLAGS) -shared -o $@ $^ -lkdeui -lkdecore -lqt -ldl
639
640 lib/alsa.so: $(PLUGIN_ALSA)
641         $(CC) $(PCFLAGS) -shared -o $@ $^ -lasound
642
643 lib/fb.so: $(PLUGIN_FB)
644         $(CC) $(PCFLAGS) -shared -o $@ $^
645
646 lib/x11.so: $(PLUGIN_X11)
647         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
648
649 lib/mga.so: $(PLUGIN_MGA)
650         $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
651
652 lib/gtk.so: $(PLUGIN_GTK)
653         $(CC) $(PCFLAGS) -shared -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`
654
655 lib/gnome.so: $(PLUGIN_GNOME)
656         $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
657
658 lib/glide.so: $(PLUGIN_GLIDE)
659         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
660
661 lib/ggi.so: $(PLUGIN_GGI)
662         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
663
664 lib/sdl.so: $(PLUGIN_SDL)
665         $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
666
667 lib/ncurses.so: $(PLUGIN_NCURSES)
668         $(CC) $(PCFLAGS) -shared -o $@ $^ -lncurses
669
670 ifeq ($(SYS),beos)
671 lib/null.so: $(PLUGIN_NULL)
672         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
673
674 lib/ps.so: $(PLUGIN_PS)
675         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
676
677 lib/ts.so: $(PLUGIN_TS)
678         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
679
680 lib/dvd.so: $(PLUGIN_DVD)
681         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
682
683 lib/dummy.so: $(PLUGIN_DUMMY)
684         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
685
686 lib/yuv.so: $(PLUGIN_YUV)
687         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
688
689 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
690         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
691
692 lib/motion.so: $(PLUGIN_MOTION)
693         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
694
695 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
696         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
697
698 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
699         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
700
701 lib/idct.so: $(PLUGIN_IDCT)
702         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
703
704 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
705         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
706
707 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
708         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
709
710 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
711         $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
712 else
713 lib/null.so: $(PLUGIN_NULL)
714         $(CC) $(PCFLAGS) -shared -o $@ $^
715
716 lib/ps.so: $(PLUGIN_PS)
717         $(CC) $(PCFLAGS) -shared -o $@ $^
718
719 lib/ts.so: $(PLUGIN_TS)
720         $(CC) $(PCFLAGS) -shared -o $@ $^
721
722 lib/dvd.so: $(PLUGIN_DVD)
723         $(CC) $(PCFLAGS) -shared -o $@ $^
724
725 lib/dummy.so: $(PLUGIN_DUMMY)
726         $(CC) $(PCFLAGS) -shared -o $@ $^
727
728 lib/yuv.so: $(PLUGIN_YUV)
729         $(CC) $(PCFLAGS) -shared -o $@ $^
730
731 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
732         $(CC) $(PCFLAGS) -shared -o $@ $^
733
734 lib/motion.so: $(PLUGIN_MOTION)
735         $(CC) $(PCFLAGS) -shared -o $@ $^
736
737 lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
738         $(CC) $(PCFLAGS) -shared -o $@ $^
739
740 lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
741         $(CC) $(PCFLAGS) -shared -o $@ $^
742
743 lib/idct.so: $(PLUGIN_IDCT)
744         $(CC) $(PCFLAGS) -shared -o $@ $^
745
746 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
747         $(CC) $(PCFLAGS) -shared -o $@ $^
748
749 lib/idctmmx.so: $(PLUGIN_IDCTMMX)
750         $(CC) $(PCFLAGS) -shared -o $@ $^
751
752 lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
753         $(CC) $(PCFLAGS) -shared -o $@ $^
754 endif
755
756 ################################################################################
757 # Note on generic rules and dependancies
758 ################################################################################
759
760 # Note on dependancies: each .c file is associated with a .d file, which
761 # depends of it. The .o file associated with a .c file depends of the .d, of the
762 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
763 # directory.
764 # The dep directory should be ignored by CVS.
765
766 # Note on inclusions: depending of the target, the dependancies files must
767 # or must not be included. The problem is that if we ask make to include a file,
768 # and this file does not exist, it is made before it can be included. In a
769 # general way, a .d file should be included if and only if the corresponding .o
770 # needs to be re-made.
771
772 # Two makefiles are used: the main one (this one) has regular generic rules,
773 # except for .o files, for which it calls the object Makefile. Dependancies
774 # are not included in this file.
775 # The object Makefile known how to make a .o from a .c, and includes
776 # dependancies for the target, but only those required.