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