Makefile.in 19.4 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 =		
Vincent Seguin's avatar
Vincent Seguin committed
272
endif
273
endif
Vincent Seguin's avatar
Vincent Seguin committed
274

275
276
277
#
# Plugins
#
Sam Hocevar's avatar
   
Sam Hocevar committed
278
279
PLUGIN_ALSA =	plugins/alsa/alsa.o \
		plugins/alsa/aout_alsa.o
Sam Hocevar's avatar
   
Sam Hocevar committed
280

Benoit Steiner's avatar
   
Benoit Steiner committed
281
PLUGIN_BEOS =	plugins/beos/beos.o \
282
		plugins/beos/aout_beos.o \
283
284
		plugins/beos/intf_beos.o \
		plugins/beos/vout_beos.o
285

Benoit Steiner's avatar
   
Benoit Steiner committed
286
PLUGIN_DSP =	plugins/dsp/dsp.o \
287
288
		plugins/dsp/aout_dsp.o

Benoit Steiner's avatar
   
Benoit Steiner committed
289
PLUGIN_DUMMY =	plugins/dummy/dummy.o \
290
		plugins/dummy/aout_dummy.o \
291
292
293
		plugins/dummy/intf_dummy.o \
		plugins/dummy/vout_dummy.o

Sam Hocevar's avatar
   
Sam Hocevar committed
294
295
296
PLUGIN_DVD =	plugins/dvd/dvd.o \
		plugins/dvd/input_dvd.o \
		plugins/dvd/dvd_ifo.o \
297
		plugins/dvd/dvd_udf.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
298
299
	        plugins/dvd/dvd_css.o

Benoit Steiner's avatar
   
Benoit Steiner committed
300
PLUGIN_ESD =	plugins/esd/esd.o \
301
		plugins/esd/aout_esd.o
302

Benoit Steiner's avatar
   
Benoit Steiner committed
303
PLUGIN_FB =	plugins/fb/fb.o \
304
305
		plugins/fb/vout_fb.o

Benoit Steiner's avatar
   
Benoit Steiner committed
306
PLUGIN_GGI =	plugins/ggi/ggi.o \
307
		plugins/ggi/intf_ggi.o \
308
309
		plugins/ggi/vout_ggi.o

Benoit Steiner's avatar
   
Benoit Steiner committed
310
PLUGIN_GLIDE =	plugins/glide/glide.o \
311
		plugins/glide/intf_glide.o \
312
313
		plugins/glide/vout_glide.o

Benoit Steiner's avatar
   
Benoit Steiner committed
314
PLUGIN_GNOME =	plugins/gnome/gnome.o \
315
		plugins/gnome/intf_gnome.o \
Sam Hocevar's avatar
   
Sam Hocevar committed
316
317
318
		plugins/gnome/gnome_callbacks.o \
		plugins/gnome/gnome_interface.o \
		plugins/gnome/gnome_support.o
319

Sam Hocevar's avatar
   
Sam Hocevar committed
320
321
PLUGIN_IDCT =	plugins/idct/idct.o \
		plugins/idct/idct_common.o
322

Sam Hocevar's avatar
   
Sam Hocevar committed
323
324
PLUGIN_IDCTCLASSIC =	plugins/idct/idctclassic.o \
			plugins/idct/idct_common.o
325

Sam Hocevar's avatar
   
Sam Hocevar committed
326
327
PLUGIN_IDCTMMX =	plugins/idct/idctmmx.o \
			plugins/idct/idct_common.o
328

Sam Hocevar's avatar
   
Sam Hocevar committed
329
330
331
332
333
334
PLUGIN_IDCTMMXEXT =	plugins/idct/idctmmxext.o \
			plugins/idct/idct_common.o

PLUGIN_MGA =	plugins/mga/mga.o \
		plugins/mga/intf_mga.o \
		plugins/mga/vout_mga.o
335

Sam Hocevar's avatar
   
