Makefile.in 18.5 KB
Newer Older
Michel Kaempf's avatar
Michel Kaempf committed
1
2
3
4
5
6
7
8
9
10
11
################################################################################
# vlc (VideoLAN Client) main makefile
# (c)1998 VideoLAN
################################################################################
# This makefile is the main makefile for the VideoLAN client.
################################################################################

################################################################################
# Configuration
################################################################################

Vincent Seguin's avatar
Vincent Seguin committed
12
# Debugging mode on or off (set to 1 to activate)
13
14
15
DEBUG=@DEBUG@
STATS=@STATS@
OPTIMS=@OPTIMS@
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
16

17
SYS=@SYS@
18
PLUGINS=@PLUGINS@
19
INSTALL=@INSTALL@
20
ARCH=@ARCH@
21
prefix=@prefix@
Benoit Steiner's avatar
   
Benoit Steiner committed
22
23
24
CC=@CC@
SHELL=@SHELL@

Christophe Massiot's avatar
Christophe Massiot committed
25
26
27
LIB_SDL=@LIB_SDL@
LIB_GLIDE=@LIB_GLIDE@
LIB_GGI=@LIB_GGI@
28
29

#----------------- do not change anything below this line ----------------------
30

Vincent Seguin's avatar
Vincent Seguin committed
31
32
33
34
################################################################################
# Configuration pre-processing
################################################################################

Vincent Seguin's avatar
Vincent Seguin committed
35
# PROGRAM_OPTIONS is an identification string of the compilation options
36
PROGRAM_OPTIONS = $(SYS) $(ARCH)
Vincent Seguin's avatar
Vincent Seguin committed
37
ifeq ($(DEBUG),1)
Vincent Seguin's avatar
Vincent Seguin committed
38
PROGRAM_OPTIONS += DEBUG
39
40
41
42
43
DEFINE += -DDEBUG
endif
ifeq ($(STATS),1)
PROGRAM_OPTIONS += DEBUG
DEFINE += -DSTATS
Vincent Seguin's avatar
Vincent Seguin committed
44
45
46
endif

# PROGRAM_BUILD is a complete identification of the build
47
48
# (we can't use fancy options with date since OSes like Solaris
# or FreeBSD have strange date implementations)
49
PROGRAM_BUILD = `date` $(USER)
50
# XXX: beos does not support hostname (how lame...)
51
#PROGRAM_BUILD = `date` $(USER)@`hostname`
Vincent Seguin's avatar
Vincent Seguin committed
52
53

# DEFINE will contain some of the constants definitions decided in Makefile, 
54
# including SYS_xx. It will be passed to C compiler.
Christophe Massiot's avatar
Christophe Massiot committed
55
DEFINE += -DSYS_$(shell echo $(SYS) | sed 's/-.*//' | tr a-z. A-Z_)
Vincent Seguin's avatar
Vincent Seguin committed
56

57
58
59
60
61
# On Linux activate 64-bit off_t (by default under BSD)
ifneq (,$(findstring linux,$(SYS)))
DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
endif

Michel Kaempf's avatar
Michel Kaempf committed
62
################################################################################
63
# Tuning and other variables - do not change anything except if you know
Vincent Seguin's avatar
Vincent Seguin committed
64
# exactly what you are doing
Michel Kaempf's avatar
Michel Kaempf committed
65
66
67
68
69
################################################################################

#
# C headers directories
#
70
INCLUDE += -Iinclude -I/usr/local/include -I/usr/X11R6/include
Vincent Seguin's avatar
Vincent Seguin committed
71

Michel Kaempf's avatar
Michel Kaempf committed
72
73
74
#
# Libraries
#
75
ifeq ($(SYS),gnu)
76
77
78
LIB += -lthreads -ldl
endif

79
ifneq (,$(findstring bsd,$(SYS)))
80
81
LIB += -pthread -lgnugetopt
LIB += -L/usr/local/lib
82
endif
83

84
ifneq (,$(findstring linux,$(SYS)))
85
86
87
LIB += -lpthread -ldl
endif

Benoit Steiner's avatar
   
Benoit Steiner committed
88
ifneq (,$(findstring solaris,$(SYS)))
Benoit Steiner's avatar
Benoit Steiner committed
89
LIB += -ldl -lsocket -lnsl -lpthread
Benoit Steiner's avatar
   
Benoit Steiner committed
90
91
endif

92
ifeq ($(SYS),beos)
93
94
LIB += -lbe -lroot -lgame
else
95
LIB += -lm
96
endif
97

Michel Kaempf's avatar
Michel Kaempf committed
98
#
Benoit Steiner's avatar
   
