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
65 PLUGINS_TARGETS
:= a52
/a52 \
76 chroma
/chroma_i420_rgb \
77 chroma
/chroma_i420_rgb_mmx \
78 chroma
/chroma_i420_yuy2 \
79 chroma
/chroma_i420_yuy2_mmx \
80 chroma
/chroma_i422_yuy2 \
81 chroma
/chroma_i422_yuy2_mmx \
82 chroma
/chroma_i420_ymga \
83 chroma
/chroma_i420_ymga_mmx \
96 filter/filter_deinterlace \
97 filter/filter_transform \
98 filter/filter_invert \
99 filter/filter_distort \
116 lpcm_adec
/lpcm_adec \
121 memcpy
/memcpymmxext \
123 memcpy
/memcpyaltivec \
128 motion
/motionmmxext \
130 motion
/motionaltivec \
131 mpeg_system
/mpeg_es \
132 mpeg_system
/mpeg_ps \
133 mpeg_system
/mpeg_ts \
134 mpeg_system
/mpeg_ts_dvbpsi \
135 mpeg_adec
/mpeg_adec \
136 mpeg_vdec
/mpeg_vdec \
142 satellite
/satellite \
157 INTERFACE
:= main interface intf_msg intf_playlist intf_eject
158 INPUT
:= input input_ext-plugins input_ext-dec input_ext-intf input_dec input_programs input_clock mpeg_system
159 VIDEO_OUTPUT
:= video_output video_text vout_pictures vout_subpictures
160 AUDIO_OUTPUT
:= audio_output aout_ext-dec aout_pcm aout_spdif
161 MISC
:= mtime modules configuration netutils iso_lang
163 C_OBJ
:= $(INTERFACE
:%=src
/interface
/%.o
) \
164 $(INPUT
:%=src
/input
/%.o
) \
165 $(VIDEO_OUTPUT
:%=src
/video_output
/%.o
) \
166 $(AUDIO_OUTPUT
:%=src
/audio_output
/%.o
) \
167 $(MISC
:%=src
/misc
/%.o
)
172 ifeq ($(NEED_GETOPT
),1)
173 C_OBJ
+= extras
/GNUgetopt
/getopt.o extras
/GNUgetopt
/getopt1.o
176 ifeq ($(NEED_SYMBOLS
),1)
177 C_OBJ
+= src
/misc
/symbols.o
181 CPP_OBJ
:= src
/misc
/beos_specific.o
184 ifneq (,$(findstring darwin
,$(SYS
)))
185 C_OBJ
+= src
/misc
/darwin_specific.o
188 ifneq (,$(findstring mingw32
,$(SYS
)))
189 C_OBJ
+= src
/misc
/win32_specific.o
190 RESOURCE_OBJ
:= share
/vlc_win32_rc.o
193 VLC_OBJ
:= $(C_OBJ
) $(CPP_OBJ
) $(BUILTIN_OBJ
) $(RESOURCE_OBJ
)
198 H_OBJ
:= src
/misc
/modules_builtin.h
201 # Other lists of files
203 C_DEP
:= $(C_OBJ
:%.o
=.dep
/%.d
)
204 CPP_DEP
:= $(CPP_OBJ
:%.o
=.dep
/%.dpp
)
207 # Translate plugin names
210 PLUGIN_OBJ
:= $(shell for i in
$(PLUGINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.so@' -e
's@^ .*@@' ; done
)
213 BUILTIN_OBJ
:= $(shell for i in
$(BUILTINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@plugins/\1.a@' -e
's@^ .*@@' ; done
)
219 VERSION
:= $(shell grep
'^ *VERSION=' configure.in | head
-1 | sed
's/"//g' | cut
-f2
-d
=)
221 # All symbols must be exported
224 ###############################################################################
226 ###############################################################################
231 all: Makefile.opts vlc
${ALIASES} vlc.app plugins po
234 @echo
"**** No configuration found, please run ./configure"
237 # $(MAKE) $(MAKECMDGOALS)
242 @echo CFLAGS
: $(CFLAGS
)
243 @echo LDFLAGS
: $(LDFLAGS
)
244 @echo plugins_CFLAGS
: $(plugins_CFLAGS
)
245 @echo plugins_LDFLAGS
: $(plugins_LDFLAGS
)
246 @echo builtins_CFLAGS
: $(builtins_CFLAGS
)
247 @echo builtins_LDFLAGS
: $(builtins_LDFLAGS
)
248 @echo C_OBJ
: $(C_OBJ
)
249 @echo CPP_OBJ
: $(CPP_OBJ
)
250 @echo PLUGIN_OBJ
: $(PLUGIN_OBJ
)
251 @echo BUILTIN_OBJ
: $(BUILTIN_OBJ
)
256 clean: plugins-clean po-clean vlc-clean
257 rm -f src
/*/*.o extras
/*/*.o
258 rm -f lib
/*.so
* lib
/*.a
259 rm -f plugins
/*.so plugins
/*.a plugins
/*.lib plugins
/*.tds
260 rm -rf extras
/MacOSX
/build
263 -cd po
&& $(MAKE
) clean
266 for
dir in
$(PLUGINS_DIR
) ; do \
267 ( cd plugins
/$${dir} \
268 && $(MAKE
) -f ..
/..
/Makefile.modules
clean ) ; done
269 rm -f plugins
/*/*.o plugins
/*/*.lo plugins
/*/*.moc plugins
/*/*.bak
272 rm -f
$(C_OBJ
) $(CPP_OBJ
)
273 rm -f vlc gnome-vlc gvlc kvlc qvlc vlc.exe
277 -cd po
&& $(MAKE
) maintainer-clean
278 rm -f
**/*.o
**/*~
*.log
280 rm -f
include/defs.h
include/modules_builtin.h
281 rm -f src
/misc
/modules_builtin.h
282 rm -f config
*status config
*cache config
*log conftest
*
283 rm -f gmon.out core build-stamp
288 # Install/uninstall rules
290 install: vlc-install plugins-install po-install
292 uninstall: vlc-uninstall plugins-uninstall po-uninstall
295 mkdir
-p
$(DESTDIR
)$(bindir)
296 $(INSTALL
) vlc
$(DESTDIR
)$(bindir)
298 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias && ln
-s vlc
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
300 mkdir
-p
$(DESTDIR
)$(datadir)/videolan
301 $(INSTALL
) -m
644 share
/*.psf
$(DESTDIR
)$(datadir)/videolan
302 $(INSTALL
) -m
644 share
/*.png
$(DESTDIR
)$(datadir)/videolan
303 $(INSTALL
) -m
644 share
/*.xpm
$(DESTDIR
)$(datadir)/videolan
306 rm -f
$(DESTDIR
)$(bindir)/vlc
308 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
310 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.psf
311 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.png
312 rm -f
$(DESTDIR
)$(datadir)/videolan
/*.xpm
315 mkdir
-p
$(DESTDIR
)$(libdir)/videolan
/vlc
317 $(INSTALL
) -m
644 $(PLUGINS
:%=plugins
/%.so
) $(DESTDIR
)$(libdir)/videolan
/vlc
321 rm -f
$(DESTDIR
)$(libdir)/videolan
/vlc
/*.so
324 -cd po
&& $(MAKE
) install
327 -cd po
&& $(MAKE
) uninstall
330 # Package generation rules
333 # Check that tmp isn't in the way
334 @if
test -e tmp
; then \
335 echo
"Error: please remove ./tmp, it is in the way"; false
; \
337 echo
"OK."; mkdir tmp
; \
339 # Copy directory structure in tmp
340 find
-type d | grep
-v
'\(\.dep\|snapshot\|CVS\)' | while read i
; \
341 do mkdir
-p tmp
/vlc
/$$i ; \
344 find debian
-mindepth
1 -maxdepth
1 -type d | \
345 while read i
; do
rm -Rf tmp
/vlc
/$$i ; done
346 # Copy .c .h .in .cpp and .glade files
347 find
include src plugins
-type f
-name
'*.[bcdhigrst]*' | while read i
; \
348 do cp
$$i tmp
/vlc
/$$i ; done
349 # Grmbl... special case...
350 for i in API BUGS DESIGN TODO
; \
351 do cp plugins
/mad
/$$i tmp
/vlc
/plugins
/mad
; done
352 # Copy plugin Makefiles
353 find plugins
-type f
-name Makefile | while read i
; \
354 do cp
$$i tmp
/vlc
/$$i ; done
355 # Copy extra programs and documentation
356 cp
-a extras
/* tmp
/vlc
/extras
357 cp
-a doc
/* tmp
/vlc
/doc
358 find tmp
/vlc
/extras tmp
/vlc
/doc \
359 -type d
-name CVS
-o
-name
'.*' -o
-name
'*.[o]' | \
360 while read i
; do
rm -Rf
$$i ; done
362 cp po
/ChangeLog po
/vlc.pot po
/*.po tmp
/vlc
/po
363 for i in Makefile.in.in POTFILES.in
; do cp po
/$$i tmp
/vlc
/po
; done
365 cp FAQ AUTHORS COPYING TODO todo.pl ChangeLog
* README
* INSTALL
* \
366 ABOUT-NLS BUGS MODULES vlc.spec \
367 Makefile Makefile.opts.in Makefile.dep Makefile.modules \
368 configure configure.in install-sh install-win32 macosx-dmg \
369 config.sub config.guess aclocal.m4 mkinstalldirs \
371 # Copy Debian control files
372 for file in debian
/*dirs debian
/*docs debian
/*menu debian
/*desktop \
373 debian
/*copyright
; do cp
$$file tmp
/vlc
/debian
; done
374 for file in control changelog rules
; do \
375 cp debian
/$$file tmp
/vlc
/debian
/ ; done
376 # Copy ipkg control files
377 for file in control rules patch
; do \
378 cp ipkg
/$$file tmp
/vlc
/ipkg
/ ; done
379 # Copy fonts and icons
380 for file in share
/*vlc
* share
/*psf
; do \
381 cp
$$file tmp
/vlc
/share
; done
384 mv tmp
/vlc tmp
/$$F; (cd tmp
; tar czf ..
/$$F.
tar.gz
$$F); \
389 # XXX: this rule is probably only useful to you if you have exactly
390 # the same setup as me. Contact sam@zoy.org if you need to use it.
392 # Check that tmp isn't in the way
393 @if
test -e tmp
; then \
394 echo
"Error: please remove ./tmp, it is in the way"; false
; \
396 echo
"OK."; mkdir tmp
; \
398 # Create installation script
399 cp install-win32 tmp
/nsi
400 # Copy relevant files
403 cp INSTALL.win32 tmp
/INSTALL.txt
; unix2dos tmp
/INSTALL.txt
404 for file in AUTHORS COPYING ChangeLog README FAQ TODO
; \
405 do cp
$$file tmp
/$${file}.txt
; \
406 unix2dos tmp
/$${file}.txt
; done
408 cp
$(PLUGINS
:%=plugins
/%.so
) tmp
/plugins
/
409 # don't include these two
410 #rm -f tmp/plugins/gtk.so tmp/plugins/sdl.so
412 for i in
$(PLUGINS
) ; do if
test $$i != intfwin
; then
$(STRIP
) tmp
/plugins
/$$i.so
; fi
; done
415 for file in default8x16.psf default8x9.psf
; \
416 do cp share
/$$file tmp
/share
/ ; done
418 wine ~
/.wine
/fake_windows
/Program\ Files
/NSIS
/makensis.exe
-- /DVERSION
=${VERSION} /CD tmp
/nsi
423 # Check that tmp isn't in the way
424 @if
test -e tmp
; then \
425 echo
"Error: please remove ./tmp, it is in the way"; false
; \
427 echo
"OK."; mkdir tmp
; \
431 mkdir
-p tmp
/vlc
/share
432 # Copy relevant files
435 cp AUTHORS COPYING ChangeLog README FAQ TODO tmp
/vlc
/
436 for file in default8x16.psf default8x9.psf
; \
437 do cp share
/$$file tmp
/vlc
/share
/ ; done
438 mkdir tmp
/vlc
/plugins
439 cp
$(PLUGINS
:%=plugins
/%.so
) tmp
/vlc
/plugins
/
440 strip $(PLUGINS
:%=tmp
/vlc
/plugins
/%.so
)
442 mv tmp
/vlc tmp
/vlc-
${VERSION}
443 (cd tmp
; find vlc-
${VERSION} | \
444 zip
-9 -@ vlc-
${VERSION}-BeOS-x86.zip
)
445 mv tmp
/vlc-
${VERSION}-BeOS-x86.zip .
450 # Check that tmp isn't in the way
451 @if
test -e tmp
; then \
452 echo
"Error: please remove ./tmp, it is in the way"; false
; \
454 echo
"OK."; mkdir tmp
; \
457 # Copy relevant files
459 cp AUTHORS COPYING ChangeLog README README\
-\ Mac\ OS\ X.rtf FAQ TODO tmp
/
462 .
/macosx-dmg
0 "vlc-${VERSION}" tmp
/*
468 # Gtk/Gnome/* aliases and OS X application
470 gnome-vlc gvlc kvlc qvlc
: vlc
471 rm -f
$@
&& ln
-s vlc
$@
475 ifneq (,$(findstring darwin
,$(SYS
)))
477 cd extras
/MacOSX
; pbxbuild | grep
-v
'^ ' | grep
-v
'^\t' | grep
-v
"^$$"
478 cp
-r extras
/MacOSX
/build
/vlc.bundle .
/vlc.app
479 $(INSTALL
) -d vlc.app
/Contents
/MacOS
/share
480 $(INSTALL
) -d vlc.app
/Contents
/MacOS
/plugins
481 $(INSTALL
) vlc vlc.app
/Contents
/MacOS
/
483 $(INSTALL
) $(PLUGINS
:%=plugins
/%.so
) vlc.app
/Contents
/MacOS
/plugins
485 $(INSTALL
) -m
644 share
/*.psf vlc.app
/Contents
/MacOS
/share
491 # Generic rules (see below)
493 $(H_OBJ
): Makefile.opts Makefile.dep Makefile
494 # @echo "regenerating $@"
495 @
rm -f
$@
&& cp
$@.in
$@
497 @for i in
$(BUILTINS
) ; do \
498 echo
"int InitModule__MODULE_"$$i"( module_t* );" >>$@
; \
499 echo
"int ActivateModule__MODULE_"$$i"( module_t* );" >>$@
; \
500 echo
"int DeactivateModule__MODULE_"$$i"( module_t* );" >>$@
; \
504 @echo
"#define ALLOCATE_ALL_BUILTINS() \\" >> $@
;
505 @echo
" do \\" >> $@
;
506 @echo
" { \\" >> $@
;
508 @for i in
$(BUILTINS
) ; do \
509 echo
" ALLOCATE_BUILTIN("$$i"); \\" >> $@
; \
512 @echo
" } while( 0 );" >> $@
;
516 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
518 $(CPP_DEP
): %.dpp
: FORCE
519 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
521 $(C_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
522 $(C_OBJ
): %.o
: $(H_OBJ
)
523 $(C_OBJ
): %.o
: .dep
/%.d
525 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
527 $(CPP_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
528 $(CPP_OBJ
): %.o
: $(H_OBJ
)
529 $(CPP_OBJ
): %.o
: .dep
/%.dpp
530 $(CPP_OBJ
): %.o
: %.
cpp
531 $(CC
) $(CFLAGS
) $(vlc_CFLAGS
) -c
-o
$@
$<
533 $(RESOURCE_OBJ
): %.o
: Makefile.dep Makefile
534 ifneq (,(findstring mingw32
,$(SYS
)))
535 $(RESOURCE_OBJ
): %.o
: %.rc
536 $(WINDRES
) -i
$< -o
$@
540 # Main application target
542 vlc
: Makefile.opts Makefile.dep Makefile
$(VLC_OBJ
) $(BUILTIN_OBJ
)
543 $(CC
) $(CFLAGS
) -o
$@
$(VLC_OBJ
) $(BUILTIN_OBJ
) $(LDFLAGS
) $(vlc_LDFLAGS
) $(builtins_LDFLAGS
)
545 xres
-o
$@ .
/share
/vlc_beos.rsrc
552 plugins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(PLUGIN_OBJ
)
554 @cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:plugins
/%.so
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) -f ..
/..
/Makefile.modules
$(@
:plugins
/%=..
/%)
557 # Built-in modules target
559 builtins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(BUILTIN_OBJ
)
560 $(BUILTIN_OBJ
): FORCE
561 @cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:plugins
/%.a
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) -f ..
/..
/Makefile.modules
$(@
:plugins
/%=..
/%)