]> git.sesse.net Git - vlc/blob - Makefile
* ./src/input/mpeg_system.c: fixed a bus error on UltraSparc.
[vlc] / Makefile
1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
4
5 ifeq ($(shell [ ! -r Makefile.opts ] && echo 1),)
6     include Makefile.opts
7 endif
8
9 ###############################################################################
10 # Objects and files
11 ###############################################################################
12
13
14 # All possible plugin directories, needed for make clean
15 #
16 PLUGINS_DIR :=  a52 \
17                 aa \
18                 ac3_adec \
19                 ac3_spdif \
20                 access \
21                 alsa \
22                 arts \
23                 beos \
24                 chroma \
25                 directx \
26                 downmix \
27                 dsp \
28                 dummy \
29                 dvd \
30                 dvdread \
31                 esd \
32                 fb \
33                 filter \
34                 fx \
35                 ggi \
36                 glide \
37                 gtk \
38                 idct \
39                 imdct \
40                 kde \
41                 lirc \
42                 lpcm_adec \
43                 macosx \
44                 mad \
45                 memcpy \
46                 mga \
47                 motion \
48                 mpeg_system \
49                 mpeg_adec \
50                 mpeg_vdec \
51                 network \
52                 qnx \
53                 qt \
54                 sdl \
55                 spudec \
56                 text \
57                 vcd \
58                 win32 \
59                 x11
60
61 PLUGINS_TARGETS := a52/a52 \
62                 aa/aa \
63                 ac3_adec/ac3_adec \
64                 ac3_spdif/ac3_spdif \
65                 access/file \
66                 access/udp \
67                 access/http \
68                 alsa/alsa \
69                 arts/arts \
70                 beos/beos \
71                 chroma/chroma_i420_rgb \
72                 chroma/chroma_i420_rgb_mmx \
73                 chroma/chroma_i420_yuy2 \
74                 chroma/chroma_i420_yuy2_mmx \
75                 chroma/chroma_i422_yuy2 \
76                 chroma/chroma_i422_yuy2_mmx \
77                 chroma/chroma_i420_ymga \
78                 chroma/chroma_i420_ymga_mmx \
79                 directx/directx \
80                 downmix/downmix \
81                 downmix/downmixsse \
82                 downmix/downmix3dn \
83                 dsp/dsp \
84                 dummy/dummy \
85                 dummy/null \
86                 dvd/dvd \
87                 dvdread/dvdread \
88                 esd/esd \
89                 fb/fb \
90                 filter/filter_deinterlace \
91                 filter/filter_transform \
92                 filter/filter_invert \
93                 filter/filter_distort \
94                 filter/filter_wall \
95                 fx/fx_scope \
96                 ggi/ggi \
97                 glide/glide \
98                 gtk/gnome \
99                 gtk/gtk \
100                 idct/idct \
101                 idct/idctclassic \
102                 idct/idctmmx \
103                 idct/idctmmxext \
104                 idct/idctaltivec \
105                 imdct/imdct \
106                 imdct/imdct3dn \
107                 imdct/imdctsse \
108                 kde/kde \
109                 lirc/lirc \
110                 lpcm_adec/lpcm_adec \
111                 macosx/macosx \
112                 mad/mad \
113                 memcpy/memcpy \
114                 memcpy/memcpymmx \
115                 memcpy/memcpymmxext \
116                 memcpy/memcpy3dn \
117                 mga/mga \
118                 mga/xmga \
119                 motion/motion \
120                 motion/motionmmx \
121                 motion/motionmmxext \
122                 motion/motion3dnow \
123                 motion/motionaltivec \
124                 mpeg_system/mpeg_es \
125                 mpeg_system/mpeg_ps \
126                 mpeg_system/mpeg_ts \
127                 mpeg_adec/mpeg_adec \
128                 mpeg_vdec/mpeg_vdec \
129                 network/ipv4 \
130                 network/ipv6 \
131                 qnx/qnx \
132                 qt/qt \
133                 sdl/sdl \
134                 spudec/spudec \
135                 text/logger \
136                 text/ncurses \
137                 text/rc \
138                 vcd/vcd \
139                 win32/waveout \
140                 win32/win32 \
141                 x11/x11 \
142                 x11/xvideo
143
144 #
145 # C Objects
146
147 INTERFACE := main interface intf_msg intf_playlist intf_eject
148 INPUT := input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
149 VIDEO_OUTPUT := video_output video_text vout_pictures vout_subpictures
150 AUDIO_OUTPUT := audio_output aout_ext-dec aout_pcm aout_spdif
151 MISC := mtime modules configuration netutils iso_lang
152
153 C_OBJ :=        $(INTERFACE:%=src/interface/%.o) \
154                 $(INPUT:%=src/input/%.o) \
155                 $(VIDEO_OUTPUT:%=src/video_output/%.o) \
156                 $(AUDIO_OUTPUT:%=src/audio_output/%.o) \
157                 $(MISC:%=src/misc/%.o)
158
159 #
160 # Misc Objects
161
162 ifeq ($(NEED_GETOPT),1)
163 C_OBJ += extras/GNUgetopt/getopt.o extras/GNUgetopt/getopt1.o 
164 endif
165
166 ifeq ($(NEED_SYMBOLS),1)
167 C_OBJ += src/misc/symbols.o
168 endif
169
170 ifeq ($(SYS),beos)
171 CPP_OBJ :=      src/misc/beos_specific.o
172 endif
173
174 ifneq (,$(findstring darwin,$(SYS)))
175 C_OBJ +=        src/misc/darwin_specific.o
176 endif
177
178 ifneq (,$(findstring mingw32,$(SYS)))
179 C_OBJ +=        src/misc/win32_specific.o
180 RESOURCE_OBJ := share/vlc_win32_rc.o
181 endif
182
183 VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
184
185 #
186 # Generated header
187 #
188 H_OBJ :=        src/misc/modules_builtin.h
189
190 #
191 # Other lists of files
192 #
193 C_DEP := $(C_OBJ:%.o=.dep/%.d)
194 CPP_DEP := $(CPP_OBJ:%.o=.dep/%.dpp)
195
196 #
197 # Translate plugin names
198 #
199 ifneq (,$(PLUGINS))
200 PLUGIN_OBJ := $(shell for i in $(PLUGINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.so@' -e 's@^ .*@@' ; done)
201 endif
202 ifneq (,$(BUILTINS))
203 BUILTIN_OBJ := $(shell for i in $(BUILTINS) ; do echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.*/\('$$i'\) .*@plugins/\1.a@' -e 's@^ .*@@' ; done)
204 endif
205
206 #
207 # Misc variables
208 #
209 VLC_QUICKVERSION := $(shell grep '^ *VLC_VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
210 LIBDVDCSS_QUICKVERSION := $(shell grep '^ *LIBDVDCSS_VERSION=' configure.in | head -1 | sed 's/"//g' | cut -f2 -d=)
211
212
213 # All symbols must be exported
214 export
215
216 ###############################################################################
217 # Targets
218 ###############################################################################
219
220 #
221 # Virtual targets
222 #
223 all: Makefile.opts vlc ${ALIASES} vlc.app plugins po
224
225 Makefile.opts:
226         @echo "**** No configuration found, please run ./configure"
227         @exit 1
228 #       ./configure
229 #       $(MAKE) $(MAKECMDGOALS)
230 #       exit    
231
232 show:
233         @echo CC: $(CC)
234         @echo CFLAGS: $(CFLAGS)
235         @echo DCFLAGS: $(DCFLAGS)
236         @echo LDFLAGS: $(LDFLAGS)
237         @echo PCFLAGS: $(PCFLAGS)
238         @echo PLDFLAGS: $(PLDFLAGS)
239         @echo C_OBJ: $(C_OBJ)
240         @echo CPP_OBJ: $(CPP_OBJ)
241         @echo PLUGIN_OBJ: $(PLUGIN_OBJ)
242         @echo BUILTIN_OBJ: $(BUILTIN_OBJ)
243
244 #
245 # Cleaning rules
246 #
247 clean: libdvdcss-clean libdvdread-clean plugins-clean po-clean vlc-clean
248         rm -f src/*/*.o extras/*/*.o
249         rm -f lib/*.so* lib/*.a
250         rm -f plugins/*.so plugins/*.a
251         rm -rf extras/MacOSX/build
252
253 libdvdcss-clean:
254         -cd extras/libdvdcss && $(MAKE) clean
255
256 po-clean:
257         -cd po && $(MAKE) clean
258
259 libdvdread-clean:
260         -cd extras/libdvdread && $(MAKE) clean
261
262 plugins-clean:
263         for dir in $(PLUGINS_DIR) ; do \
264                 ( cd plugins/$${dir} \
265                         && $(MAKE) -f ../../Makefile.modules clean ) ; done
266         rm -f plugins/*/*.o plugins/*/*.lo plugins/*/*.moc plugins/*/*.bak
267
268 vlc-clean:
269         rm -f $(C_OBJ) $(CPP_OBJ)
270         rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
271         rm -Rf vlc.app
272
273 distclean: clean
274         -cd po && $(MAKE) maintainer-clean
275         rm -f **/*.o **/*~ *.log
276         rm -f Makefile.opts
277         rm -f include/defs.h include/modules_builtin.h
278         rm -f src/misc/modules_builtin.h
279         rm -f config*status config*cache config*log
280         rm -f gmon.out core build-stamp
281         rm -Rf .dep
282         rm -f .gdb_history
283
284 #
285 # Install/uninstall rules
286 #
287 install: libdvdcss-install vlc-install plugins-install po-install
288
289 uninstall: libdvdcss-uninstall vlc-uninstall plugins-uninstall po-uninstall
290
291 vlc-install:
292         mkdir -p $(DESTDIR)$(bindir)
293         $(INSTALL) vlc $(DESTDIR)$(bindir)
294 ifneq (,$(ALIASES))
295         for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
296 endif
297         mkdir -p $(DESTDIR)$(datadir)/videolan
298         $(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
299         $(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
300         $(INSTALL) -m 644 share/*.xpm $(DESTDIR)$(datadir)/videolan
301
302 vlc-uninstall:
303         rm -f $(DESTDIR)$(bindir)/vlc
304 ifneq (,$(ALIASES))
305         for alias in $(ALIASES) ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias ; fi ; done
306 endif
307         rm -f $(DESTDIR)$(datadir)/videolan/*.psf
308         rm -f $(DESTDIR)$(datadir)/videolan/*.png
309         rm -f $(DESTDIR)$(datadir)/videolan/*.xpm
310
311 plugins-install:
312         mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
313 ifneq (,$(PLUGINS))
314         $(INSTALL) -m 644 $(PLUGINS:%=plugins/%.so) $(DESTDIR)$(libdir)/videolan/vlc
315 endif
316
317 plugins-uninstall:
318         rm -f $(DESTDIR)$(libdir)/videolan/vlc/*.so
319
320 libdvdcss-install:
321         -cd extras/libdvdcss && $(MAKE) install
322
323 libdvdcss-uninstall:
324         -cd extras/libdvdcss && $(MAKE) uninstall
325
326 libdvdread-install:
327         -cd extras/libdvdread && $(MAKE) install
328
329 libdvdread-uninstall:
330         -cd extras/libdvdread && $(MAKE) uninstall
331
332 po-install:
333         -cd po && $(MAKE) install
334
335 po-uninstall:
336         -cd po && $(MAKE) uninstall
337
338 #
339 # Package generation rules
340 #
341 snapshot-common:
342         # Check that tmp isn't in the way
343         @if test -e tmp; then \
344                 echo "Error: please remove ./tmp, it is in the way"; false; \
345         else \
346                 echo "OK."; mkdir tmp; \
347         fi
348         # Copy directory structure in tmp
349         find -type d | grep -v '\(\.dep\|snapshot\|CVS\)' | while read i ; \
350                 do mkdir -p tmp/vlc/$$i ; \
351         done
352         rm -Rf tmp/vlc/tmp
353         find debian -mindepth 1 -maxdepth 1 -type d | \
354                 while read i ; do rm -Rf tmp/vlc/$$i ; done
355         # Copy .c .h .in .cpp and .glade files
356         find include src plugins -type f -name '*.[chig]*' | while read i ; \
357                 do cp $$i tmp/vlc/$$i ; done
358         # Copy plugin Makefiles
359         find plugins -type f -name Makefile | while read i ; \
360                 do cp $$i tmp/vlc/$$i ; done
361         # Copy extra programs and documentation
362         cp -a extras/* tmp/vlc/extras
363         cp -a doc/* tmp/vlc/doc
364         find tmp/vlc/extras tmp/vlc/doc \
365                 -type d -name CVS -o -name '.*' -o -name '*.[o]' | \
366                         while read i ; do rm -Rf $$i ; done
367         # Copy gettext stuff
368         cp po/*.po tmp/vlc/po
369         for i in Makefile.in.in POTFILES.in ; do cp po/$$i tmp/vlc/po ; done
370         # Copy misc files
371         cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog* README* INSTALL* \
372                 Makefile Makefile.opts.in Makefile.dep Makefile.modules \
373                 configure configure.in install-sh install-win32 vlc.spec \
374                 config.sub config.guess acconfig.h aclocal.m4 mkinstalldirs \
375                         tmp/vlc/
376         # Copy Debian control files
377         for file in debian/*dirs debian/*docs debian/*menu debian/*desktop \
378                 debian/*copyright ; do cp $$file tmp/vlc/debian ; done
379         for file in control changelog rules ; do \
380                 cp debian/$$file tmp/vlc/debian/ ; done
381         # Copy ipkg control files
382         for file in control rules ; do \
383                 cp ipkg/$$file tmp/vlc/ipkg/ ; done
384         # Copy fonts and icons
385         for file in share/*png share/*xpm share/*psf ; do \
386                 cp $$file tmp/vlc/share ; done
387         for file in vlc_beos.rsrc vlc.icns gvlc_win32.ico vlc_win32_rc.rc ; do \
388                         cp share/$$file tmp/vlc/share/ ; done
389
390 snapshot: snapshot-common
391         # Build archives
392         F=vlc-${VLC_QUICKVERSION}; \
393         mv tmp/vlc tmp/$$F; (cd tmp ; tar cf $$F.tar $$F); \
394         bzip2 -f -9 < tmp/$$F.tar > $$F.tar.bz2; \
395         gzip -f -9 tmp/$$F.tar ; mv tmp/$$F.tar.gz .
396         # Clean up
397         rm -Rf tmp
398
399 snapshot-nocss: snapshot-common
400         # Remove libdvdcss
401         rm -Rf tmp/vlc/extras/libdvdcss
402         rm -f tmp/vlc/*.libdvdcss
403         # Fix debian information
404         rm -f tmp/vlc/debian/libdvdcss*
405         rm -f tmp/vlc/debian/control
406         sed -e 's#^ DVDs# unencrypted DVDs#' < debian/control \
407                 | awk '{if(gsub("Package: libdvdcss",$$0))a=1;if(a==0)print $$0;if(a==1&&$$0=="")a=0}' \
408                 > tmp/vlc/debian/control
409         rm -f tmp/vlc/debian/rules
410         sed -e 's#^\(export LIBDVDCSS_FLAGS=\).*#\1"--without-dvdcss"#' < debian/rules \
411                 | awk '{if($$0=="# libdvdcss start")a=1;if(a==0)print $$0;if($$0=="# libdvdcss stop")a=0}' \
412                 > tmp/vlc/debian/rules
413         chmod +x tmp/vlc/debian/rules
414         # Build css-disabled archives
415         F=vlc-${VLC_QUICKVERSION}; G=vlc-${VLC_QUICKVERSION}-nocss; \
416         mv tmp/vlc tmp/$$F; (cd tmp ; tar cf $$G.tar $$F); \
417         bzip2 -f -9 < tmp/$$G.tar > $$G.tar.bz2; \
418         gzip -f -9 tmp/$$G.tar ; mv tmp/$$G.tar.gz .
419         # Clean up
420         rm -Rf tmp
421
422 package-win32:
423         # XXX: this rule is probably only useful to you if you have exactly
424         # the same setup as me. Contact sam@zoy.org if you need to use it.
425         #
426         # Check that tmp isn't in the way
427         @if test -e tmp; then \
428                 echo "Error: please remove ./tmp, it is in the way"; false; \
429         else \
430                 echo "OK."; mkdir tmp; \
431         fi
432         # Create installation script
433         sed -e 's#@VERSION@#'${VLC_QUICKVERSION}'#' < install-win32 > tmp/nsi
434         # Copy relevant files
435         cp vlc.exe $(PLUGINS:%=plugins/%.so) tmp/ 
436         cp INSTALL-win32.txt AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
437                 README README.libdvdcss FAQ TODO tmp/
438         for file in iconv.dll libgmodule-1.3-12.dll libgtk-0.dll libgdk-0.dll \
439                 libgobject-1.3-12.dll libintl-1.dll libglib-1.3-12.dll \
440                 libgthread-1.3-12.dll SDL.dll README-SDL.txt ; \
441                         do cp ${DLL_PATH}/$$file tmp/ ; done
442         mkdir tmp/share
443         for file in default8x16.psf default8x9.psf ; \
444                 do cp share/$$file tmp/share/ ; done
445         # Create package 
446         wine ~/.wine/fake_windows/Program\ Files/NSIS/makensis.exe /CD tmp/nsi
447         mv tmp/vlc-${VLC_QUICKVERSION}.exe \
448                 vlc-${VLC_QUICKVERSION}-win32-installer.exe
449         # Clean up
450         rm -Rf tmp
451
452 package-beos:
453         # Check that tmp isn't in the way
454         @if test -e tmp; then \
455                 echo "Error: please remove ./tmp, it is in the way"; false; \
456         else \
457                 echo "OK."; mkdir tmp; \
458         fi
459         
460         # Create dir
461         mkdir -p tmp/vlc/share
462         # Copy relevant files
463         cp vlc tmp/vlc/
464         cp AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
465                 README README.libdvdcss FAQ TODO tmp/vlc/
466         for file in default8x16.psf default8x9.psf ; \
467                 do cp share/$$file tmp/vlc/share/ ; done
468         # Create package 
469         mv tmp/vlc tmp/vlc-${VLC_QUICKVERSION}
470         (cd tmp ; find vlc-${VLC_QUICKVERSION} | \
471         zip -9 -@ vlc-${VLC_QUICKVERSION}-beos.zip )
472         mv tmp/vlc-${VLC_QUICKVERSION}-BeOS-x86.zip .
473         # Clean up
474         rm -Rf tmp
475
476 package-macosx:
477         # Check that tmp isn't in the way
478         @if test -e tmp; then \
479                 echo "Error: please remove ./tmp, it is in the way"; false; \
480         else \
481                 echo "OK."; mkdir tmp; \
482         fi
483
484         # Copy relevant files 
485         cp -R vlc.app tmp/
486         cp AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
487                 README README.libdvdcss FAQ TODO tmp/
488
489         # Create disk image 
490         ./macosx-dmg 0 "vlc-${VLC_QUICKVERSION}" tmp/* 
491
492         # Clean up
493         rm -Rf tmp
494
495 libdvdcss-snapshot: snapshot-common
496         # Remove vlc sources and icons, doc, debian directory...
497         rm -Rf tmp/vlc/src tmp/vlc/share tmp/vlc/plugins tmp/vlc/doc
498         rm -Rf tmp/vlc/extras/GNUgetopt tmp/vlc/extras/MacOSX
499         rm -Rf tmp/vlc/debian
500         rm -Rf tmp/vlc/ipkg
501         # Remove useless headers
502         rm -f tmp/vlc/include/*
503         for file in defs.h.in config.h common.h int_types.h ; \
504                 do cp include/$$file tmp/vlc/include/ ; done
505         # Remove misc files (??? - maybe not really needed)
506         rm -f tmp/vlc/vlc.spec tmp/vlc/INSTALL-win32.txt
507         mv tmp/vlc/INSTALL.libdvdcss tmp/vlc/INSTALL
508         mv tmp/vlc/README.libdvdcss tmp/vlc/README
509         mv tmp/vlc/ChangeLog.libdvdcss tmp/vlc/ChangeLog
510         # Fix Makefile
511         rm -f tmp/vlc/Makefile
512         sed -e 's#^install:#install-unused:#' \
513                 -e 's#^uninstall:#uninstall-unused:#' \
514                 -e 's#^clean:#clean-unused:#' \
515                 -e 's#^all:.*#all: libdvdcss#' \
516                 -e 's#^libdvdcss-install:#install:#' \
517                 -e 's#^libdvdcss-uninstall:#uninstall:#' \
518                 -e 's#^libdvdcss-clean:#clean:#' \
519                 < Makefile > tmp/vlc/Makefile
520         # Build archives
521         F=libdvdcss-${LIBDVDCSS_QUICKVERSION}; \
522         mv tmp/vlc tmp/$$F; (cd tmp ; tar cf $$F.tar $$F); \
523         bzip2 -f -9 < tmp/$$F.tar > $$F.tar.bz2; \
524         gzip -f -9 tmp/$$F.tar ; mv tmp/$$F.tar.gz .
525         # Clean up
526         rm -Rf tmp
527
528 deb:
529         dpkg-buildpackage -rfakeroot -us -uc
530
531 #
532 # Gtk/Gnome/* aliases and OS X application
533 #
534 gnome-vlc gvlc kvlc qvlc: vlc
535         rm -f $@ && ln -s vlc $@
536
537 .PHONY: vlc.app
538 vlc.app: vlc plugins
539 ifneq (,$(findstring darwin,$(SYS)))
540         rm -Rf vlc.app
541         cd extras/MacOSX ; pbxbuild | grep -v '^ ' | grep -v '^\t'
542         cp -r extras/MacOSX/build/vlc.bundle ./vlc.app
543         $(INSTALL) -d vlc.app/Contents/MacOS/share
544         $(INSTALL) -d vlc.app/Contents/MacOS/plugins
545         $(INSTALL) vlc vlc.app/Contents/MacOS/
546 ifneq (,$(PLUGINS))
547         $(INSTALL) $(PLUGINS:%=plugins/%.so) vlc.app/Contents/MacOS/plugins
548 endif
549         $(INSTALL) -m 644 share/*.psf vlc.app/Contents/MacOS/share
550 endif
551
552 FORCE:
553
554 #
555 # Generic rules (see below)
556 #
557 $(H_OBJ): Makefile.opts Makefile.dep Makefile
558 #       @echo "regenerating $@"
559         @rm -f $@ && cp $@.in $@
560 ifneq (,$(BUILTINS))
561         @for i in $(BUILTINS) ; do \
562                 echo "int InitModule__MODULE_"$$i"( module_t* );" >>$@; \
563                 echo "int ActivateModule__MODULE_"$$i"( module_t* );" >>$@; \
564                 echo "int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@; \
565         done
566         @echo "" >> $@ ;
567 endif
568         @echo "#define ALLOCATE_ALL_BUILTINS() \\" >> $@ ;
569         @echo "    do \\" >> $@ ;
570         @echo "    { \\" >> $@ ;
571 ifneq (,$(BUILTINS))
572         @for i in $(BUILTINS) ; do \
573                 echo "        ALLOCATE_BUILTIN("$$i"); \\" >> $@ ; \
574         done
575 endif
576         @echo "    } while( 0 );" >> $@ ;
577         @echo "" >> $@ ;
578
579 $(C_DEP): %.d: FORCE
580         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
581
582 $(CPP_DEP): %.dpp: FORCE
583         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
584
585 $(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
586 $(C_OBJ): %.o: $(H_OBJ)
587 $(C_OBJ): %.o: .dep/%.d
588 $(C_OBJ): %.o: %.c
589         $(CC) $(CFLAGS) $(CFLAGS_VLC) -c -o $@ $<
590
591 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
592 $(CPP_OBJ): %.o: $(H_OBJ)
593 $(CPP_OBJ): %.o: .dep/%.dpp
594 $(CPP_OBJ): %.o: %.cpp
595         $(CC) $(CFLAGS) $(CFLAGS_VLC) -c -o $@ $<
596
597 $(RESOURCE_OBJ): %.o: Makefile.dep Makefile
598 ifneq (,(findstring mingw32,$(SYS)))
599 $(RESOURCE_OBJ): %.o: %.rc
600         $(WINDRES) -i $< -o $@
601 endif
602
603 #
604 # Main application target
605 #
606 vlc: Makefile.opts Makefile.dep Makefile $(VLC_OBJ) $(BUILTIN_OBJ)
607         $(CC) $(CFLAGS) -o $@ $(VLC_OBJ) $(BUILTIN_OBJ) $(LDFLAGS) $(LIB_VLC) $(LIB_BUILTINS) $(LIB_COMMON)
608 ifeq ($(SYS),beos)
609         xres -o $@ ./share/vlc_beos.rsrc
610         mimeset -f $@
611 endif
612
613 #
614 # Plugins target
615 #
616 plugins: Makefile.modules Makefile.opts Makefile.dep Makefile $(PLUGIN_OBJ)
617 $(PLUGIN_OBJ): FORCE
618         @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.so=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
619
620 #
621 # Built-in modules target
622 #
623 builtins: Makefile.modules Makefile.opts Makefile.dep Makefile $(BUILTIN_OBJ)
624 $(BUILTIN_OBJ): FORCE
625         @cd $(shell echo " "$(PLUGINS_TARGETS)" " | sed -e 's@.* \([^/]*/\)'$(@:plugins/%.a=%)' .*@plugins/\1@' -e 's@^ .*@@') && $(MAKE) -f ../../Makefile.modules $(@:plugins/%=../%)
626
627 #
628 # libdvdcss target
629 #
630 libdvdcss: Makefile.opts
631         @cd extras/libdvdcss && $(MAKE)
632
633 #
634 # libdvdread target
635 #
636 libdvdread: Makefile.opts
637         @cd extras/libdvdread && $(MAKE)
638
639 #
640 # gettext target
641 #
642 po: FORCE
643         @cd po && $(MAKE)
644