Benoit Steiner committed
99
# C compiler flags: mainstream compilation
Michel Kaempf's avatar
Michel Kaempf committed
100
#
101
102
103
104
CFLAGS += $(DEFINE) $(INCLUDE)
CFLAGS += -Wall -Winline
CFLAGS += -D_REENTRANT
CFLAGS += -D_GNU_SOURCE
Michel Kaempf's avatar
Michel Kaempf committed
105

106
# flags needed for clean beos compilation
Sam Hocevar's avatar
Sam Hocevar committed
107
ifeq ($(SYS),beos)
108
CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
Sam Hocevar's avatar
Sam Hocevar committed
109
endif
110

Michel Kaempf's avatar
Michel Kaempf committed
111
# Optimizations : don't compile debug versions with them
112
ifeq ($(OPTIMS),1)
113
114
CFLAGS += -O3
CFLAGS += -ffast-math -funroll-loops
115
CFLAGS += -fomit-frame-pointer
116

117
# Optimizations for x86 familiy
118
ifneq (,$(findstring 86,$(ARCH)))
119
# Optional Pentium Pro optimizations
120
ifneq (,$(findstring ppro,$(ARCH)))
121
CFLAGS += -march=pentiumpro -mcpu=pentiumpro
122
else
123
CFLAGS += -march=pentium -mcpu=pentium
124
endif
Vincent Seguin's avatar
Vincent Seguin committed
125
endif
126

Vincent Seguin's avatar
Vincent Seguin committed
127
# Optimizations for PowerPC
128
129
130
131
132
133
134
ifneq (,$(findstring powerpc,$(ARCH)))
# 604e
CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
# G3
#CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
# G4
#CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
Vincent Seguin's avatar
Vincent Seguin committed
135
endif
Michel Kaempf's avatar
Michel Kaempf committed
136

137
# Optimizations for Sparc
138
ifneq (,$(findstring sparc,$(ARCH)))
139
CFLAGS += -mhard-float
140
141
endif

Benoit Steiner's avatar
   
Benoit Steiner committed
142
#end of optimisations
143
144
endif

145
# Optional MMX optimizations for x86
146
147
ifneq (,$(findstring mmx,$(ARCH)))
CFLAGS += -DHAVE_MMX
148
149
endif

Benoit Steiner's avatar
   
Benoit Steiner committed
150
151
152
153
#
# C compiler flags: plugin compilation
#
PCFLAGS += -fPIC
154

Michel Kaempf's avatar
Michel Kaempf committed
155
156
157
158
159
160
161
162
163
164
165
#
# C compiler flags: dependancies
#
DCFLAGS += $(INCLUDE)
DCFLAGS += -MM

#
# C compiler flags: linking
#
LCFLAGS += $(LIB)
LCFLAGS += -Wall
Vincent Seguin's avatar
Vincent Seguin committed
166
#LCFLAGS += -s
Michel Kaempf's avatar
Michel Kaempf committed
167
168

#
Benoit Steiner's avatar
   
Benoit Steiner committed
169
# Debugging and profiling support (unless optimisations are active)
Michel Kaempf's avatar
Michel Kaempf committed
170
#
Benoit Steiner's avatar
   
Benoit Steiner committed
171
ifneq ($(OPTIMS),1)
172
173
CFLAGS += -g
endif
Michel Kaempf's avatar
Michel Kaempf committed
174
175
176
177
178
179

#################################################################################
# Objects and files
#################################################################################

#
Vincent Seguin's avatar
Vincent Seguin committed
180
# C Objects
Michel Kaempf's avatar
Michel Kaempf committed
181
# 
Benoit Steiner's avatar
   
Benoit Steiner committed
182
183
184
185
186
INTERFACE =	src/interface/main.o \
		src/interface/interface.o \
		src/interface/intf_msg.o \
		src/interface/intf_cmd.o \
		src/interface/intf_ctrl.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
187
		src/interface/intf_plst.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
188
		src/interface/intf_channels.o \
Benoit Steiner's avatar
   
Benoit Steiner committed
189
190
		src/interface/intf_console.o

Sam Hocevar's avatar
   
Sam Hocevar committed
191
INPUT =		src/input/input_ext-dec.o \
192
		src/input/input_ext-intf.o \
193
		src/input/input_dec.o \
194
		src/input/input_programs.o \
Henri Fallon's avatar
   
Henri Fallon committed
195
		src/input/input_netlist.o \
196
		src/input/input_clock.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
197
198
		src/input/input.o \
		src/input/mpeg_system.o
Benoit Steiner's avatar
   
Benoit Steiner committed
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219

