1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
5 ifeq ($(shell [ ! -r Makefile.opts
] && echo
1),)
8 ifeq ($(shell [ ! -r Makefile.config
] && echo
1),)
9 include Makefile.config
12 ###############################################################################
14 ###############################################################################
17 # All possible plugin directories, needed for make clean
68 PLUGINS_TARGETS
:= a52
/a52 \
79 chroma
/chroma_i420_rgb \
80 chroma
/chroma_i420_rgb_mmx \
81 chroma
/chroma_i420_yuy2 \
82 chroma
/chroma_i420_yuy2_mmx \
83 chroma
/chroma_i422_yuy2 \
84 chroma
/chroma_i422_yuy2_mmx \
85 chroma
/chroma_i420_ymga \
86 chroma
/chroma_i420_ymga_mmx \
99 filter/filter_deinterlace \
100 filter/filter_transform \
101 filter/filter_invert \
102 filter/filter_distort \
104 filter/filter_clone \
120 lpcm_adec
/lpcm_adec \
125 memcpy
/memcpymmxext \
127 memcpy
/memcpyaltivec \
132 motion
/motionmmxext \
134 motion
/motionaltivec \
135 mpeg_system
/mpeg_audio \
136 mpeg_system
/mpeg_es \
137 mpeg_system
/mpeg_ps \
138 mpeg_system
/mpeg_ts \
139 mpeg_system
/mpeg_ts_dvbpsi \
140 mpeg_adec
/mpeg_adec \
141 mpeg_vdec
/mpeg_vdec \
147 satellite
/satellite \
162 INTERFACE
:= main interface intf_msg intf_playlist intf_eject
163 INPUT
:= input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
164 VIDEO_OUTPUT
:= video_output video_text vout_pictures vout_subpictures
165 AUDIO_OUTPUT
:= audio_output aout_ext-dec aout_pcm aout_spdif
166 MISC
:= mtime modules configuration netutils iso_lang
168 C_OBJ
:= $(INTERFACE
:%=src
/interface
/%.o
) \
169 $(INPUT
:%=src
/input
/%.o
) \
170 $(VIDEO_OUTPUT
:%=src
/video_output
/%.o
) \
171 $(AUDIO_OUTPUT
:%=src
/audio_output
/%.o
) \
172 $(MISC
:%=src
/misc
/%.o
)
177 ifeq ($(NEED_GETOPT
),1)
178 C_OBJ
+= extras
/GNUgetopt
/getopt.o extras
/GNUgetopt
/getopt1.o
181 ifeq ($(NEED_SYMBOLS
),1)
182 C_OBJ
+= src
/misc
/symbols.o
186 CPP_OBJ
:= src
/misc
/beos_specific.o
189 ifneq (,$(findstring darwin
,$(SYS
)))
190 C_OBJ
+= src
/misc
/darwin_specific.o
193 ifneq (,$(findstring mingw32
,$(SYS
)))
194 C_OBJ
+= src
/misc
/win32_specific.o
195 RESOURCE_OBJ
:= share
/vlc_win32_rc.o
198 VLC_OBJ
:= $(C_OBJ
) $(CPP_OBJ
) $(M_OBJ
) $(BUILTIN_OBJ
) $(RESOURCE_OBJ
)
203 H_OBJ
:= src
/misc
/modules_builtin.h
206 # Other lists of files
208 C_DEP
:= $(C_OBJ
:%.o
=.dep
/%.d
)
209 CPP_DEP
:= $(CPP_OBJ
:%.o
=.dep
/%.dpp
)
212 # Translate plugin names
215 PLUGIN_OBJ
:= $(shell for i in
$(PLUGINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.so@' -e
's@^ .*@@' ; done
)
218 BUILTIN_OBJ
:= $(shell for i in
$(BUILTINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.a@' -e
's@^ .*@@' ; done
)
224 VERSION
:= $(shell grep
'^ *VERSION=' configure.in | head
-1 | sed
's/"//g' | cut
-f2
-d
=)
226 # All symbols must be exported
229 ###############################################################################
231 ###############################################################################
236 all: Makefile.opts vlc
${ALIASES} vlc.app plugins po
239 @echo
"**** No configuration found, please run ./configure"
242 # $(MAKE) $(MAKECMDGOALS)
247 @echo CFLAGS
: $(CFLAGS
)
248 @echo LDFLAGS
: $(LDFLAGS
)
249 @echo plugins_CFLAGS
: $(plugins_CFLAGS
)
250 @echo plugins_LDFLAGS
: $(plugins_LDFLAGS
)
251 @echo builtins_CFLAGS
: $(builtins_CFLAGS
)
252 @echo builtins_LDFLAGS
: $(builtins_LDFLAGS
)
253 @echo C_OBJ
: $(C_OBJ
)
254 @echo CPP_OBJ
: $(CPP_OBJ
)
255 @echo PLUGIN_OBJ
: $(PLUGIN_OBJ
)
256 @echo BUILTIN_OBJ
: $(BUILTIN_OBJ
)
261 clean: plugins-clean po-clean vlc-clean
262 rm -f src
/*/*.o extras
/*/*.o
263 rm -f lib
/*.so
* lib
/*.a
264 rm -f plugins
/*.so plugins
/*.a plugins
/*.lib plugins
/*.tds
265 rm -rf extras
/MacOSX
/build
268 -cd po
&& $(MAKE
) clean
271 for
dir in
$(PLUGINS_DIR
) ; do \
272 ( cd plugins
/$${dir} \
273 && $(MAKE
) -f ..
/..
/Makefile.modules
clean ) ; done
274 rm -f plugins
/*/*.o plugins
/*/*.lo plugins
/*/*.moc plugins
/*/*.bak
277 rm -f
$(C_OBJ
) $(CPP_OBJ
)
278 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
282 -cd po
&& $(MAKE
) maintainer-clean
283 rm -f
**/*.o
**/*~
*.log
284 rm -f Makefile.opts Makefile.config
285 rm -f
include/defs.h
include/modules_builtin.h
286 rm -f src
/misc
/modules_builtin.h
287 rm -f config
*status config
*cache config
*log conftest
*
288 rm -f gmon.out core build-stamp
293 # Install/uninstall rules
295 install: vlc-install plugins-install po-install
297 uninstall: vlc-uninstall plugins-uninstall po-uninstall
300 mkdir
-p
$(DESTDIR
)$(bindir)
301 $(INSTALL
) vlc
$(DESTDIR
)$(bindir)
303 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias && ln
-s vlc
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
305 mkdir
-p
$(DESTDIR
)$(datadir)/videolan
306 $(INSTALL
) -m
644 share
/*.psf
$(DESTDIR
)$(datadir)/videolan
307 $(INSTALL
) -m
644 share
/*.png
$(DESTDIR
)$(datadir)/videolan
308 $(INSTALL
) -m
644 share
/*.xpm
$(DESTDIR
)$(datadir)/videolan
311 rm -f
$(DESTDIR
)$(bindir)/vlc
313 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
315 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.psf
316 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.png
317 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.xpm
320 mkdir
-p
$(DESTDIR
)$(libdir)/videolan
/vlc
322 $(INSTALL
) -m
644 $(PLUGINS
:%=plugins
/%.so
) $(DESTDIR
)$(libdir)/videolan
/vlc
326 rm -f
$(DESTDIR
)$(libdir)/videolan
/vlc
/*.so
329 -cd po
&& $(MAKE
) install
332 -cd po
&& $(MAKE
) uninstall
335 # Package generation rules
338 # Check that tmp isn't in the way
339 @if
test -e tmp
; then \
340 echo
"Error: please remove ./tmp, it is in the way"; false
; \
342 echo
"OK."; mkdir tmp
; \
344 # Copy directory structure in tmp
345 find
-type d | grep
-v
'\(\.dep\|snapshot\|CVS\)' | while read i
; \
346 do mkdir
-p tmp
/vlc
/$$i ; \
349 find debian
-mindepth
1 -maxdepth
1 -type d | \
350 while read i
; do
rm -Rf tmp
/vlc
/$$i ; done
351 # Copy .c .h .in .cpp .m and .glade files
352 find
include src plugins
-type f
-name
'*.[bcdhigmrst]*' | while read i
; \
353 do cp
$$i tmp
/vlc
/$$i ; done
354 # Grmbl... special case...
355 for i in API BUGS DESIGN TODO
; \
356 do cp plugins
/mad
/$$i tmp
/vlc
/plugins
/mad
; done
357 # Copy plugin Makefiles
358 find plugins
-type f
-name Makefile | while read i
; \
359 do cp
$$i tmp
/vlc
/$$i ; done
360 # Copy extra programs and documentation
361 cp
-a extras
/* tmp
/vlc
/extras
362 cp
-a doc
/* tmp
/vlc
/doc
363 find tmp
/vlc
/extras tmp
/vlc
/doc \
364 -type d
-name CVS
-o
-name
'.*' -o
-name
'*.[o]' | \
365 while read i
; do
rm -Rf
$$i ; done
367 cp po
/ChangeLog po
/vlc.pot po
/*.po tmp
/vlc
/po
368 for i in Makefile.in.in POTFILES.in
; do cp po
/$$i tmp
/vlc
/po
; done
370 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog
* README
* INSTALL
* \
371 ABOUT-NLS BUGS MODULES vlc.spec \
372 Makefile Makefile.
*.in Makefile.dep Makefile.modules \
373 configure configure.in install-sh install-win32 macosx-dmg \
374 config.sub config.guess 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 patch
; do \
383 cp ipkg
/$$file tmp
/vlc
/ipkg
/ ; done
384 # Copy fonts and icons
385 for file in share
/*vlc
* share
/*psf
; do \
386 cp
$$file tmp
/vlc
/share
; done
389 mv tmp
/vlc tmp
/$$F; (cd tmp
; tar czf ..
/$$F.
tar.gz
$$F); \
394 # XXX: this rule is probably only useful to you if you have exactly
395 # the same setup as me. Contact sam@zoy.org if you need to use it.
397 # Check that tmp isn't in the way
398 @if
test -e tmp
; then \
399 echo
"Error: please remove ./tmp, it is in the way"; false
; \
401 echo
"OK."; mkdir tmp
; \
403 # Create installation script
404 cp install-win32 tmp
/nsi
405 # Copy relevant files
408 cp INSTALL.win32 tmp
/INSTALL.txt
; unix2dos tmp
/INSTALL.txt
409 for file in AUTHORS COPYING ChangeLog README FAQ TODO
; \
410 do cp
$$file tmp
/$${file}.txt
; \
411 unix2dos tmp
/$${file}.txt
; done
413 cp
$(PLUGINS
:%=plugins
/%.so
) tmp
/plugins
/
414 # don't include these two
415 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
417 for i in
$(PLUGINS
) ; do if
test $$i != intfwin
; then
$(STRIP
) tmp
/plugins
/$$i.so
; fi
; done
420 for file in default8x16.psf default8x9.psf
; \
421 do cp share
/$$file tmp
/share
/ ; done
423 wine ~
/.wine
/fake_windows
/Program\ Files
/NSIS
/makensis.exe
-- /DVERSION
=${VERSION} /CD tmp
/nsi
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
; \
432 echo
"OK."; mkdir tmp
; \
436 mkdir
-p tmp
/vlc
/share
437 # Copy relevant files
440 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp
/vlc
/
441 for file in default8x16.psf default8x9.psf
; \
442 do cp share
/$$file tmp
/vlc
/share
/ ; done
443 mkdir tmp
/vlc
/plugins
444 cp
$(PLUGINS
:%=plugins
/%.so
) tmp
/vlc
/plugins
/
445 strip $(PLUGINS
:%=tmp
/vlc
/plugins
/%.so
)
447 mv tmp
/vlc tmp
/vlc-
${VERSION}
448 (cd tmp
; find vlc-
${VERSION} | \
449 zip
-9 -@ vlc-
${VERSION}-BeOS-x86.zip
)
450 mv tmp
/vlc-
${VERSION}-BeOS-x86.zip .
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
; \
459 echo
"OK."; mkdir tmp
; \
462 # Copy relevant files
464 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp
/
467 .
/macosx-dmg
0 "vlc-${VERSION}" tmp
/*
473 # Gtk/Gnome/* aliases and OS X application
475 gnome-vlc gvlc kvlc qvlc
: vlc
476 rm -f
$@
&& ln
-s vlc
$@
480 ifneq (,$(findstring darwin
,$(SYS
)))
482 cd extras
/MacOSX
; pbxbuild | grep
-v
'^ ' | grep
-v
'^\t' | grep
-v
"^$$"
483 cp
-r extras
/MacOSX
/build
/vlc.bundle .
/vlc.app
484 $(INSTALL
) -d vlc.app
/Contents
/MacOS
/share
485 $(INSTALL
) -d vlc.app
/Contents
/MacOS
/plugins
486 $(INSTALL
) vlc vlc.app
/Contents
/MacOS
/
488 $(INSTALL
) $(PLUGINS
:%=plugins
/%.so
) vlc.app
/Contents
/MacOS
/plugins
490 $(INSTALL
) -m
644 share
/*.psf vlc.app
/Contents
/MacOS
/share
496 # Generic rules (see below)
498 $(H_OBJ
): Makefile.opts Makefile.dep Makefile
499 # @echo "regenerating $@"
500 @
rm -f
$@
&& cp
$@.in
$@
502 @for i in
$(BUILTINS
) ; do \
503 echo
"int InitModule__MODULE_"$$i"( module_t* );" >>$@
; \
504 echo
"int ActivateModule__MODULE_"$$i"( module_t* );" >>$@
; \
505 echo
"int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@
; \
509 @echo
"#define ALLOCATE_ALL_BUILTINS() \\" >> $@
;
510 @echo
" do \\" >> $@
;
511 @echo
" { \\" >> $@
;
513 @for i in
$(BUILTINS
) ; do \
514 echo
" ALLOCATE_BUILTIN("$$i"); \\" >> $@
; \
517 @echo
" } while( 0 );" >> $@
;
521 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
523 $(CPP_DEP
): %.dpp
: FORCE
524 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
526 $(C_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
527 $(C_OBJ
): %.o
: $(H_OBJ
)
528 $(C_OBJ
): %.o
: .dep
/%.d
530 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
532 $(CPP_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
533 $(CPP_OBJ
): %.o
: $(H_OBJ
)
534 $(CPP_OBJ
): %.o
: .dep
/%.dpp
535 $(CPP_OBJ
): %.o
: %.
cpp
536 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
538 $(M_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
539 $(M_OBJ
): %.o
: $(H_OBJ
)
540 $(M_OBJ
): %.o
: .dep
/%.dm
542 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
544 $(RESOURCE_OBJ
): %.o
: Makefile.dep Makefile
545 ifneq (,(findstring mingw32
,$(SYS
)))
546 $(RESOURCE_OBJ
): %.o
: %.rc
547 $(WINDRES
) -i
$< -o
$@
551 # Main application target
553 vlc
: Makefile.opts Makefile.dep Makefile
$(VLC_OBJ
) $(BUILTIN_OBJ
)
554 $(CC
) $(CFLAGS
) -o
$@
$(VLC_OBJ
) $(BUILTIN_OBJ
) $(LDFLAGS
) $(vlc_LDFLAGS
) $(builtins_LDFLAGS
)
556 xres
-o
$@ .
/share
/vlc_beos.rsrc
563 plugins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(PLUGIN_OBJ
)
565 @cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:plugins
/%.so
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) -f ..
/..
/Makefile.modules
$(@
:plugins
/%=..
/%)
568 # Built-in modules target
570 builtins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(BUILTIN_OBJ
)
571 $(BUILTIN_OBJ
): FORCE
572 @cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:plugins
/%.a
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) -f ..
/..
/Makefile.modules
$(@
:plugins
/%=..
/%)