Sam Hocevar committed
336
337
338
339
340
341
342
343
344
345
346
347
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
348
349
350
PLUGIN_NCURSES =	plugins/text/ncurses.o \
			plugins/text/intf_ncurses.o

Sam Hocevar's avatar
   
Sam Hocevar committed
351
PLUGIN_NULL =	plugins/null/null.o
Sam Hocevar's avatar
   
Sam Hocevar committed
352

Sam Hocevar's avatar
   
Sam Hocevar committed
353
354
PLUGIN_PS =	plugins/mpeg/ps.o \
		plugins/mpeg/input_ps.o
Sam Hocevar's avatar
   
Sam Hocevar committed
355

Sam Hocevar's avatar
   
Sam Hocevar committed
356
357
358
PLUGIN_SDL =	plugins/sdl/sdl.o \
		plugins/sdl/vout_sdl.o \
		plugins/sdl/aout_sdl.o 
Sam Hocevar's avatar
   
Sam Hocevar committed
359

Sam Hocevar's avatar
   
Sam Hocevar committed
360
361
PLUGIN_TS =	plugins/mpeg/ts.o \
		plugins/mpeg/input_ts.o
362

Sam Hocevar's avatar
   
Sam Hocevar committed
363
364
PLUGIN_X11=	plugins/x11/x11.o \
		plugins/x11/vout_x11.o
Benoit Steiner's avatar
   
Benoit Steiner committed
365

Sam Hocevar's avatar
   
Sam Hocevar committed
366
367
368
369
370
371
372
373
374
375
PLUGIN_YUV =	plugins/yuv/yuv.o \
		plugins/yuv/video_yuv.o \
		plugins/yuv/transforms_yuv.o

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

STD_PLUGIN_OBJ = \
		$(PLUGIN_ALSA) \
Benoit Steiner's avatar
   
Benoit Steiner committed
376
377
		$(PLUGIN_DSP) \
		$(PLUGIN_DUMMY) \
Sam Hocevar's avatar
   
Sam Hocevar committed
378
		$(PLUGIN_DVD) \
Benoit Steiner's avatar
   
Benoit Steiner committed
379
380
381
		$(PLUGIN_ESD) \
		$(PLUGIN_FB) \
		$(PLUGIN_GGI) \
Sam Hocevar's avatar
   
Sam Hocevar committed
382
		$(PLUGIN_IDCT) \
383
		$(PLUGIN_IDCTCLASSIC) \
Sam Hocevar's avatar
   
Sam Hocevar committed
384
		$(PLUGIN_IDCTMMX) \
385
		$(PLUGIN_IDCTMMXEXT) \
Sam Hocevar's avatar
   
Sam Hocevar committed
386
387
388
389
		$(PLUGIN_MGA) \
		$(PLUGIN_MOTION) \
		$(PLUGIN_MOTIONMMX) \
		$(PLUGIN_MOTIONMMXEXT) \
Sam Hocevar's avatar
   
Sam Hocevar committed
390
		$(PLUGIN_NCURSES) \
Sam Hocevar's avatar
   
Sam Hocevar committed
391
392
		$(PLUGIN_NULL) \
		$(PLUGIN_PS) \
Benoit Steiner's avatar
   
Benoit Steiner committed
393
		$(PLUGIN_SDL) \
Sam Hocevar's avatar
   
Sam Hocevar committed
394
395
396
397
398
		$(PLUGIN_TS) \
		$(PLUGIN_X11) \
		$(PLUGIN_YUV) \
		$(PLUGIN_YUVMMX)

Sam Hocevar's avatar
   
Sam Hocevar committed
399
# list duplicates
Sam Hocevar's avatar
   
Sam Hocevar committed
400
401
STD_PLUGIN_COMMON =	plugins/idct/idct_common.o \
			plugins/motion/vdec_motion_common.o
Sam Hocevar's avatar
   
Sam Hocevar committed
402

Sam Hocevar's avatar
   