AUDIO_OUTPUT = 	src/audio_output/audio_output.o

VIDEO_OUTPUT = 	src/video_output/video_output.o \
		src/video_output/video_text.o \
		src/video_output/video_spu.o \
		src/video_output/video_yuv.o

AC3_DECODER =	src/ac3_decoder/ac3_decoder_thread.o \
		src/ac3_decoder/ac3_decoder.o \
		src/ac3_decoder/ac3_parse.o \
		src/ac3_decoder/ac3_exponent.o \
		src/ac3_decoder/ac3_bit_allocate.o \
		src/ac3_decoder/ac3_mantissa.o \
		src/ac3_decoder/ac3_rematrix.o \
		src/ac3_decoder/ac3_imdct.o \
		src/ac3_decoder/ac3_downmix.o

LPCM_DECODER =	src/lpcm_decoder/lpcm_decoder_thread.o \
		src/lpcm_decoder/lpcm_decoder.o

Sam Hocevar's avatar
   
Sam Hocevar committed
220
221
222
223
224
AUDIO_DECODER =	src/audio_decoder/audio_decoder.o \
		src/audio_decoder/adec_generic.o \
		src/audio_decoder/adec_layer1.o \
		src/audio_decoder/adec_layer2.o \
		src/audio_decoder/adec_math.o
Benoit Steiner's avatar
   
Benoit Steiner committed
225
226
227
228
229
230
231
232
233
234

SPU_DECODER =	src/spu_decoder/spu_decoder.o

#GEN_DECODER =	src/generic_decoder/generic_decoder.o

VIDEO_PARSER = 	src/video_parser/video_parser.o \
		src/video_parser/vpar_headers.o \
		src/video_parser/vpar_blocks.o \
		src/video_parser/vpar_synchro.o \
		src/video_parser/video_fifo.o
Sam Hocevar's avatar
Sam Hocevar committed
235

Sam Hocevar's avatar
   
Sam Hocevar committed
236
VIDEO_DECODER =	src/video_decoder/video_decoder.o
Benoit Steiner's avatar
   
Benoit Steiner committed
237
238
239
240

MISC =		src/misc/mtime.o \
		src/misc/tests.o \
		src/misc/rsc_files.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
241
		src/misc/modules.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
242
		src/misc/netutils.o
Benoit Steiner's avatar
   
Benoit Steiner committed
243
244
245
246
247
248
249
250
251


C_OBJ =		$(INTERFACE) \
		$(INPUT) \
		$(VIDEO_OUTPUT) \
		$(AUDIO_OUTPUT) \
		$(AC3_DECODER) \
		$(LPCM_DECODER) \
		$(AUDIO_DECODER) \
252
		$(SPU_DECODER) \
Benoit Steiner's avatar
   
Benoit Steiner committed
253
254
255
256
257
		$(GEN_DECODER) \
		$(VIDEO_PARSER) \
		$(VIDEO_DECODER) \
		$(MISC)

Michel Kaempf's avatar
Michel Kaempf committed
258

Benoit Steiner's avatar
   
Benoit Steiner committed
259
260
261
#
# CPP Objects
# 
262
ifeq ($(SYS),beos)
Benoit Steiner's avatar
   
Benoit Steiner committed
263
CPP_OBJ =	src/misc/beos_specific.o
264
265
endif

Vincent Seguin's avatar
Vincent Seguin committed
266
267
268
#
# Assembler Objects
# 
269
270
ifneq (,$(findstring 86,$(ARCH)))
ifneq (,$(findstring mmx,$(ARCH)))
271
ASM_OBJ =		
272
STD_PLUGIN_ASM = 	
Vincent Seguin's avatar
Vincent Seguin committed
273
endif
274
endif
Vincent Seguin's avatar
Vincent Seguin committed
275

276
277
278
#
# Plugins
#
Sam Hocevar's avatar
   
Sam Hocevar committed
279
280
281
282
283
284
285
286
287
288
289
290
291
PLUGIN_NULL =	plugins/null/null.o

PLUGIN_PS =	plugins/mpeg/ps.o \
		plugins/mpeg/input_ps.o

PLUGIN_TS =	plugins/mpeg/ts.o \
		plugins/mpeg/input_ts.o

PLUGIN_DVD =	plugins/dvd/dvd.o \
		plugins/dvd/input_dvd.o \
		plugins/dvd/dvd_ifo.o \
	        plugins/dvd/dvd_css.o

Benoit Steiner's avatar
   
Benoit Steiner committed
292
PLUGIN_BEOS =	plugins/beos/beos.o \
293
		plugins/beos/aout_beos.o \
