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