Sam Hocevar committed
403
# filter out duplicates from the plugin object lists
Sam Hocevar's avatar
   
Sam Hocevar committed
404
STD_PLUGIN_OBJ :=	$(filter-out $(STD_PLUGIN_COMMON), \
Sam Hocevar's avatar
   
Sam Hocevar committed
405
				 $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
Sam Hocevar's avatar
   
Sam Hocevar committed
406

Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
407
408
409
410
411
412
413
NONSTD_PLUGIN_OBJ = \
		$(PLUGIN_GLIDE) \
		$(PLUGIN_GNOME)

NONSTD_CPP_PLUGIN_OBJ = \
		$(PLUGIN_BEOS)

Michel Kaempf's avatar
Michel Kaempf committed
414
415
416
#
# Other lists of files
#
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
417
418
419
420
objects := $(C_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(NONSTD_PLUGIN_OBJ)
cdependancies := $(objects:%.o=.dep/%.d)
cppobjects := $(CPP_OBJ) $(NONSTD_CPP_PLUGIN_OBJ)
cppdependancies := $(cppobjects:%.o=.dep/%.dpp)
Michel Kaempf's avatar
Michel Kaempf committed
421
422
423
424
425
426
427
428
429
430
431

# All symbols must be exported
export

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

#
# Virtual targets
#
432
all: vlc @ALIASES@ plugins
Michel Kaempf's avatar
Michel Kaempf committed
433
434

clean:
435
	rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
Sam Hocevar's avatar
   
Sam Hocevar committed
436
437
	rm -f plugins/*/*.o src/*/*.o lib/*.so
	rm -f vlc @ALIASES@
Michel Kaempf's avatar
Michel Kaempf committed
438
439

distclean: clean
440
	rm -f src/*/*.o plugins/*/*.o **/*~ *.log
441
442
	rm -f Makefile include/defs.h include/config.h
	rm -f config.status config.cache config.log
443
	rm -f gmon.out core build-stamp
444
	rm -rf .dep
445
446

install:
447
	mkdir -p $(prefix)/bin
448
	$(INSTALL) vlc $(prefix)/bin
Benoit Steiner's avatar
   
Benoit Steiner committed
449
# ugly
450
	for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(prefix)/bin/$$alias && ln -s vlc $(prefix)/bin/$$alias ; fi ; done
451
	mkdir -p $(prefix)/lib/videolan/vlc
452
	$(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(prefix)/lib/videolan/vlc
453
	mkdir -p $(prefix)/share/videolan
454
455
	$(INSTALL) -m 644 share/*.psf $(prefix)/share/videolan
	$(INSTALL) -m 644 share/*.png $(prefix)/share/videolan
Michel Kaempf's avatar
Michel Kaempf committed
456

Vincent Seguin's avatar
Vincent Seguin committed
457
show:
458
	@echo CC: $(CC)
459
	@echo CFLAGS: $(CFLAGS)
460
	@echo DCFLAGS: $(DCFLAGS)
461
	@echo LCFLAGS: $(LCFLAGS)
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
462
463
	@echo C_OBJ: $(C_OBJ)
	@echo CPP_OBJ: $(CPP_OBJ)
Sam Hocevar's avatar
   
Sam Hocevar committed
464
	@echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
465
466
467
468
	@echo NONSTD_PLUGIN_OBJ: $(NONSTD_PLUGIN_OBJ)
	@echo NONSTD_CPP_PLUGIN_OBJ: $(NONSTD_CPP_PLUGIN_OBJ)
	@echo objects: $(objects)
	@echo cppobjects: $(cppobjects)
Vincent Seguin's avatar
Vincent Seguin committed
469

Sam Hocevar's avatar
Sam Hocevar committed
470
471
# ugliest of all, but I have no time to do it -- sam
snapshot:
472
	rm -rf /tmp/vlc-@VLC_VERSION@ /tmp/vlc-@VLC_VERSION@nocss
Sam Hocevar's avatar
   
Sam Hocevar committed
473
	# copy archive in /tmp
474
	find -type d | while read i ; \
Sam Hocevar's avatar
   
Sam Hocevar committed
475
476
		do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
	done
Sam Hocevar's avatar
   
Sam Hocevar committed
477
478
	find debian -mindepth 1 -maxdepth 1 -type d | grep -v CVS | \
		while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
479
480
481
	# 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
482
483
484
485
486
	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
487
	# copy misc files
Sam Hocevar's avatar
   
Sam Hocevar committed
488
489
490
491
	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@/
492
493
494
495
496
497
498
	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
499
500
501
502
503
504
505
	(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
Sam Hocevar's avatar
   
Sam Hocevar committed
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
#	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
#	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 ..
#
#	# clean up
	rm -rf /tmp/vlc-@VLC_VERSION@*
Sam Hocevar's avatar
Sam Hocevar committed
529

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

Benoit Steiner's avatar
   
Benoit Steiner committed
532
FORCE:
533

Sam Hocevar's avatar
Sam Hocevar committed
534
535
536
537
538
#
# Gnome and Framebuffer aliases - don't add new aliases which could bloat
# the namespace
#
gvlc fbvlc: vlc
539
540
	rm -f $@ && ln -s vlc $@

Michel Kaempf's avatar
Michel Kaempf committed
541
542
543
544

#
# Generic rules (see below)
#
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
545
546
547
548
$(cdependancies): %.d: FORCE
	@$(MAKE) -s --no-print-directory -f Makefile.dep $@

$(cppdependancies): %.dpp: FORCE
549
	@$(MAKE) -s --no-print-directory -f Makefile.dep $@
Michel Kaempf's avatar
Michel Kaempf committed
550

551
$(C_OBJ): %.o: Makefile.dep
552
$(C_OBJ): %.o: .dep/%.d
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
553
$(C_OBJ): %.o: %.c
554
	$(CC) $(CFLAGS) -c -o $@ $<
Vincent Seguin's avatar
Vincent Seguin committed
555

Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
556
557
$(CPP_OBJ): %.o: Makefile.dep
$(CPP_OBJ): %.o: .dep/%.dpp
558
$(CPP_OBJ): %.o: %.cpp
559
	$(CC) $(CFLAGS) -c -o $@ $<
560

561
$(ASM_OBJ): %.o: Makefile.dep
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
562
$(ASM_OBJ): %.o: %.S
563
	$(CC) $(CFLAGS) -c -o $@ $<
Michel Kaempf's avatar
Michel Kaempf committed
564

Benoit Steiner's avatar
   
Benoit Steiner committed
565
566
567
568
569
570
$(STD_PLUGIN_OBJ): %.o: Makefile.dep
$(STD_PLUGIN_OBJ): %.o: .dep/%.d
$(STD_PLUGIN_OBJ): %.o: %.c
	$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<

$(PLUGIN_GNOME): %.o: Makefile.dep
Sam Hocevar's avatar
   
Sam Hocevar committed
571
$(PLUGIN_GNOME): %.o: .dep/%.d
Benoit Steiner's avatar
   
Benoit Steiner committed
572
$(PLUGIN_GNOME): %.o: %.c
573
	$(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
Benoit Steiner's avatar
   
Benoit Steiner committed
574
575

$(PLUGIN_GLIDE): %.o: Makefile.dep
Sam Hocevar's avatar
   
Sam Hocevar committed
576
$(PLUGIN_GLIDE): %.o: .dep/%.d
Benoit Steiner's avatar
   
Benoit Steiner committed
577
$(PLUGIN_GLIDE): %.o: %.c
578
	$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
Benoit Steiner's avatar
   
Benoit Steiner committed
579

Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
580
581
582
583
584
$(PLUGIN_BEOS): %.o: Makefile.dep
$(PLUGIN_BEOS): %.o: .dep/%.dpp
$(PLUGIN_BEOS): %.o: %.cpp
	$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<

Benoit Steiner's avatar
   
Benoit Steiner committed
585
#
Sam Hocevar's avatar
   
Sam Hocevar committed
586
# Main application target
Benoit Steiner's avatar
   
Benoit Steiner committed
587
#
Sam Hocevar's avatar
   
Sam Hocevar committed
588

Benoit Steiner's avatar
   
Benoit Steiner committed
589
590
591
592
593
594
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
595
	$(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)	
Benoit Steiner's avatar
   
Benoit Steiner committed
596
endif
597

Sam Hocevar's avatar
   
Sam Hocevar committed
598
599
600
601
#
# Plugin targets
#

602
lib/beos.so: $(PLUGIN_BEOS)
Jean-Marc Dressler's avatar
   
Jean-Marc Dressler committed
603
	$(CC) $(PCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_ -lbe -lgame -lroot
604

605
lib/esd.so: $(PLUGIN_ESD)
606
ifneq (,$(findstring bsd,$(SYS)))
Sam Hocevar's avatar
   
Sam Hocevar committed
607
	$(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
608
else
Sam Hocevar's avatar
   
Sam Hocevar committed
609
	$(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
610
endif
611

612
lib/dsp.so: $(PLUGIN_DSP)
Sam Hocevar's avatar
   
Sam Hocevar committed
613
	$(CC) $(PCFLAGS) -shared -o $@ $^
614

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

618
lib/fb.so: $(PLUGIN_FB)
Sam Hocevar's avatar
   
Sam Hocevar committed
619
	$(CC) $(PCFLAGS) -shared -o $@ $^
620

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

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

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

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

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

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

Sam Hocevar's avatar
   
Sam Hocevar committed
639
640
641
lib/ncurses.so: $(PLUGIN_NCURSES)
	$(CC) $(PCFLAGS) -shared -o $@ $^ -lcurses

642
ifeq ($(SYS),beos)
643
644
645
lib/null.so: $(PLUGIN_NULL)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
646
647
648
649
650
651
652
653
654
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_

655
656
657
lib/dummy.so: $(PLUGIN_DUMMY)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
658
lib/yuv.so: $(PLUGIN_YUV)
Sam Hocevar's avatar
   
Sam Hocevar committed
659
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
660
661

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

Sam Hocevar's avatar
   
Sam Hocevar committed
664
665
666
667
668
669
670
671
672
673
674
675
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
676
677
678
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
   
Sam Hocevar committed
679
lib/idctmmx.so: $(PLUGIN_IDCTMMX)
Sam Hocevar's avatar
   
Sam Hocevar committed
680
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
681
682
683

lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
684
else
685
686
687
lib/null.so: $(PLUGIN_NULL)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
   
Sam Hocevar committed
688
689
690
691
692
693
694
695
696
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 $@ $^

697
698
699
lib/dummy.so: $(PLUGIN_DUMMY)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
   
Sam Hocevar committed
700
701
702
703
704
705
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
706
707
708
709
710
711
712
713
714
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
715
716
717
718
719
720
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
721
lib/idctmmx.so: $(PLUGIN_IDCTMMX)
Sam Hocevar's avatar
   
Sam Hocevar committed
722
	$(CC) $(PCFLAGS) -shared -o $@ $^
723
724
725

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

Michel Kaempf's avatar
Michel Kaempf committed
728
729
730
731
732
################################################################################
# Note on generic rules and dependancies
################################################################################

# Note on dependancies: each .c file is associated with a .d file, which
733
734
# 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
735
736
737
# directory.
# The dep directory should be ignored by CVS.

738
# Note on inclusions: depending of the target, the dependancies files must
Michel Kaempf's avatar
Michel Kaempf committed
739
# or must not be included. The problem is that if we ask make to include a file,
740
741
# 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
742
743
744
745
746
# 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
747
748
# The object Makefile known how to make a .o from a .c, and includes
# dependancies for the target, but only those required.