294
295
		plugins/beos/intf_beos.o \
		plugins/beos/vout_beos.o
296

Benoit Steiner's avatar
   
Benoit Steiner committed
297
PLUGIN_DSP =	plugins/dsp/dsp.o \
298
299
		plugins/dsp/aout_dsp.o

Benoit Steiner's avatar
   
Benoit Steiner committed
300
PLUGIN_DUMMY =	plugins/dummy/dummy.o \
301
		plugins/dummy/aout_dummy.o \
302
303
304
		plugins/dummy/intf_dummy.o \
		plugins/dummy/vout_dummy.o

Benoit Steiner's avatar
   
Benoit Steiner committed
305
PLUGIN_ESD =	plugins/esd/esd.o \
306
		plugins/esd/aout_esd.o
307

Benoit Steiner's avatar
   
Benoit Steiner committed
308
PLUGIN_FB =	plugins/fb/fb.o \
309
		plugins/fb/intf_fb.o \
310
311
		plugins/fb/vout_fb.o

Benoit Steiner's avatar
   
Benoit Steiner committed
312
PLUGIN_GGI =	plugins/ggi/ggi.o \
313
		plugins/ggi/intf_ggi.o \
314
315
		plugins/ggi/vout_ggi.o

Benoit Steiner's avatar
   
Benoit Steiner committed
316
PLUGIN_SDL =	plugins/sdl/sdl.o \
317
318
		plugins/sdl/vout_sdl.o \
		plugins/sdl/aout_sdl.o 
Pierre Baillet's avatar
Pierre Baillet committed
319

Benoit Steiner's avatar
   
Benoit Steiner committed
320
PLUGIN_GLIDE =	plugins/glide/glide.o \
321
		plugins/glide/intf_glide.o \
322
323
		plugins/glide/vout_glide.o

Benoit Steiner's avatar
   
Benoit Steiner committed
324
PLUGIN_GNOME =	plugins/gnome/gnome.o \
325
		plugins/gnome/intf_gnome.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
326
327
328
		plugins/gnome/gnome_callbacks.o \
		plugins/gnome/gnome_interface.o \
		plugins/gnome/gnome_support.o
329

Benoit Steiner's avatar
   
Benoit Steiner committed
330
PLUGIN_MGA =	plugins/mga/mga.o \
331
332
		plugins/mga/intf_mga.o \
		plugins/mga/vout_mga.o
333

Benoit Steiner's avatar
   
Benoit Steiner committed
334
PLUGIN_X11=	plugins/x11/x11.o \
335
336
		plugins/x11/vout_x11.o

Benoit Steiner's avatar
   
Benoit Steiner committed
337
PLUGIN_YUV =	plugins/yuv/yuv.o \
338
		plugins/yuv/video_yuv.o \
339
340
341
342
343
		plugins/yuv/transforms_yuv.o

PLUGIN_YUVMMX =	plugins/yuv/yuvmmx.o \
		plugins/yuv/video_yuvmmx.o \
		plugins/yuv/transforms_yuvmmx.o
344

Sam Hocevar's avatar
   
Sam Hocevar committed
345
346
347
348
349
350
351
352
353
354
355
356
PLUGIN_MOTION =	plugins/motion/motion.o \
		plugins/motion/vdec_motion_common.o \
		plugins/motion/vdec_motion_inner.o

PLUGIN_MOTIONMMX =	plugins/motion/motionmmx.o \
			plugins/motion/vdec_motion_common.o \
			plugins/motion/vdec_motion_inner_mmx.o

PLUGIN_MOTIONMMXEXT =	plugins/motion/motionmmxext.o \
			plugins/motion/vdec_motion_common.o \
			plugins/motion/vdec_motion_inner_mmxext.o

Sam Hocevar's avatar
   
Sam Hocevar committed
357
358
359
360
361
362
363
PLUGIN_IDCT =	plugins/idct/idct.o \
		plugins/idct/idct_common.o

PLUGIN_IDCTCLASSIC =	plugins/idct/idctclassic.o \
			plugins/idct/idct_common.o

PLUGIN_IDCTMMX =	plugins/idct/idctmmx.o \
364
			plugins/idct/idct_common.o
Sam Hocevar's avatar
   
Sam Hocevar committed
365

366
PLUGIN_IDCTMMXEXT =	plugins/idct/idctmmxext.o \
367
			plugins/idct/idct_common.o
368

Benoit Steiner's avatar
   
Benoit Steiner committed
369
370
371
372
373
374
375
376
377
378
379
380
381
PLUGIN_ALSA =	plugins/alsa/alsa.o \
		plugins/alsa/aout_alsa.o

