1 ###############################################################################
2 # vlc (VideoLAN Client) main Makefile - (c)1998 VideoLAN
3 ###############################################################################
7 ###############################################################################
9 ###############################################################################
12 # All possible plugin directories, needed for make clean
14 PLUGINS_DIR
:= alsa beos darwin directx dsp dummy dvd esd fb ggi glide gtk downmix idct imdct macosx mga motion mpeg qt sdl text x11 yuv
17 # All possible plugin objects
19 PLUGINS_TARGETS
:= alsa
/alsa beos
/beos darwin
/darwin directx
/directx dsp
/dsp dummy
/dummy dummy
/null dvd
/dvd esd
/esd fb
/fb ggi
/ggi glide
/glide gtk
/gnome gtk
/gtk downmix
/downmix downmix
/downmixsse downmix
/downmix3dn idct
/idct idct
/idctclassic idct
/idctmmx idct
/idctmmxext imdct
/imdct imdct
/imdct3dn imdct
/imdctsse macosx
/macosx mga
/mga motion
/motion motion
/motionmmx motion
/motionmmxext mpeg
/es mpeg
/ps mpeg
/ts qt
/qt sdl
/sdl text
/ncurses text
/rc x11
/x11 x11
/xvideo yuv
/yuv yuv
/yuvmmx
24 INTERFACE
:= main interface intf_msg intf_playlist intf_channels
25 INPUT
:= input input_ext-dec input_ext-intf input_dec input_programs input_netlist input_clock mpeg_system
26 VIDEO_OUTPUT
:= video_output video_text video_spu video_yuv
27 AUDIO_OUTPUT
:= audio_output aout_ext-dec aout_u8 aout_s8 aout_u16 aout_s16 aout_spdif
28 AC3_DECODER
:= ac3_decoder_thread ac3_decoder ac3_parse ac3_exponent ac3_bit_allocate ac3_mantissa ac3_rematrix ac3_imdct
29 AC3_SPDIF
:= ac3_spdif ac3_iec958
30 LPCM_DECODER
:= lpcm_decoder_thread
31 AUDIO_DECODER
:= audio_decoder adec_generic adec_layer1 adec_layer2 adec_math
32 SPU_DECODER
:= spu_decoder
33 #GEN_DECODER := generic_decoder
34 VIDEO_PARSER
:= video_parser vpar_headers vpar_blocks vpar_synchro video_fifo
35 VIDEO_DECODER
:= video_decoder
36 MISC
:= mtime tests modules netutils
38 C_OBJ
:= $(INTERFACE
:%=src
/interface
/%.o
) \
39 $(INPUT
:%=src
/input
/%.o
) \
40 $(VIDEO_OUTPUT
:%=src
/video_output
/%.o
) \
41 $(AUDIO_OUTPUT
:%=src
/audio_output
/%.o
) \
42 $(AC3_DECODER
:%=src
/ac3_decoder
/%.o
) \
43 $(AC3_SPDIF
:%=src
/ac3_spdif
/%.o
) \
44 $(LPCM_DECODER
:%=src
/lpcm_decoder
/%.o
) \
45 $(AUDIO_DECODER
:%=src
/audio_decoder
/%.o
) \
46 $(SPU_DECODER
:%=src
/spu_decoder
/%.o
) \
47 $(GEN_DECODER
:%=src
/generic_decoder
/%.o
) \
48 $(VIDEO_PARSER
:%=src
/video_parser
/%.o
) \
49 $(VIDEO_DECODER
:%=src
/video_decoder
/%.o
) \
50 $(MISC
:%=src
/misc
/%.o
)
56 C_OBJ
+= extras
/GNUgetopt
/getopt.o extras
/GNUgetopt
/getopt1.o
60 CPP_OBJ
:= src
/misc
/beos_specific.o
63 ifneq (,$(findstring darwin
,$(SYS
)))
64 C_OBJ
+= src
/misc
/darwin_specific.o
67 ifneq (,$(findstring mingw32
,$(SYS
)))
68 RESOURCE_OBJ
:= share
/vlc_win32_rc.o
74 H_OBJ
:= src
/misc
/modules_builtin.h
77 # Other lists of files
79 C_DEP
:= $(C_OBJ
:%.o
=.dep
/%.d
)
80 CPP_DEP
:= $(CPP_OBJ
:%.o
=.dep
/%.dpp
)
83 # Translate plugin names
86 PLUGIN_OBJ
:= $(shell for i in
$(PLUGINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@lib/\1.so@' -e
's@^ .*@@' ; done
)
89 BUILTIN_OBJ
:= $(shell for i in
$(BUILTINS
) ; do echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.*/\('$$i'\) .*@lib/\1.a@' -e
's@^ .*@@' ; done
)
92 # All symbols must be exported
95 ###############################################################################
97 ###############################################################################
102 all: vlc
${ALIASES} plugins vlc.app
104 clean: libdvdcss-clean plugins-clean vlc-clean
105 rm -f src
/*/*.o extras
/*/*.o
106 rm -f lib
/*.so lib
/*.so.
* lib
/*.a
109 cd extras
/libdvdcss
&& $(MAKE
) clean
112 for
dir in
$(PLUGINS_DIR
) ; do \
113 ( cd plugins
/$${dir} && $(MAKE
) clean ) ; done
114 rm -f plugins
/*/*.o plugins
/*/*.moc plugins
/*/*.bak
117 rm -f
$(C_OBJ
) $(CPP_OBJ
)
118 rm -f vlc gnome-vlc gvlc kvlc qvlc
122 rm -f
**/*.o
**/*~
*.log
124 rm -f
include/defs.h
include/config.h
include/modules_builtin.h
125 rm -f src
/misc
/modules_builtin.h
126 rm -f config
*status config
*cache config
*log
127 rm -f gmon.out core build-stamp
131 install: libdvdcss-install vlc-install plugins-install
134 mkdir
-p
$(DESTDIR
)$(bindir)
135 $(INSTALL
) vlc
$(DESTDIR
)$(bindir)
137 for alias in
$(ALIASES
) ; do if
test $$alias ; then
rm -f
$(DESTDIR
)$(bindir)/$$alias && ln
-s vlc
$(DESTDIR
)$(bindir)/$$alias ; fi
; done
139 mkdir
-p
$(DESTDIR
)$(datadir)/videolan
140 $(INSTALL
) -m
644 share
/*.psf
$(DESTDIR
)$(datadir)/videolan
141 $(INSTALL
) -m
644 share
/*.png
$(DESTDIR
)$(datadir)/videolan
142 $(INSTALL
) -m
644 share
/*.xpm
$(DESTDIR
)$(datadir)/videolan
145 mkdir
-p
$(DESTDIR
)$(libdir)/videolan
/vlc
147 $(INSTALL
) -m
644 $(PLUGINS
:%=lib
/%.so
) $(DESTDIR
)$(libdir)/videolan
/vlc
151 cd extras
/libdvdcss
&& $(MAKE
) install
155 @echo CFLAGS
: $(CFLAGS
)
156 @echo DCFLAGS
: $(DCFLAGS
)
157 @echo LCFLAGS
: $(LCFLAGS
)
158 @echo C_OBJ
: $(C_OBJ
)
159 @echo CPP_OBJ
: $(CPP_OBJ
)
160 @echo objects
: $(objects
)
161 @echo cppobjects
: $(cppobjects
)
162 @echo PLUGIN_OBJ
: $(PLUGIN_OBJ
)
163 @echo BUILTIN_OBJ
: $(BUILTIN_OBJ
)
166 # ugliest of all, but I have no time to do it -- sam
167 snapshot
: clean Makefile.opts
168 rm -Rf
/tmp
/vlc-
${PROGRAM_VERSION}* /tmp
/vlc-
${PROGRAM_VERSION}nocss
*
169 # copy archive in /tmp
170 find
-type d | grep
-v CVS | grep
-v
'\.dep' | while read i
; \
171 do mkdir
-p
/tmp
/vlc-
${PROGRAM_VERSION}/$$i ; \
173 find debian
-mindepth
1 -maxdepth
1 -type d | \
174 while read i
; do
rm -Rf
/tmp
/vlc-
${PROGRAM_VERSION}/$$i ; done
175 # .c .h .in .cpp .glade
176 find
include src plugins
-type f
-name
'*.[chig]*' | while read i
; \
177 do cp
$$i /tmp
/vlc-
${PROGRAM_VERSION}/$$i ; done
179 find . plugins
-type f
-name Makefile | while read i
; \
180 do cp
$$i /tmp
/vlc-
${PROGRAM_VERSION}/$$i ; done
182 cp
-a extras
/* /tmp
/vlc-
${PROGRAM_VERSION}/extras
183 cp
-a doc
/* /tmp
/vlc-
${PROGRAM_VERSION}/doc
184 find
/tmp
/vlc-
${PROGRAM_VERSION}/extras \
185 /tmp
/vlc-
${PROGRAM_VERSION}/doc \
186 -type d
-name CVS | while read i
; \
190 cp vlc.spec AUTHORS COPYING ChangeLog INSTALL INSTALL.libdvdcss \
191 README TODO todo.pl \
192 Makefile.opts.in Makefile.dep Makefile.modules \
193 configure configure.in install-sh config.sub config.guess \
194 /tmp
/vlc-
${PROGRAM_VERSION}/
195 for file in control control-css vlc-gtk.menu vlc.copyright vlc.docs \
196 changelog changelog-css rules rules-css vlc.dirs vlc.desktop \
197 gvlc.desktop gnome-vlc.desktop vlc.menu
; do \
198 cp debian
/$$file /tmp
/vlc-
${PROGRAM_VERSION}/debian
/ ; \
200 for file in default8x16.psf default8x9.psf vlc_beos.rsrc vlc.icns
; do \
201 cp share
/$$file /tmp
/vlc-
${PROGRAM_VERSION}/share
/ ; done
202 for icon in vlc gvlc qvlc gnome-vlc kvlc
; do \
203 cp share
/$$icon.xpm share
/$$icon.png \
204 /tmp
/vlc-
${PROGRAM_VERSION}/share
/ ; done
206 # build css-enabled archives
207 (cd
/tmp
; tar cf vlc-
${PROGRAM_VERSION}.
tar vlc-
${PROGRAM_VERSION} ; \
208 bzip2
-f
-9 < vlc-
${PROGRAM_VERSION}.
tar \
209 > vlc-
${PROGRAM_VERSION}.
tar.bz2
; \
210 gzip
-f
-9 vlc-
${PROGRAM_VERSION}.
tar )
211 mv
/tmp
/vlc-
${PROGRAM_VERSION}.
tar.gz \
212 /tmp
/vlc-
${PROGRAM_VERSION}.
tar.bz2 ..
215 rm -Rf
/tmp
/vlc-
${PROGRAM_VERSION}*
217 libdvdcss-snapshot
: clean Makefile.opts
218 rm -Rf
/tmp
/libdvdcss-
${LIBDVDCSS_VERSION}* \
219 /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}nocss
*
220 # copy archive in /tmp
221 find
include extras doc lib
-type d | grep
-v CVS | grep
-v
'\.dep' | \
223 mkdir
-p
/tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/$$i ; \
225 # .c .h .in .cpp .glade
226 find
include extras
-type f
-name
'*.[chig]*' | while read i
; \
227 do cp
$$i /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/$$i ; done
229 sed
-e
's#^install:#install-unused:#' \
230 -e
's#^clean:#clean-unused:#' \
231 -e
's#^all:.*#all: libdvdcss#' \
232 -e
's#^libdvdcss-install:#install:#' \
233 -e
's#^libdvdcss-clean:#clean:#' \
234 < Makefile
> /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/Makefile
236 cp
-a extras
/* /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/extras
237 cp
-a doc
/* /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/doc
238 find
/tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/extras \
239 /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/doc \
240 -type d
-name CVS | while read i
; \
244 cp AUTHORS COPYING ChangeLog INSTALL INSTALL.libdvdcss README \
245 TODO todo.pl Makefile.opts.in Makefile.dep Makefile.modules \
246 configure configure.in install-sh config.sub config.guess \
247 /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}/
249 # build css-enabled archives
250 (cd
/tmp
; tar cf libdvdcss-
${LIBDVDCSS_VERSION}.
tar \
251 libdvdcss-
${LIBDVDCSS_VERSION} ; \
252 bzip2
-f
-9 < libdvdcss-
${LIBDVDCSS_VERSION}.
tar \
253 > libdvdcss-
${LIBDVDCSS_VERSION}.
tar.bz2
; \
254 gzip
-f
-9 libdvdcss-
${LIBDVDCSS_VERSION}.
tar )
255 mv
/tmp
/libdvdcss-
${LIBDVDCSS_VERSION}.
tar.gz \
256 /tmp
/libdvdcss-
${LIBDVDCSS_VERSION}.
tar.bz2 ..
259 rm -Rf
/tmp
/libdvdcss-
${LIBDVDCSS_VERSION}*
263 ifneq (,$(findstring darwin
,$(SYS
)))
265 mkdir
-p vlc.app
/Contents
/Resources
266 mkdir
-p vlc.app
/Contents
/MacOS
/lib
267 mkdir
-p vlc.app
/Contents
/MacOS
/share
268 $(INSTALL
) -m
644 extras
/MacOSX_app
/Contents
/Info.plist vlc.app
/Contents
/
269 $(INSTALL
) -m
644 extras
/MacOSX_app
/Contents
/PkgInfo vlc.app
/Contents
/
270 $(INSTALL
) vlc vlc.app
/Contents
/MacOS
/
271 $(INSTALL
) share
/vlc.icns vlc.app
/Contents
/Resources
/
273 $(INSTALL
) $(PLUGINS
:%=lib
/%.so
) vlc.app
/Contents
/MacOS
/lib
275 $(INSTALL
) -m
644 share
/*.psf vlc.app
/Contents
/MacOS
/share
281 # GTK/Gnome aliases - don't add too many aliases which could bloat
284 gnome-vlc gvlc kvlc qvlc
: vlc
285 rm -f
$@
&& ln
-s vlc
$@
288 # Generic rules (see below)
291 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
293 $(CPP_DEP
): %.dpp
: FORCE
294 @
$(MAKE
) -s
--no-print-directory
-f Makefile.dep
$@
296 $(H_OBJ
): Makefile.opts Makefile.dep Makefile
297 rm -f
$@
&& cp
$@.in
$@
299 for i in
$(BUILTINS
) ; do \
300 echo
"int module_"$$i"_InitModule( module_t* );" >> $@
; \
301 echo
"int module_"$$i"_ActivateModule( module_t* );" >> $@
; \
302 echo
"int module_"$$i"_DeactivateModule( module_t* );" >> $@
; \
307 printf
"#define ALLOCATE_ALL_BUILTINS() do { " >> $@
;
308 for i in
$(BUILTINS
) ; do \
309 printf
"ALLOCATE_BUILTIN("$$i"); " >> $@
; \
311 echo
"} while( 0 );" >> $@
;
315 $(C_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
316 $(C_OBJ
): %.o
: .dep
/%.d
318 $(CC
) $(CFLAGS
) -c
-o
$@
$<
320 $(CPP_OBJ
): %.o
: Makefile.opts Makefile.dep Makefile
321 $(CPP_OBJ
): %.o
: .dep
/%.dpp
322 $(CPP_OBJ
): %.o
: %.
cpp
323 $(CC
) $(CFLAGS
) -c
-o
$@
$<
325 $(RESOURCE_OBJ
): %.o
: Makefile.dep Makefile
326 ifneq (,(findstring mingw32
,$(SYS
)))
327 $(RESOURCE_OBJ
): %.o
: %.rc
328 $(WINDRES
) -i
$< -o
$@
332 # Main application target
334 vlc
: Makefile.opts Makefile.dep Makefile
$(H_OBJ
) $(C_OBJ
) $(CPP_OBJ
) $(BUILTIN_OBJ
) $(RESOURCE_OBJ
)
335 $(CC
) $(CFLAGS
) -o
$@
$(C_OBJ
) $(CPP_OBJ
) $(BUILTIN_OBJ
) $(RESOURCE_OBJ
) $(LCFLAGS
) $(LIB
)
337 xres
-o
$@ .
/share
/vlc_beos.rsrc
344 plugins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(PLUGIN_OBJ
)
346 cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:lib
/%.so
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) $(@
:%=..
/..
/%)
349 # Built-in modules target
351 builtins
: Makefile.modules Makefile.opts Makefile.dep Makefile
$(BUILTIN_OBJ
)
352 $(BUILTIN_OBJ
): FORCE
353 cd
$(shell echo
" "$(PLUGINS_TARGETS
)" " | sed
-e
's@.* \([^/]*/\)'$(@
:lib
/%.a
=%)' .*@plugins/\1@' -e
's@^ .*@@') && $(MAKE
) $(@
:%=..
/..
/%)
359 cd extras
/libdvdcss
&& $(MAKE
)