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