STD_PLUGIN_OBJ =$(PLUGIN_BEOS) \
		$(PLUGIN_DSP) \
		$(PLUGIN_DUMMY) \
		$(PLUGIN_ESD) \
		$(PLUGIN_FB) \
		$(PLUGIN_GGI) \
		$(PLUGIN_MGA) \
		$(PLUGIN_X11) \
		$(PLUGIN_YUV) \
		$(PLUGIN_YUVMMX) \
Sam Hocevar's avatar
   
Sam Hocevar committed
382
383
384
		$(PLUGIN_MOTION) \
		$(PLUGIN_MOTIONMMX) \
		$(PLUGIN_MOTIONMMXEXT) \
Sam Hocevar's avatar
   
Sam Hocevar committed
385
		$(PLUGIN_IDCT) \
386
		$(PLUGIN_IDCTCLASSIC) \
Sam Hocevar's avatar
   
Sam Hocevar committed
387
		$(PLUGIN_IDCTMMX) \
388
		$(PLUGIN_IDCTMMXEXT) \
Benoit Steiner's avatar
   
Benoit Steiner committed
389
		$(PLUGIN_SDL) \
Sam Hocevar's avatar
   
Sam Hocevar committed
390
391
		$(PLUGIN_ALSA) \
		$(PLUGIN_NULL)
Henri Fallon's avatar
   
Henri Fallon committed
392

Sam Hocevar's avatar
   
Sam Hocevar committed
393
# list duplicates
Sam Hocevar's avatar
   
Sam Hocevar committed
394
395
STD_PLUGIN_COMMON =	plugins/idct/idct_common.o \
			plugins/motion/vdec_motion_common.o
Sam Hocevar's avatar
   
Sam Hocevar committed
396

Sam Hocevar's avatar
   
Sam Hocevar committed
397
# filter out duplicates from the plugin object lists
Sam Hocevar's avatar
   
