]> git.sesse.net Git - vlc/blob - Makefile.in
. On peut enfin fermer la fen�tre principale en cliquant sur le bouton
[vlc] / Makefile.in
1 ################################################################################
2 # vlc (VideoLAN Client) main makefile
3 # (c)1998 VideoLAN
4 ################################################################################
5 # This makefile is the main makefile for the VideoLAN client.
6 ################################################################################
7
8 ################################################################################
9 # Configuration
10 ################################################################################
11
12 # Debugging mode on or off (set to 1 to activate)
13 DEBUG=0
14
15 SYS=@SYS@
16 ARCH=@ARCH@
17 AOUT=@AOUT@
18 VOUT=@VOUT@
19 INTF=@VOUT@
20 SNAPSHOTDIR=vlc-@VLC_VERSION@
21 INSTALL=@INSTALL@
22 prefix=@prefix@
23
24 #----------------- do not change anything below this line ----------------------
25
26 ################################################################################
27 # Configuration pre-processing
28 ################################################################################
29
30 # PROGRAM_OPTIONS is an identification string of the compilation options
31 PROGRAM_OPTIONS = $(SYS) $(ARCH)
32 ifeq ($(DEBUG),1)
33 PROGRAM_OPTIONS += DEBUG
34 DEFINE += -DDEBUG
35 endif
36
37 # PROGRAM_BUILD is a complete identification of the build
38 # ( we can't use fancy options with date since OSes like Solaris
39 # or FreeBSD have strange date implementations )
40 PROGRAM_BUILD = `date` $(USER)
41 # XXX: beos does not support hostname
42 #PROGRAM_BUILD = `date` $(USER)@`hostname`
43
44 # DEFINE will contain some of the constants definitions decided in Makefile, 
45 # including SYS_xx. It will be passed to C compiler.
46 DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z A-Z)
47 DEFINE += -DPLUGIN_PATH="\"$(prefix)/lib/videolan/vlc\""
48 DEFINE += -DDATA_PATH="\"$(prefix)/share/videolan/vlc\""
49
50 ################################################################################
51 # Tuning and other variables - do not change anything except if you know
52 # exactly what you are doing
53 ################################################################################
54
55 #
56 # C headers directories
57 #
58 INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
59
60 #
61 # Libraries
62 #
63
64 ifeq ($(SYS),gnu)
65 LIB += -lthreads -ldl
66 endif
67
68 ifneq (,$(findstring bsd,$(SYS)))
69 LIB += -pthread -lgnugetopt
70 LIB += -L/usr/local/lib
71 endif
72
73 ifneq (,$(findstring linux,$(SYS)))
74 LIB += -lpthread -ldl
75 endif
76
77 ifeq ($(SYS),beos)
78 LIB += -lbe -lroot -lgame
79 else
80 LIB += -lm
81 endif
82
83 #
84 # C compiler flags: compilation
85 #
86 CCFLAGS += $(DEFINE) $(INCLUDE)
87 CCFLAGS += -Wall
88 CCFLAGS += -D_REENTRANT
89 CCFLAGS += -D_GNU_SOURCE
90
91 # flags needed for clean beos compilation
92 CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
93
94 # Optimizations : don't compile debug versions with them
95 ifeq ($(DEBUG),0)
96 CCFLAGS += -O6
97 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
98 CCFLAGS += -fomit-frame-pointer
99
100 # Optimizations for x86 familiy
101 ifneq (,$(findstring 86,$(ARCH)))
102 CCFLAGS += -malign-double
103 #CCFLAGS += -march=pentium
104 # Eventual Pentium Pro optimizations
105 ifneq (,$(findstring pentiumpro,$(ARCH)))
106 ifneq ($(SYS), BSD)
107 CCFLAGS += -march=pentiumpro
108 endif
109 endif
110 # Eventual MMX optimizations for x86
111 ifneq (,$(findstring mmx,$(ARCH)))
112 CFLAGS += -DHAVE_MMX
113 endif
114 endif
115
116 # Optimizations for PowerPC
117 ifneq (,$(findstring ppc,$(ARCH)))
118 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
119 endif
120
121 # Optimizations for Sparc
122 ifneq (,$(findstring sparc,$(ARCH)))
123 CCFLAGS += -mhard-float
124 endif
125
126 # End of optimizations
127 endif
128
129 #
130 # C compiler flags: dependancies
131 #
132 DCFLAGS += $(INCLUDE)
133 DCFLAGS += -MM
134
135 #
136 # C compiler flags: linking
137 #
138 LCFLAGS += $(LIB)
139 LCFLAGS += -Wall
140 #LCFLAGS += -s
141
142 #
143 # Additionnal debugging flags
144 #
145
146 # Debugging and profiling support
147 ifneq ($(DEBUG),0)
148 CFLAGS += -pg
149 endif
150
151 #################################################################################
152 # Objects and files
153 #################################################################################
154
155 #
156 # C Objects
157
158 interface_obj =                 interface/main.o \
159                                                 interface/interface.o \
160                                                 interface/intf_msg.o \
161                                                 interface/intf_cmd.o \
162                                                 interface/intf_ctrl.o \
163                                                 interface/intf_console.o
164
165 input_obj =                     input/input_vlan.o \
166                                                 input/input_file.o \
167                                                 input/input_netlist.o \
168                                                 input/input_network.o \
169                                                 input/input_ctrl.o \
170                                                 input/input_pcr.o \
171                                                 input/input_psi.o \
172                                                 input/input.o
173
174 audio_output_obj =              audio_output/audio_output.o
175
176 video_output_obj =              video_output/video_output.o \
177                                                 video_output/video_text.o \
178                                                 video_output/video_spu.o \
179                                                 video_output/video_yuv.o
180
181 ac3_decoder_obj =               ac3_decoder/ac3_decoder_thread.o \
182                                                 ac3_decoder/ac3_decoder.o \
183                                                 ac3_decoder/ac3_parse.o \
184                                                 ac3_decoder/ac3_exponent.o \
185                                                 ac3_decoder/ac3_bit_allocate.o \
186                                                 ac3_decoder/ac3_mantissa.o \
187                                                 ac3_decoder/ac3_rematrix.o \
188                                                 ac3_decoder/ac3_imdct.o \
189                                                 ac3_decoder/ac3_downmix.o
190                                                 
191 lpcm_decoder_obj =              lpcm_decoder/lpcm_decoder_thread.o \
192                                                 lpcm_decoder/lpcm_decoder.o
193
194 audio_decoder_obj =             audio_decoder/audio_decoder_thread.o \
195                                                 audio_decoder/audio_decoder.o \
196                                                 audio_decoder/audio_math.o
197
198 spu_decoder_obj =               spu_decoder/spu_decoder.o
199
200 #??generic_decoder_obj =                generic_decoder/generic_decoder.o
201 # remeber to add it to OBJ 
202
203 video_parser_obj =              video_parser/video_parser.o \
204                                                 video_parser/vpar_headers.o \
205                                                 video_parser/vpar_blocks.o \
206                                                 video_parser/vpar_synchro.o \
207                                                 video_parser/video_fifo.o
208
209 video_decoder_obj =             video_decoder/video_decoder.o \
210                                                 video_decoder/vdec_motion.o \
211                                                 video_decoder/vdec_motion_inner.o \
212                                                 video_decoder/vdec_idct.o
213
214 misc_obj =                      misc/mtime.o \
215                                                 misc/rsc_files.o \
216                                                 misc/netutils.o \
217                                                 misc/plugins.o \
218                                                 misc/decoder_fifo.o
219
220
221 C_OBJ = $(interface_obj) \
222                 $(input_obj) \
223                 $(audio_output_obj) \
224                 $(video_output_obj) \
225                 $(ac3_decoder_obj) \
226                 $(lpcm_decoder_obj) \
227                 $(audio_decoder_obj) \
228                 $(spu_decoder_obj) \
229                 $(generic_decoder_obj) \
230                 $(video_parser_obj) \
231                 $(video_decoder_obj) \
232                 $(vlan_obj) \
233                 $(misc_obj)
234
235 ifeq ($(SYS),beos)
236 CPP_OBJ =                       misc/beos_specific.o
237 endif
238
239 #
240 # Assembler Objects
241
242 ifneq (,$(findstring 86,$(ARCH)))
243 ifneq (,$(findstring mmx,$(ARCH)))
244 ASM_OBJ =                       video_decoder/vdec_idctmmx.o \
245                                                 video_output/video_yuv_mmx.o
246 endif
247 endif
248
249 #
250 # Plugins
251 #
252 intf_plugin =           $(INTF:%=plugins/intf/intf_%.so)
253 aout_plugin =           $(AOUT:%=plugins/aout/aout_%.so)
254 vout_plugin =           $(VOUT:%=plugins/vout/vout_%.so)
255
256 PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
257
258 #
259 # Other lists of files
260 #
261 C_OBJ := $(C_OBJ:%.o=src/%.o)
262 CPP_OBJ := $(CPP_OBJ:%.o=src/%.o)
263 ASM_OBJ := $(ASM_OBJ:%.o=src/%.o)
264 sources_c := $(C_OBJ:%.o=%.c)
265 dependancies := $(sources_c:%.c=.dep/%.d)
266
267 # All symbols must be exported
268 export
269
270 ################################################################################
271 # Targets
272 ################################################################################
273
274 #
275 # Virtual targets
276 #
277 all: vlc plugins
278
279 clean:
280         rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
281
282 distclean: clean
283         rm -f */*/*.o plugins/*/*.so **/*~ *.log
284         rm -f Makefile include/defs.h include/config.h
285         rm -f config.status config.cache config.log
286         rm -f vlc gmon.out core
287         rm -rf .dep
288
289 install:
290         $(INSTALL) vlc $(prefix)/bin
291         mkdir -p $(prefix)/lib/videolan/vlc
292         mkdir -p $(prefix)/share/videolan/vlc
293         $(INSTALL) $(PLUGIN_OBJ) $(prefix)/lib/videolan/vlc
294         $(INSTALL) share/*.psf $(prefix)/share/videolan/vlc
295         $(INSTALL) share/*.png $(prefix)/share/videolan/vlc
296
297 show:
298         @echo "Command line for C objects:"
299         @echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
300         @echo
301         @echo "Command line for assembler objects:"
302         @echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"
303
304 # ugliest of all, but I have no time to do it -- sam
305 snapshot:
306         rm -rf /tmp/${SNAPSHOTDIR}
307         mkdir /tmp/${SNAPSHOTDIR}
308         cp -r * /tmp/${SNAPSHOTDIR}
309                 (cd /tmp/${SNAPSHOTDIR} ; \
310                 make distclean ; \
311                 find . -type d -name CVS | xargs rm -rf ; \
312                 find . -type f -name '.*.swp' | xargs rm -f ; \
313                 cd .. ; \
314                 tar czvf ${SNAPSHOTDIR}.tar.gz ${SNAPSHOTDIR} )
315         rm -rf /tmp/${SNAPSHOTDIR}
316         mv /tmp/${SNAPSHOTDIR}.tar.gz ..
317         @echo "Sources are in ../${SNAPSHOTDIR}.tar.gz"
318
319 FORCE:
320
321 #
322 # Real targets
323 #
324 vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
325 ifeq ($(SYS),beos)
326         $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
327 #       ln -s ../vlc ./plugins/_APP_
328 else
329         $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)   
330 endif
331
332 plugins: $(PLUGIN_OBJ)
333
334 #
335 # Generic rules (see below)
336 #
337 $(dependancies): %.d: FORCE
338         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
339
340 $(C_OBJ): %.o: Makefile.dep
341 $(C_OBJ): %.o: .dep/%.d
342 $(C_OBJ): %.o: %.c
343         $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
344
345 $(CPP_OBJ): %.o: %.cpp
346         $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
347
348 $(ASM_OBJ): %.o: Makefile.dep
349 $(ASM_OBJ): %.o: %.S
350         $(CC) $(CFLAGS) -c -o $@ $<
351
352 #$(PLUGIN_OBJ): %.so: Makefile.dep
353 #$(PLUGIN_OBJ): %.so: .dep/%.d
354
355 # audio plugins
356 plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
357 ifeq ($(SYS),beos)
358         $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
359 else
360         $(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
361 endif
362
363 plugins/aout/aout_esd.so: %.so: %.c
364 ifneq (,$(findstring bsd,$(SYS)))
365         $(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
366 else
367         $(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
368 endif
369
370 # video plugins
371 plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
372         plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
373 ifeq ($(SYS),beos)
374         $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
375 else
376         $(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
377 endif
378
379 plugins/intf/intf_x11.so plugins/vout/vout_x11.so: %.so: %.c
380         $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
381
382 plugins/intf/intf_mga.so plugins/vout/vout_mga.so: %.so: %.c
383         $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
384
385 plugins/intf/intf_gnome.so: %.so: %.c
386         $(CC) $(CCFLAGS) $(CFLAGS) $(LCFLAGS) `gnome-config --libs --cflags gnomeui` -shared -o $@ $< plugins/intf/intf_gnome_callbacks.c plugins/intf/intf_gnome_interface.c plugins/intf/intf_gnome_support.c
387
388 plugins/vout/vout_gnome.so: %.so: %.c
389         $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<
390
391 plugins/intf/intf_glide.so plugins/vout/vout_glide.so: %.so: %.c
392         $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<
393
394 plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
395         $(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
396
397 plugins/intf/intf_beos.so: %.so: %.cpp
398         $(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
399
400 plugins/vout/vout_beos.so: %.so: %.cpp
401         $(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
402                 
403
404 ################################################################################
405 # Note on generic rules and dependancies
406 ################################################################################
407
408 # Note on dependancies: each .c file is associated with a .d file, which
409 # depends of it. The .o file associated with a .c file depends of the .d, of the
410 # .c itself, and of Makefile. The .d files are stored in a separate .dep/
411 # directory.
412 # The dep directory should be ignored by CVS.
413
414 # Note on inclusions: depending of the target, the dependancies files must
415 # or must not be included. The problem is that if we ask make to include a file,
416 # and this file does not exist, it is made before it can be included. In a
417 # general way, a .d file should be included if and only if the corresponding .o
418 # needs to be re-made.
419
420 # Two makefiles are used: the main one (this one) has regular generic rules,
421 # except for .o files, for which it calls the object Makefile. Dependancies
422 # are not included in this file.
423 # The object Makefile known how to make a .o from a .c, and includes
424 # dependancies for the target, but only those required.