1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
5 ifeq ($(shell [ ! -r Makefile.opts
] && echo
1),)
6 include Makefile.config
10 ###############################################################################
12 ###############################################################################
15 # All possible plugin directories, needed for make clean
66 PLUGINS_TARGETS
:= a52
/a52 \
77 chroma
/chroma_i420_rgb \
78 chroma
/chroma_i420_rgb_mmx \
79 chroma
/chroma_i420_yuy2 \
80 chroma
/chroma_i420_yuy2_mmx \
81 chroma
/chroma_i422_yuy2 \
82 chroma
/chroma_i422_yuy2_mmx \
83 chroma
/chroma_i420_ymga \
84 chroma
/chroma_i420_ymga_mmx \
97 filter/filter_deinterlace \
98 filter/filter_transform \
99 filter/filter_invert \
100 filter/filter_distort \
102 filter/filter_clone \
118 lpcm_adec
/lpcm_adec \
123 memcpy
/memcpymmxext \
125 memcpy
/memcpyaltivec \
130 motion
/motionmmxext \
132 motion
/motionaltivec \
133 mpeg_system
/mpeg_audio \
134 mpeg_system
/mpeg_es \
135 mpeg_system
/mpeg_ps \
136 mpeg_system
/mpeg_ts \
137 mpeg_system
/mpeg_ts_dvbpsi \
138 mpeg_adec
/mpeg_adec \
139 mpeg_vdec
/mpeg_vdec \
145 satellite
/satellite \
160 INTERFACE
:= main interface intf_msg intf_playlist intf_eject
161 INPUT
:= input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
162 VIDEO_OUTPUT
:= video_output video_text vout_pictures vout_subpictures
163 AUDIO_OUTPUT
:= audio_output aout_ext-dec aout_pcm aout_spdif
164 MISC
:= mtime modules configuration netutils iso_lang
166 C_OBJ
:= $(INTERFACE
:%=src
/interface
/%.o
) \
167 $(INPUT
:%=src
/input
/%.o
) \
168 $(VIDEO_OUTPUT
:%=src
/video_output
/%.o
) \
169 $(AUDIO_OUTPUT
:%=src
/audio_output
/%.o
) \
170 $(MISC
:%=src
/misc
/%.o
)
175 ifeq ($(NEED_GETOPT
),1)
176 C_OBJ
+= extras
/GNUgetopt
/getopt.o extras
/GNUgetopt
/getopt1.o
179 ifeq ($(NEED_SYMBOLS
),1)
180 C_OBJ
+= src
/misc
/symbols.o
184 CPP_OBJ
:= src
/misc
/beos_specific.o
187 ifneq (,$(findstring darwin
,$(SYS
)))
188 C_OBJ
+= src
/misc
/darwin_specific.o
191 ifneq (,$(findstring mingw32
,$(SYS
)))
192 C_OBJ
+= src
/misc
/win32_specific.o
193 RESOURCE_OBJ
:= share
/vlc_win32_rc.o
196 VLC_OBJ
:= $(C_OBJ
) $(CPP_OBJ
) $(M_OBJ
) $(BUILTIN_OBJ
) $(RESOURCE_OBJ
)
201 H_OBJ
:= src
/misc
/modules_builtin.h
204 # Other lists of files
206 C_DEP
:= $(C_OBJ
:%.o
=.dep
/%.d
)
207 CPP_DEP
:= $(CPP_OBJ
:%.o
=.dep
/%.dpp
)
210 # Translate plugin names
213 PLUGIN_OBJ
:= $(shell for i in
$(PLUGINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.so@' -e
's@^ .*@@' ; done
)
216 BUILTIN_OBJ
:= $(shell for i in
$(BUILTINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.a@' -e
's@^ .*@@' ; done
)
222 VERSION
:= $(shell grep
'^ *VERSION=' configure.in | head
-1 | sed
's/"//g' | cut
-f2
-d
=)
224 # All symbols must be exported
227 ###############################################################################
229 ###############################################################################
234 all: Makefile.opts vlc
${ALIASES} vlc.app plugins po
237 @echo
"**** No configuration found, please run ./configure"
240 # $(MAKE) $(MAKECMDGOALS)
245 @echo CFLAGS
: $(CFLAGS
)
246 @echo LDFLAGS
: $(LDFLAGS
)
247 @echo plugins_CFLAGS
: $(plugins_CFLAGS
)
248 @echo plugins_LDFLAGS
: $(plugins_LDFLAGS
)
249 @echo builtins_CFLAGS
: $(builtins_CFLAGS
)
250 @echo builtins_LDFLAGS
: $(builtins_LDFLAGS
)
251 @echo C_OBJ
: $(C_OBJ
)
252 @echo CPP_OBJ
: $(CPP_OBJ
)
253 @echo PLUGIN_OBJ
: $(PLUGIN_OBJ
)
254 @echo BUILTIN_OBJ
: $(BUILTIN_OBJ
)
259 clean: plugins-clean po-clean vlc-clean
260 rm -f src
/*/*.o extras
/*/*.o
261 rm -f lib
/*.so
* lib
/*.a
262 rm -f plugins
/*.so plugins
/*.a plugins
/*.lib plugins
/*.tds
263 rm -rf extras
/MacOSX
/build
266 -cd po
&& $(MAKE
) clean
269 for
dir in
$(PLUGINS_DIR
) ; do \
270 ( cd plugins
/$${dir} \
271 && $(MAKE
) -f ..
/..
/Makefile.modules
clean ) ; done
272 rm -f plugins
/*/*.o plugins
/*/*.lo plugins
/*/*.moc plugins
/*/*.bak
275 rm -f
$(C_OBJ
) $(CPP_OBJ
)
276 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
280 -cd po
&& $(MAKE
) maintainer-clean
281 rm -f
**/*.o
**/*~
*.log
283 rm -f
include/defs.h
include/modules_builtin.h
284 rm -f src
/misc
/modules_builtin.h
285 rm -f config
*status config
*cache config
*log conftest
*
286 rm -f gmon.out core build-stamp
291 # Install/uninstall rules
293 install: vlc-install plugins-install po-install
295 uninstall: vlc-uninstall plugins-uninstall po-uninstall
298 mkdir
-p
$(DESTDIR
)$(bindir)
299 $(INSTALL
) vlc
$(DESTDIR
)$(bindir)
301 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias && ln
-s vlc
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
303 mkdir
-p
$(DESTDIR
)$(datadir)/videolan
304 $(INSTALL
) -m
644 share
/*.psf
$(DESTDIR
)$(datadir)/videolan
305 $(INSTALL
) -m
644 share
/*.png
$(DESTDIR
)$(datadir)/videolan
306 $(INSTALL
) -m
644 share
/*.xpm
$(DESTDIR
)$(datadir)/videolan
309 rm -f
$(DESTDIR
)$(bindir)/vlc
311 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
313 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.psf
314 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.png
315 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.xpm
318 mkdir
-p
$(DESTDIR
)$(libdir)/videolan
/vlc
320 $(INSTALL
) -m
644 $(PLUGINS
:%=plugins
/%.so
) $(DESTDIR
)$(libdir)/videolan
/vlc
324 rm -f
$(DESTDIR
)$(libdir)/videolan
/vlc
/*.so
327 -cd po
&& $(MAKE
) install
330 -cd po
&& $(MAKE
) uninstall
333 # Package generation rules
336 # Check that tmp isn't in the way
337 @if
test -e tmp
; then \
338 echo
"Error: please remove ./tmp, it is in the way"; false
; \
340 echo
"OK."; mkdir tmp
; \
342 # Copy directory structure in tmp
343 find
-type d | grep
-v
'\(\.dep\|snapshot\|CVS\)' | while read i
; \
344 do mkdir
-p tmp
/vlc
/$$i ; \
347 find debian
-mindepth
1 -maxdepth
1 -type d | \
348 while read i
; do
rm -Rf tmp
/vlc
/$$i ; done
349 # Copy .c .h .in .cpp .m and .glade files
350 find
include src plugins
-type f
-name
'*.[bcdhigmrst]*' | while read i
; \
351 do cp
$$i tmp
/vlc
/$$i ; done
352 # Grmbl... special case...
353 for i in API BUGS DESIGN TODO
; \
354 do cp plugins
/mad
/$$i tmp
/vlc
/plugins
/mad
; done
355 # Copy plugin Makefiles
356 find plugins
-type f
-name Makefile | while read i
; \
357 do cp
$$i tmp
/vlc
/$$i ; done
358 # Copy extra programs and documentation
359 cp
-a extras
/* tmp
/vlc
/extras
360 cp
-a doc
/* tmp
/vlc
/doc
361 find tmp
/vlc
/extras tmp
/vlc
/doc \
362 -type d
-name CVS
-o
-name
'.*' -o
-name
'*.[o]' | \
363 while read i
; do
rm -Rf
$$i ; done
365 cp po
/ChangeLog po
/vlc.pot po
/*.po tmp
/vlc
/po
366 for i in Makefile.in.in POTFILES.in
; do cp po
/$$i tmp
/vlc
/po
; done
368 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog
* README
* INSTALL
* \
369 ABOUT-NLS BUGS MODULES vlc.spec \
370 Makefile Makefile.
*.in Makefile.dep Makefile.modules \
371 configure configure.in install-sh install-win32 macosx-dmg \
372 config.sub config.guess aclocal.m4 mkinstalldirs \
374 # Copy Debian control files
375 for file in debian
/*dirs debian
/*docs debian
/*menu debian
/*desktop \
376 debian
/*copyright
; do cp
$$file tmp
/vlc
/debian
; done
377 for file in control changelog rules
; do \
378 cp debian
/$$file tmp
/vlc
/debian
/ ; done
379 # Copy ipkg control files
380 for file in control rules patch
; do \
381 cp ipkg
/$$file tmp
/vlc
/ipkg
/ ; done
382 # Copy fonts and icons
383 for file in share
/*vlc
* share
/*psf
; do \
384 cp
$$file tmp
/vlc
/share
; done
387 mv tmp
/vlc tmp
/$$F; (cd tmp
; tar czf ..
/$$F.
tar.gz
$$F); \
392 # XXX: this rule is probably only useful to you if you have exactly
393 # the same setup as me. Contact sam@zoy.org if you need to use it.
395 # Check that tmp isn't in the way
396 @if
test -e tmp
; then \
397 echo
"Error: please remove ./tmp, it is in the way"; false
; \
399 echo
"OK."; mkdir tmp
; \
401 # Create installation script
402 cp install-win32 tmp
/nsi
403 # Copy relevant files
406 cp INSTALL.win32 tmp
/INSTALL.txt
; unix2dos tmp
/INSTALL.txt
407 for file in AUTHORS COPYING ChangeLog README FAQ TODO
; \
408 do cp
$$file tmp
/$${file}.txt
; \
409 unix2dos tmp
/$${file}.txt
; done
411 cp
$(PLUGINS
:%=plugins
/%.so
) tmp
/plugins
/
412 # don't include these two
413 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
415 for i in
$(PLUGINS
) ; do if
test $$i != intfwin
; then
$(STRIP
) tmp
/plugins
/$$i.so
; fi
; done
418 for file in default8x16.psf default8x9.psf
; \
419 do cp share
/$$file tmp
/share
/ ; done
421 wine ~
/.wine
/fake_windows
/Program\ Files
/NSIS
/makensis.exe
-- /DVERSION
=${VERSION} /CD tmp
/nsi
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
; \
434 mkdir
-p tmp
/vlc
/share
435 # Copy relevant files
438 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp
/vlc
/
439 for file in default8x16.psf default8x9.psf
; \
440 do cp share
/$$file tmp
/vlc
/share
/ ; done
441 mkdir tmp
/vlc
/plugins
442 cp
$(PLUGINS
:%=plugins
/%.so
) tmp
/vlc
/plugins
/
443 strip $(PLUGINS
:%=tmp
/vlc
/plugins
/%.so
)
445 mv tmp
/vlc tmp
/vlc-
${VERSION}
446 (cd tmp
; find vlc-
${VERSION} | \
447 zip
-9 -@ vlc-
${VERSION}-BeOS-x86.zip
)
448 mv tmp
/vlc-
${VERSION}-BeOS-x86.zip .
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
; \
460 # Copy relevant files
462 cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf FAQ TODO tmp
/
465 .
/macosx-dmg
0 "vlc-${VERSION}" tmp
/*
471 # Gtk/Gnome/* aliases and OS X application
473 gnome-vlc gvlc kvlc qvlc
: vlc
474 rm -f
$@
&& ln
-s vlc
$@
478 ifneq (,$(findstring darwin
,$(SYS
)))
480 cd extras
/MacOSX
; pbxbuild | grep
-v
'^ ' | grep
-v
'^\t' | grep
-v
"^$$"
481 cp
-r extras
/MacOSX
/build
/vlc.bundle .
/vlc.app
482 $(INSTALL
) -d vlc.app
/Contents
/MacOS
/share
483 $(INSTALL
) -d vlc.app
/Contents
/MacOS
/plugins
484 $(INSTALL
) vlc vlc.app
/Contents
/MacOS
/
486 $(INSTALL
) $(PLUGINS
:%=plugins
/%.so
) vlc.app
/Contents
/MacOS
/plugins
488 $(INSTALL
) -m
644 share
/*.psf vlc.app
/Contents
/MacOS
/share
494 # Generic rules (see below)
496 $(H_OBJ
): Makefile.opts Makefile.dep Makefile
497 # @echo "regenerating $@"
498 @
rm -f
$@
&& cp
$@.in
$@
500 @for i in
$(BUILTINS
) ; do \
501 echo
"int InitModule__MODULE_"$$i"( module_t* );" >>$@
; \
502 echo
"int ActivateModule__MODULE_"$$i"( module_t* );" >>$@
; \
503 echo
"int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@
; \
507 @echo
"#define ALLOCATE_ALL_BUILTINS() \\" >> $@
;
508 @echo
" do \\" >> $@
;
509 @echo
" { \\" >> $@
;
511 @for i in
$(BUILTINS
) ; do \
512 echo
" ALLOCATE_BUILTIN("$$i"); \\" >> $@
; \
515 @echo
" } while( 0 );" >> $@
;
519 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
521 $(CPP_DEP
): %.dpp
: FORCE
522 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
524 $(C_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
525 $(C_OBJ
): %.o
: $(H_OBJ
)
526 $(C_OBJ
): %.o
: .dep
/%.d
528 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
530 $(CPP_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
531 $(CPP_OBJ
): %.o
: $(H_OBJ
)
532 $(CPP_OBJ
): %.o
: .dep
/%.dpp
533 $(CPP_OBJ
): %.o
: %.
cpp
534 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
536 $(M_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
537 $(M_OBJ
): %.o
: $(H_OBJ
)
538 $(M_OBJ
): %.o
: .dep
/%.dm
540 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
542 $(RESOURCE_OBJ
): %.o
: Makefile.dep Makefile
543 ifneq (,(findstring mingw32
,$(SYS
)))
544 $(RESOURCE_OBJ
): %.o
: %.rc
545 $(WINDRES
) -i
$< -o
$@
549 # Main application target
551 vlc
: Makefile.opts Makefile.dep Makefile
$(VLC_OBJ
) $(BUILTIN_OBJ
)
552 $(CC
) $(CFLAGS
) -o
$@
$(VLC_OBJ
) $(BUILTIN_OBJ
) $(LDFLAGS
) $(vlc_LDFLAGS
) $(builtins_LDFLAGS
)
554 xres
-o
$@ .
/share
/vlc_beos.rsrc
561 plugins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(PLUGIN_OBJ
)
563 @cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:plugins
/%.so
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) -f ..
/..
/Makefile.modules
$(@
:plugins
/%=..
/%)
566 # Built-in modules target
568 builtins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(BUILTIN_OBJ
)
569 $(BUILTIN_OBJ
): FORCE
570 @cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:plugins
/%.a
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) -f ..
/..
/Makefile.modules
$(@
:plugins
/%=..
/%)