Sam Hocevar committed
398
399
STD_PLUGIN_OBJ :=	$(filter-out $(STD_PLUGIN_COMMON) $(STD_PLUGIN_ASM), \
				 $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
Sam Hocevar's avatar
   
Sam Hocevar committed
400

Michel Kaempf's avatar
Michel Kaempf committed
401
402
403
#
# Other lists of files
#
Sam Hocevar's avatar
   
Sam Hocevar committed
404
objects := $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(STD_PLUGIN_ASM)
Benoit Steiner's avatar
   
Benoit Steiner committed
405
dependancies := $(objects:%.o=.dep/%.d)
Michel Kaempf's avatar
Michel Kaempf committed
406
407
408
409
410
411
412
413
414
415
416

# All symbols must be exported
export

################################################################################
# Targets
################################################################################

#
# Virtual targets
#
417
all: vlc @ALIASES@ plugins
Michel Kaempf's avatar
Michel Kaempf committed
418
419

clean:
420
	rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
Sam Hocevar's avatar
   
Sam Hocevar committed
421
422
	rm -f plugins/*/*.o src/*/*.o lib/*.so
	rm -f vlc @ALIASES@
Michel Kaempf's avatar
Michel Kaempf committed
423
424

distclean: clean
425
	rm -f src/*/*.o plugins/*/*.o **/*~ *.log
426
427
	rm -f Makefile include/defs.h include/config.h
	rm -f config.status config.cache config.log
428
	rm -f gmon.out core build-stamp
429
	rm -rf .dep
430
431

install:
432
	mkdir -p $(prefix)/bin
433
	$(INSTALL) vlc $(prefix)/bin
Benoit Steiner's avatar
   
Benoit Steiner committed
434
# ugly
435
	for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(prefix)/bin/$$alias && ln -s vlc $(prefix)/bin/$$alias ; fi ; done
436
	mkdir -p $(prefix)/lib/videolan/vlc
437
	$(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(prefix)/lib/videolan/vlc
438
	mkdir -p $(prefix)/share/videolan
439
440
	$(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan
	$(INSTALL) -m 644 share/*.png $(prefix)/share/videolan
Michel Kaempf's avatar
Michel Kaempf committed
441

Vincent Seguin's avatar
Vincent Seguin committed
442
show:
443
	@echo CC: $(CC)
444
	@echo CFLAGS: $(CFLAGS)
445
	@echo DCFLAGS: $(DCFLAGS)
446
	@echo LCFLAGS: $(LCFLAGS)
Sam Hocevar's avatar
   
Sam Hocevar committed
447
	@echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
Vincent Seguin's avatar
Vincent Seguin committed
448

Sam Hocevar's avatar
Sam Hocevar committed
449
450
# ugliest of all, but I have no time to do it -- sam
snapshot:
451
	rm -rf /tmp/vlc-@VLC_VERSION@ /tmp/vlc-@VLC_VERSION@nocss
Sam Hocevar's avatar
   
Sam Hocevar committed
452
	# copy archive in /tmp
453
	find -type d | while read i ; \
Sam Hocevar's avatar
   
Sam Hocevar committed
454
455
		do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
	done
Sam Hocevar's avatar
   
Sam Hocevar committed
456
457
	find debian -mindepth 1 -maxdepth 1 -type d | grep -v CVS | \
		while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
458
459
460
	# CVS entries
	find . -type f | grep CVS | while read i ; \
		do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
Sam Hocevar's avatar
   
Sam Hocevar committed
461
462
463
464
465
	done
	# .c .h .in .cpp
	find include src plugins -type f -name '*.[chi]*' | while read i ; \
		do cp $$i /tmp/vlc-@VLC_VERSION@/$$i ; \
	done
466
	# copy misc files
Sam Hocevar's avatar
   
Sam Hocevar committed
467
468
469
470
	cp vlc.spec AUTHORS COPYING ChangeLog INSTALL README TODO \
		Makefile.in Makefile.dep configure configure.in install-sh \
		config.sub config.guess todo.pl \
			/tmp/vlc-@VLC_VERSION@/
471
472
473
474
475
476
477
	for file in control vlc-gnome.menu vlc.copyright vlc.docs changelog \
		rules vlc.1 vlc.dirs vlc.menu ; do \
			cp debian/$$file /tmp/vlc-@VLC_VERSION@/debian/ ; done
	for file in default8x16.psf default8x9.psf gvlc.png vlc.png ; do \
		cp share/$$file /tmp/vlc-@VLC_VERSION@/share/ ; done

	# build css-enabled archives
Sam Hocevar's avatar
   
Sam Hocevar committed
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
	(cd /tmp ; tar cf vlc-@VLC_VERSION@.tar vlc-@VLC_VERSION@ ; \
		bzip2 -f -9 < vlc-@VLC_VERSION@.tar \
			> vlc-@VLC_VERSION@.tar.bz2 ; \
		gzip -f -9 vlc-@VLC_VERSION@.tar )
	mv /tmp/vlc-@VLC_VERSION@.tar.gz /tmp/vlc-@VLC_VERSION@.tar.bz2 ..

	# removing CSS stuff
	find /tmp/vlc-@VLC_VERSION@ -type f -name '*css*' | xargs rm -f
	for x in Makefile.in src/input/input_dvd.c src/input/input_dvd.h ; do \
	rm -f /tmp/vlc-@VLC_VERSION@/$$x ; \
	perl -ne 'if (/^#e(lse|ndif)/) { $$i=0; } \
			if (/^#if.*DVD/) { $$i=1; print "#if 0\n"; } \
			elsif (!$$i || /^#/) { print $$_; }' \
		< $$x | grep -vi css >| /tmp/vlc-@VLC_VERSION@/$$x ; \
	done
493
494
495
496
497
498
499
500
501
502
503
504
	rm -f /tmp/vlc-@VLC_VERSION@/debian/changelog
	sed 's/\(^vlc ([^-]*\)-/\1nocss-/' < debian/changelog \
		> /tmp/vlc-@VLC_VERSION@/debian/changelog

	# build nocss archives
	(cd /tmp ; mv vlc-@VLC_VERSION@ vlc-@VLC_VERSION@nocss ; \
		tar cf vlc-@VLC_VERSION@nocss.tar vlc-@VLC_VERSION@nocss ; \
		bzip2 -f -9 < vlc-@VLC_VERSION@nocss.tar \
			> vlc-@VLC_VERSION@nocss.tar.bz2 ; \
		gzip -f -9 vlc-@VLC_VERSION@nocss.tar )
	mv /tmp/vlc-@VLC_VERSION@nocss.tar.gz \
		/tmp/vlc-@VLC_VERSION@nocss.tar.bz2 ..
Sam Hocevar's avatar
   
Sam Hocevar committed
505
506

	# clean up
507
	rm -rf /tmp/vlc-@VLC_VERSION@nocss
Sam Hocevar's avatar
Sam Hocevar committed
508

509
plugins: $(PLUGINS:%=lib/%.so)
Michel Kaempf's avatar
Michel Kaempf committed
510

Benoit Steiner's avatar
   
Benoit Steiner committed
511
FORCE:
512

Sam Hocevar's avatar
Sam Hocevar committed
513
514
515
516
517
#
# Gnome and Framebuffer aliases - don't add new aliases which could bloat
# the namespace
#
gvlc fbvlc: vlc
518
519
	rm -f $@ && ln -s vlc $@

Michel Kaempf's avatar
Michel Kaempf committed
520
521
522
523
524

#
# Generic rules (see below)
#
$(dependancies): %.d: FORCE
525
	@$(MAKE) -s --no-print-directory -f Makefile.dep $@
Michel Kaempf's avatar
Michel Kaempf committed
526

527
$(C_OBJ): %.o: Makefile.dep
528
$(C_OBJ): %.o: .dep/%.d
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
529
$(C_OBJ): %.o: %.c
530
	$(CC) $(CFLAGS) -c -o $@ $<
Vincent Seguin's avatar
Vincent Seguin committed
531

532
$(CPP_OBJ): %.o: %.cpp
533
	$(CC) $(CFLAGS) -c -o $@ $<
534

535
$(ASM_OBJ): %.o: Makefile.dep
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
536
$(ASM_OBJ): %.o: %.S
537
	$(CC) $(CFLAGS) -c -o $@ $<
Michel Kaempf's avatar
Michel Kaempf committed
538

Benoit Steiner's avatar
   
Benoit Steiner committed
539
540
541
542
543
$(STD_PLUGIN_OBJ): %.o: Makefile.dep
$(STD_PLUGIN_OBJ): %.o: .dep/%.d
$(STD_PLUGIN_OBJ): %.o: %.c
	$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<

Sam Hocevar's avatar
   
Sam Hocevar committed
544
545
546
547
$(STD_PLUGIN_ASM): %.o: Makefile.dep
$(STD_PLUGIN_ASM): %.o: %.S
	$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<

Benoit Steiner's avatar
   
Benoit Steiner committed
548
549
$(PLUGIN_GNOME): %.o: Makefile.dep
$(PLUGIN_GNOME): %.o: %.c
550
	$(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
Benoit Steiner's avatar
   
Benoit Steiner committed
551
552
553

$(PLUGIN_GLIDE): %.o: Makefile.dep
$(PLUGIN_GLIDE): %.o: %.c
554
	$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
Benoit Steiner's avatar
   
Benoit Steiner committed
555
556

#
Sam Hocevar's avatar
   
Sam Hocevar committed
557
# Main application target
Benoit Steiner's avatar
   
Benoit Steiner committed
558
#
Sam Hocevar's avatar
   
Sam Hocevar committed
559

Benoit Steiner's avatar
   
Benoit Steiner committed
560
561
562
563
564
565
vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
ifeq ($(SYS),beos)
	$(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
	rm -f ./plugins/_APP_
	ln -s ../vlc ./plugins/_APP_
else
Sam Hocevar's avatar
   
Sam Hocevar committed
566
	$(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)	
Benoit Steiner's avatar
   
Benoit Steiner committed
567
endif
568

Sam Hocevar's avatar
   
Sam Hocevar committed
569
570
571
572
#
# Plugin targets
#

573
lib/beos.so: $(PLUGIN_BEOS)
Sam Hocevar's avatar
   
Sam Hocevar committed
574
	$(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
575

576
lib/esd.so: $(PLUGIN_ESD)
577
ifneq (,$(findstring bsd,$(SYS)))
Sam Hocevar's avatar
   
Sam Hocevar committed
578
	$(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
579
else
Sam Hocevar's avatar
   
Sam Hocevar committed
580
	$(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
581
endif
582

583
lib/dsp.so: $(PLUGIN_DSP)
Sam Hocevar's avatar
   
Sam Hocevar committed
584
	$(CC) $(PCFLAGS) -shared -o $@ $^
585

Henri Fallon's avatar
   
Henri Fallon committed
586
lib/alsa.so: $(PLUGIN_ALSA)
Henri Fallon's avatar
   
Henri Fallon committed
587
	$(CC) $(PCFLAGS) -shared -o $@ $^ -lasound
Henri Fallon's avatar
   
Henri Fallon committed
588

589
lib/fb.so: $(PLUGIN_FB)
Sam Hocevar's avatar
   
Sam Hocevar committed
590
	$(CC) $(PCFLAGS) -shared -o $@ $^
591

592
lib/x11.so: $(PLUGIN_X11)
Sam Hocevar's avatar
   
Sam Hocevar committed
593
	$(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
594

595
lib/mga.so: $(PLUGIN_MGA)
Sam Hocevar's avatar
   
Sam Hocevar committed
596
	$(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext
597

598
lib/gnome.so: $(PLUGIN_GNOME)
Sam Hocevar's avatar
   
Sam Hocevar committed
599
	$(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
600

601
lib/glide.so: $(PLUGIN_GLIDE)
Sam Hocevar's avatar
   
Sam Hocevar committed
602
	$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GLIDE)
603

604
lib/ggi.so: $(PLUGIN_GGI)
Sam Hocevar's avatar
   
Sam Hocevar committed
605
	$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_GGI)
606

Pierre Baillet's avatar
Pierre Baillet committed
607
lib/sdl.so: $(PLUGIN_SDL)
Sam Hocevar's avatar
   
Sam Hocevar committed
608
	$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
Pierre Baillet's avatar
Pierre Baillet committed
609

610
ifeq ($(SYS),beos)
611
612
613
lib/null.so: $(PLUGIN_NULL)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
614
615
616
617
618
619
620
621
622
lib/ps.so: $(PLUGIN_PS)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

lib/ts.so: $(PLUGIN_TS)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

lib/dvd.so: $(PLUGIN_DVD)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

623
624
625
lib/dummy.so: $(PLUGIN_DUMMY)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
626
lib/yuv.so: $(PLUGIN_YUV)
Sam Hocevar's avatar
   
Sam Hocevar committed
627
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
628
629

lib/yuvmmx.so: $(PLUGIN_YUVMMX)
Sam Hocevar's avatar
   
Sam Hocevar committed
630
631
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
632
633
634
635
636
637
638
639
640
641
642
643
lib/motion.so: $(PLUGIN_MOTION)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

lib/idct.so: $(PLUGIN_IDCT)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
644
645
646
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
647
lib/idctmmx.so: $(PLUGIN_IDCTMMX)
Sam Hocevar's avatar
   
Sam Hocevar committed
648
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
649
650
651

lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
652
else
653
654
655
lib/null.so: $(PLUGIN_NULL)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
   
Sam Hocevar committed
656
657
658
659
660
661
662
663
664
lib/ps.so: $(PLUGIN_PS)
	$(CC) $(PCFLAGS) -shared -o $@ $^

lib/ts.so: $(PLUGIN_TS)
	$(CC) $(PCFLAGS) -shared -o $@ $^

lib/dvd.so: $(PLUGIN_DVD)
	$(CC) $(PCFLAGS) -shared -o $@ $^

665
666
667
lib/dummy.so: $(PLUGIN_DUMMY)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
   
Sam Hocevar committed
668
669
670
671
672
673
lib/yuv.so: $(PLUGIN_YUV)
	$(CC) $(PCFLAGS) -shared -o $@ $^

lib/yuvmmx.so: $(PLUGIN_YUVMMX)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
   
Sam Hocevar committed
674
675
676
677
678
679
680
681
682
lib/motion.so: $(PLUGIN_MOTION)
	$(CC) $(PCFLAGS) -shared -o $@ $^

lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
	$(CC) $(PCFLAGS) -shared -o $@ $^

lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
   
Sam Hocevar committed
683
684
685
686
687
688
lib/idct.so: $(PLUGIN_IDCT)
	$(CC) $(PCFLAGS) -shared -o $@ $^

lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
   
Sam Hocevar committed
689
lib/idctmmx.so: $(PLUGIN_IDCTMMX)
Sam Hocevar's avatar
   
Sam Hocevar committed
690
	$(CC) $(PCFLAGS) -shared -o $@ $^
691
692
693

lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
	$(CC) $(PCFLAGS) -shared -o $@ $^
694
endif
695

Michel Kaempf's avatar
Michel Kaempf committed
696
697
698
699
700
################################################################################
# Note on generic rules and dependancies
################################################################################

# Note on dependancies: each .c file is associated with a .d file, which
701
702
# depends of it. The .o file associated with a .c file depends of the .d, of the
# .c itself, and of Makefile. The .d files are stored in a separate .dep/
Michel Kaempf's avatar
Michel Kaempf committed
703
704
705
# directory.
# The dep directory should be ignored by CVS.

706
# Note on inclusions: depending of the target, the dependancies files must
Michel Kaempf's avatar
Michel Kaempf committed
707
# or must not be included. The problem is that if we ask make to include a file,
708
709
# and this file does not exist, it is made before it can be included. In a
# general way, a .d file should be included if and only if the corresponding .o
Michel Kaempf's avatar
Michel Kaempf committed
710
711
712
713
714
# needs to be re-made.

# Two makefiles are used: the main one (this one) has regular generic rules,
# except for .o files, for which it calls the object Makefile. Dependancies
# are not included in this file.
Michel Kaempf's avatar
Michel Kaempf committed
715
716
# The object Makefile known how to make a .o from a .c, and includes
# dependancies for the target, but only those required.