1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
5 ifeq ($(shell [ ! -r Makefile.opts
] && echo
1),)
9 ###############################################################################
11 ###############################################################################
14 # All possible plugin directories, needed for make clean
61 PLUGINS_TARGETS
:= a52
/a52 \
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 \
90 filter/filter_deinterlace \
91 filter/filter_transform \
92 filter/filter_invert \
93 filter/filter_distort \
110 lpcm_adec
/lpcm_adec \
115 memcpy
/memcpymmxext \
121 motion
/motionmmxext \
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 \
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
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
)
162 ifeq ($(NEED_GETOPT
),1)
163 C_OBJ
+= extras
/GNUgetopt
/getopt.o extras
/GNUgetopt
/getopt1.o
166 ifeq ($(NEED_SYMBOLS
),1)
167 C_OBJ
+= src
/misc
/symbols.o
171 CPP_OBJ
:= src
/misc
/beos_specific.o
174 ifneq (,$(findstring darwin
,$(SYS
)))
175 C_OBJ
+= src
/misc
/darwin_specific.o
178 ifneq (,$(findstring mingw32
,$(SYS
)))
179 C_OBJ
+= src
/misc
/win32_specific.o
180 RESOURCE_OBJ
:= share
/vlc_win32_rc.o
183 VLC_OBJ
:= $(C_OBJ
) $(CPP_OBJ
) $(BUILTIN_OBJ
) $(RESOURCE_OBJ
)
188 H_OBJ
:= src
/misc
/modules_builtin.h
191 # Other lists of files
193 C_DEP
:= $(C_OBJ
:%.o
=.dep
/%.d
)
194 CPP_DEP
:= $(CPP_OBJ
:%.o
=.dep
/%.dpp
)
197 # Translate plugin names
200 PLUGIN_OBJ
:= $(shell for i in
$(PLUGINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.so@' -e
's@^ .*@@' ; done
)
203 BUILTIN_OBJ
:= $(shell for i in
$(BUILTINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.a@' -e
's@^ .*@@' ; done
)
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
=)
213 # All symbols must be exported
216 ###############################################################################
218 ###############################################################################
223 all: Makefile.opts vlc
${ALIASES} vlc.app plugins po
226 @echo
"**** No configuration found, please run ./configure"
229 # $(MAKE) $(MAKECMDGOALS)
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
)
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
254 -cd extras
/libdvdcss
&& $(MAKE
) clean
257 -cd po
&& $(MAKE
) clean
260 -cd extras
/libdvdread
&& $(MAKE
) 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
269 rm -f
$(C_OBJ
) $(CPP_OBJ
)
270 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
274 -cd po
&& $(MAKE
) maintainer-clean
275 rm -f
**/*.o
**/*~
*.log
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
285 # Install/uninstall rules
287 install: libdvdcss-install vlc-install plugins-install po-install
289 uninstall: libdvdcss-uninstall vlc-uninstall plugins-uninstall po-uninstall
292 mkdir
-p
$(DESTDIR
)$(bindir)
293 $(INSTALL
) vlc
$(DESTDIR
)$(bindir)
295 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias && ln
-s vlc
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
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
303 rm -f
$(DESTDIR
)$(bindir)/vlc
305 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
307 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.psf
308 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.png
309 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.xpm
312 mkdir
-p
$(DESTDIR
)$(libdir)/videolan
/vlc
314 $(INSTALL
) -m
644 $(PLUGINS
:%=plugins
/%.so
) $(DESTDIR
)$(libdir)/videolan
/vlc
318 rm -f
$(DESTDIR
)$(libdir)/videolan
/vlc
/*.so
321 -cd extras
/libdvdcss
&& $(MAKE
) install
324 -cd extras
/libdvdcss
&& $(MAKE
) uninstall
327 -cd extras
/libdvdread
&& $(MAKE
) install
329 libdvdread-uninstall
:
330 -cd extras
/libdvdread
&& $(MAKE
) uninstall
333 -cd po
&& $(MAKE
) install
336 -cd po
&& $(MAKE
) uninstall
339 # Package generation rules
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
; \
346 echo
"OK."; mkdir tmp
; \
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 ; \
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
368 cp po
/*.po tmp
/vlc
/po
369 for i in Makefile.in.in POTFILES.in
; do cp po
/$$i tmp
/vlc
/po
; done
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 \
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
390 snapshot
: snapshot-common
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 .
399 snapshot-nocss
: snapshot-common
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 .
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.
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
; \
430 echo
"OK."; mkdir tmp
; \
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
443 for file in default8x16.psf default8x9.psf
; \
444 do cp share
/$$file tmp
/share
/ ; done
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
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
; \
457 echo
"OK."; mkdir tmp
; \
461 mkdir
-p tmp
/vlc
/share
462 # Copy relevant files
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
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 .
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
; \
481 echo
"OK."; mkdir tmp
; \
484 # Copy relevant files
486 cp AUTHORS COPYING ChangeLog ChangeLog.libdvdcss \
487 README README.libdvdcss FAQ TODO tmp
/
490 .
/macosx-dmg
0 "vlc-${VLC_QUICKVERSION}" tmp
/*
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
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
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
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 .
529 dpkg-buildpackage
-rfakeroot
-us
-uc
532 # Gtk/Gnome/* aliases and OS X application
534 gnome-vlc gvlc kvlc qvlc
: vlc
535 rm -f
$@
&& ln
-s vlc
$@
539 ifneq (,$(findstring darwin
,$(SYS
)))
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
/
547 $(INSTALL
) $(PLUGINS
:%=plugins
/%.so
) vlc.app
/Contents
/MacOS
/plugins
549 $(INSTALL
) -m
644 share
/*.psf vlc.app
/Contents
/MacOS
/share
555 # Generic rules (see below)
557 $(H_OBJ
): Makefile.opts Makefile.dep Makefile
558 # @echo "regenerating $@"
559 @
rm -f
$@
&& cp
$@.in
$@
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* );" >>$@
; \
568 @echo
"#define ALLOCATE_ALL_BUILTINS() \\" >> $@
;
569 @echo
" do \\" >> $@
;
570 @echo
" { \\" >> $@
;
572 @for i in
$(BUILTINS
) ; do \
573 echo
" ALLOCATE_BUILTIN("$$i"); \\" >> $@
; \
576 @echo
" } while( 0 );" >> $@
;
580 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
582 $(CPP_DEP
): %.dpp
: FORCE
583 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
585 $(C_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
586 $(C_OBJ
): %.o
: $(H_OBJ
)
587 $(C_OBJ
): %.o
: .dep
/%.d
589 $(CC
) $(CFLAGS
) $(CFLAGS_VLC
) -c
-o
$@
$<
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
$@
$<
597 $(RESOURCE_OBJ
): %.o
: Makefile.dep Makefile
598 ifneq (,(findstring mingw32
,$(SYS
)))
599 $(RESOURCE_OBJ
): %.o
: %.rc
600 $(WINDRES
) -i
$< -o
$@
604 # Main application target
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
)
609 xres
-o
$@ .
/share
/vlc_beos.rsrc
616 plugins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(PLUGIN_OBJ
)
618 @cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:plugins
/%.so
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) -f ..
/..
/Makefile.modules
$(@
:plugins
/%=..
/%)
621 # Built-in modules target
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
/%=..
/%)
630 libdvdcss
: Makefile.opts
631 @cd extras
/libdvdcss
&& $(MAKE
)
636 libdvdread
: Makefile.opts
637 @cd extras
/libdvdread
&& $(MAKE
)