Makefile.in 20.3 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@
Sam Hocevar's avatar
 
Sam Hocevar committed
21

Sam Hocevar's avatar
 
Sam Hocevar committed
22
exec_prefix=@exec_prefix@
23
prefix=@prefix@
Sam Hocevar's avatar
 
Sam Hocevar committed
24 25 26 27
bindir=@bindir@
datadir=@datadir@
libdir=@libdir@

Benoit Steiner's avatar
 
Benoit Steiner committed
28 29 30
CC=@CC@
SHELL=@SHELL@

Christophe Massiot's avatar
Christophe Massiot committed
31 32 33
LIB_SDL=@LIB_SDL@
LIB_GLIDE=@LIB_GLIDE@
LIB_GGI=@LIB_GGI@
34 35

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

Vincent Seguin's avatar
Vincent Seguin committed
37 38 39 40
################################################################################
# Configuration pre-processing
################################################################################

Vincent Seguin's avatar
Vincent Seguin committed
41
# PROGRAM_OPTIONS is an identification string of the compilation options
42
PROGRAM_OPTIONS = $(SYS) $(ARCH)
Vincent Seguin's avatar
Vincent Seguin committed
43
ifeq ($(DEBUG),1)
Vincent Seguin's avatar
Vincent Seguin committed
44
PROGRAM_OPTIONS += DEBUG
45 46 47 48 49
DEFINE += -DDEBUG
endif
ifeq ($(STATS),1)
PROGRAM_OPTIONS += DEBUG
DEFINE += -DSTATS
Vincent Seguin's avatar
Vincent Seguin committed
50 51 52
endif

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

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

63 64 65 66 67
# 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
68
################################################################################
69
# Tuning and other variables - do not change anything except if you know
Vincent Seguin's avatar
Vincent Seguin committed
70
# exactly what you are doing
Michel Kaempf's avatar
Michel Kaempf committed
71 72 73 74 75
################################################################################

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

Michel Kaempf's avatar
Michel Kaempf committed
78 79 80
#
# Libraries
#
81
ifeq ($(SYS),gnu)
82 83 84
LIB += -lthreads -ldl
endif

85
ifneq (,$(findstring bsd,$(SYS)))
86 87
LIB += -pthread -lgnugetopt
LIB += -L/usr/local/lib
88
endif
89

90
ifneq (,$(findstring linux,$(SYS)))
91 92 93
LIB += -lpthread -ldl
endif

Benoit Steiner's avatar
 
Benoit Steiner committed
94
ifneq (,$(findstring solaris,$(SYS)))
Benoit Steiner's avatar
Benoit Steiner committed
95
LIB += -ldl -lsocket -lnsl -lpthread
Benoit Steiner's avatar
 
Benoit Steiner committed
96 97
endif

98
ifeq ($(SYS),beos)
99 100
LIB += -lbe -lroot -lgame
else
101
LIB += -lm
102
endif
103

Michel Kaempf's avatar
Michel Kaempf committed
104
#
Benoit Steiner's avatar
 
Benoit Steiner committed
105
# C compiler flags: mainstream compilation
Michel Kaempf's avatar
Michel Kaempf committed
106
#
107 108 109 110
CFLAGS += $(DEFINE) $(INCLUDE)
CFLAGS += -Wall -Winline
CFLAGS += -D_REENTRANT
CFLAGS += -D_GNU_SOURCE
Michel Kaempf's avatar
Michel Kaempf committed
111

112
# flags needed for clean beos compilation
Sam Hocevar's avatar
Sam Hocevar committed
113
ifeq ($(SYS),beos)
114
CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
Sam Hocevar's avatar
Sam Hocevar committed
115
endif
116

Michel Kaempf's avatar
Michel Kaempf committed
117
# Optimizations : don't compile debug versions with them
118
ifeq ($(OPTIMS),1)
119 120
CFLAGS += -O3
CFLAGS += -ffast-math -funroll-loops
121
CFLAGS += -fomit-frame-pointer
122

123
# Optimizations for x86 familiy
124
ifneq (,$(findstring 86,$(ARCH)))
125
# Optional Pentium Pro optimizations
126
ifneq (,$(findstring ppro,$(ARCH)))
127
CFLAGS += -march=pentiumpro -mcpu=pentiumpro
128
else
129
CFLAGS += -march=pentium -mcpu=pentium
130
endif
Vincent Seguin's avatar
Vincent Seguin committed
131
endif
132

Vincent Seguin's avatar
Vincent Seguin committed
133
# Optimizations for PowerPC
134 135 136 137 138 139 140
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
141
endif
Michel Kaempf's avatar
Michel Kaempf committed
142

143
# Optimizations for Sparc
144
ifneq (,$(findstring sparc,$(ARCH)))
145
CFLAGS += -mhard-float
146 147
endif

Benoit Steiner's avatar
 
Benoit Steiner committed
148
#end of optimisations
149 150
endif

151
# Optional MMX optimizations for x86
152 153
ifneq (,$(findstring mmx,$(ARCH)))
CFLAGS += -DHAVE_MMX
154 155
endif

Benoit Steiner's avatar
 
Benoit Steiner committed
156 157 158 159
#
# C compiler flags: plugin compilation
#
PCFLAGS += -fPIC
160

Michel Kaempf's avatar
Michel Kaempf committed
161 162 163 164 165 166 167 168 169 170 171
#
# C compiler flags: dependancies
#
DCFLAGS += $(INCLUDE)
DCFLAGS += -MM

#
# C compiler flags: linking
#
LCFLAGS += $(LIB)
LCFLAGS += -Wall
Vincent Seguin's avatar
Vincent Seguin committed
172
#LCFLAGS += -s
Michel Kaempf's avatar
Michel Kaempf committed
173 174

#
Benoit Steiner's avatar
 
Benoit Steiner committed
175
# Debugging and profiling support (unless optimisations are active)
Michel Kaempf's avatar
Michel Kaempf committed
176
#
Benoit Steiner's avatar
 
Benoit Steiner committed
177
ifneq ($(OPTIMS),1)
178 179
CFLAGS += -g
endif
Michel Kaempf's avatar
Michel Kaempf committed
180 181 182 183 184 185

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

#
Vincent Seguin's avatar
Vincent Seguin committed
186
# C Objects
Michel Kaempf's avatar
Michel Kaempf committed
187
# 
Benoit Steiner's avatar
 
Benoit Steiner committed
188 189 190 191 192
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
193
		src/interface/intf_plst.o \
Sam Hocevar's avatar
 
Sam Hocevar committed
194
		src/interface/intf_channels.o \
Benoit Steiner's avatar
 
Benoit Steiner committed
195 196
		src/interface/intf_console.o

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

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 \
221 222
		src/ac3_decoder/ac3_downmix.o \
		src/ac3_decoder/ac3_downmix_c.o
Benoit Steiner's avatar
 
Benoit Steiner committed
223 224 225 226

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

Sam Hocevar's avatar
 
Sam Hocevar committed
227 228 229 230 231
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
232 233 234 235 236 237 238 239 240 241

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
242

Sam Hocevar's avatar
 
Sam Hocevar committed
243
VIDEO_DECODER =	src/video_decoder/video_decoder.o
Benoit Steiner's avatar
 
Benoit Steiner committed
244 245 246 247

MISC =		src/misc/mtime.o \
		src/misc/tests.o \
		src/misc/rsc_files.o \
Sam Hocevar's avatar
 
Sam Hocevar committed
248
		src/misc/modules.o \
Sam Hocevar's avatar
 
Sam Hocevar committed
249
		src/misc/netutils.o
Benoit Steiner's avatar
 
Benoit Steiner committed
250 251 252 253 254 255 256 257 258


C_OBJ =		$(INTERFACE) \
		$(INPUT) \
		$(VIDEO_OUTPUT) \
		$(AUDIO_OUTPUT) \
		$(AC3_DECODER) \
		$(LPCM_DECODER) \
		$(AUDIO_DECODER) \
259
		$(SPU_DECODER) \
Benoit Steiner's avatar
 
Benoit Steiner committed
260 261 262 263 264
		$(GEN_DECODER) \
		$(VIDEO_PARSER) \
		$(VIDEO_DECODER) \
		$(MISC)

Michel Kaempf's avatar
Michel Kaempf committed
265

Benoit Steiner's avatar
 
Benoit Steiner committed
266 267 268
#
# CPP Objects
# 
269
ifeq ($(SYS),beos)
Benoit Steiner's avatar
 
Benoit Steiner committed
270
CPP_OBJ =	src/misc/beos_specific.o
271 272
endif

Vincent Seguin's avatar
Vincent Seguin committed
273 274 275
#
# Assembler Objects
# 
276 277
ifneq (,$(findstring 86,$(ARCH)))
ifneq (,$(findstring mmx,$(ARCH)))
278
ASM_OBJ =		
Vincent Seguin's avatar
Vincent Seguin committed
279
endif
280
endif
Vincent Seguin's avatar
Vincent Seguin committed
281

282 283 284
#
# Plugins
#
Sam Hocevar's avatar
 
Sam Hocevar committed
285 286
PLUGIN_ALSA =	plugins/alsa/alsa.o \
		plugins/alsa/aout_alsa.o
Sam Hocevar's avatar
 
Sam Hocevar committed
287

Benoit Steiner's avatar
 
Benoit Steiner committed
288
PLUGIN_BEOS =	plugins/beos/beos.o \
289
		plugins/beos/aout_beos.o \
290 291
		plugins/beos/intf_beos.o \
		plugins/beos/vout_beos.o
292

Benoit Steiner's avatar
 
Benoit Steiner committed
293
PLUGIN_DSP =	plugins/dsp/dsp.o \
294 295
		plugins/dsp/aout_dsp.o

Benoit Steiner's avatar
 
Benoit Steiner committed
296
PLUGIN_DUMMY =	plugins/dummy/dummy.o \
297
		plugins/dummy/aout_dummy.o \
298 299 300
		plugins/dummy/intf_dummy.o \
		plugins/dummy/vout_dummy.o

Sam Hocevar's avatar
 
Sam Hocevar committed
301 302
PLUGIN_DVD =	plugins/dvd/dvd.o \
		plugins/dvd/input_dvd.o \
303
		plugins/dvd/dvd_netlist.o \
Sam Hocevar's avatar
 
Sam Hocevar committed
304
		plugins/dvd/dvd_ioctl.o \
Sam Hocevar's avatar
 
Sam Hocevar committed
305
		plugins/dvd/dvd_ifo.o \
306
		plugins/dvd/dvd_udf.o \
Sam Hocevar's avatar
 
Sam Hocevar committed
307
		plugins/dvd/dvd_css.o
Sam Hocevar's avatar
 
Sam Hocevar committed
308

Benoit Steiner's avatar
 
Benoit Steiner committed
309
PLUGIN_ESD =	plugins/esd/esd.o \
310
		plugins/esd/aout_esd.o
311

Benoit Steiner's avatar
 
Benoit Steiner committed
312
PLUGIN_FB =	plugins/fb/fb.o \
313 314
		plugins/fb/vout_fb.o

Benoit Steiner's avatar
 
Benoit Steiner committed
315
PLUGIN_GGI =	plugins/ggi/ggi.o \
316 317
		plugins/ggi/vout_ggi.o

Benoit Steiner's avatar
 
Benoit Steiner committed
318
PLUGIN_GLIDE =	plugins/glide/glide.o \
319 320
		plugins/glide/vout_glide.o

Sam Hocevar's avatar
 
Sam Hocevar committed
321 322 323 324 325 326
PLUGIN_GTK =	plugins/gtk/gtk.o \
		plugins/gtk/intf_gtk.o \
		plugins/gtk/gtk_callbacks.o \
		plugins/gtk/gtk_interface.o \
		plugins/gtk/gtk_support.o

Benoit Steiner's avatar
 
Benoit Steiner committed
327
PLUGIN_GNOME =	plugins/gnome/gnome.o \
328
		plugins/gnome/intf_gnome.o \
Sam Hocevar's avatar
 
Sam Hocevar committed
329 330 331
		plugins/gnome/gnome_callbacks.o \
		plugins/gnome/gnome_interface.o \
		plugins/gnome/gnome_support.o
332

Sam Hocevar's avatar
 
Sam Hocevar committed
333 334 335 336
PLUGIN_KDE =	plugins/kde/kde.o \
		plugins/kde/intf_kde.o \
		plugins/kde/kvlc.o

Sam Hocevar's avatar
 
Sam Hocevar committed
337 338
PLUGIN_IDCT =	plugins/idct/idct.o \
		plugins/idct/idct_common.o
339

Sam Hocevar's avatar
 
Sam Hocevar committed
340 341
PLUGIN_IDCTCLASSIC =	plugins/idct/idctclassic.o \
			plugins/idct/idct_common.o
342

Sam Hocevar's avatar
 
Sam Hocevar committed
343 344
PLUGIN_IDCTMMX =	plugins/idct/idctmmx.o \
			plugins/idct/idct_common.o
345

Sam Hocevar's avatar
 
Sam Hocevar committed
346 347 348 349 350
PLUGIN_IDCTMMXEXT =	plugins/idct/idctmmxext.o \
			plugins/idct/idct_common.o

PLUGIN_MGA =	plugins/mga/mga.o \
		plugins/mga/vout_mga.o
351

Sam Hocevar's avatar
 
Sam Hocevar committed
352 353 354 355 356 357 358 359 360 361 362 363
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
364 365 366
PLUGIN_NCURSES =	plugins/text/ncurses.o \
			plugins/text/intf_ncurses.o

Sam Hocevar's avatar
 
Sam Hocevar committed
367
PLUGIN_NULL =	plugins/null/null.o
Sam Hocevar's avatar
 
Sam Hocevar committed
368

Sam Hocevar's avatar
 
Sam Hocevar committed
369 370
PLUGIN_PS =	plugins/mpeg/ps.o \
		plugins/mpeg/input_ps.o
Sam Hocevar's avatar
 
Sam Hocevar committed
371

Sam Hocevar's avatar
 
Sam Hocevar committed
372 373 374
PLUGIN_SDL =	plugins/sdl/sdl.o \
		plugins/sdl/vout_sdl.o \
		plugins/sdl/aout_sdl.o 
Sam Hocevar's avatar
 
Sam Hocevar committed
375

Sam Hocevar's avatar
 
Sam Hocevar committed
376 377
PLUGIN_TS =	plugins/mpeg/ts.o \
		plugins/mpeg/input_ts.o
378

Sam Hocevar's avatar
 
Sam Hocevar committed
379 380
PLUGIN_X11=	plugins/x11/x11.o \
		plugins/x11/vout_x11.o
Benoit Steiner's avatar
 
Benoit Steiner committed
381

Sam Hocevar's avatar
 
Sam Hocevar committed
382 383 384 385 386 387 388 389 390 391
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
392 393
		$(PLUGIN_DSP) \
		$(PLUGIN_DUMMY) \
Sam Hocevar's avatar
 
Sam Hocevar committed
394
		$(PLUGIN_DVD) \
Benoit Steiner's avatar
 
Benoit Steiner committed
395 396 397
		$(PLUGIN_ESD) \
		$(PLUGIN_FB) \
		$(PLUGIN_GGI) \
Sam Hocevar's avatar
 
Sam Hocevar committed
398
		$(PLUGIN_IDCT) \
399
		$(PLUGIN_IDCTCLASSIC) \
Sam Hocevar's avatar
 
Sam Hocevar committed
400
		$(PLUGIN_IDCTMMX) \
401
		$(PLUGIN_IDCTMMXEXT) \
Sam Hocevar's avatar
 
Sam Hocevar committed
402 403 404 405
		$(PLUGIN_MGA) \
		$(PLUGIN_MOTION) \
		$(PLUGIN_MOTIONMMX) \
		$(PLUGIN_MOTIONMMXEXT) \
Sam Hocevar's avatar
 
Sam Hocevar committed
406
		$(PLUGIN_NCURSES) \
Sam Hocevar's avatar
 
Sam Hocevar committed
407 408
		$(PLUGIN_NULL) \
		$(PLUGIN_PS) \
Benoit Steiner's avatar
 
Benoit Steiner committed
409
		$(PLUGIN_SDL) \
Sam Hocevar's avatar
 
Sam Hocevar committed
410 411 412 413 414
		$(PLUGIN_TS) \
		$(PLUGIN_X11) \
		$(PLUGIN_YUV) \
		$(PLUGIN_YUVMMX)

Sam Hocevar's avatar
 
Sam Hocevar committed
415
# list duplicates
Sam Hocevar's avatar
 
Sam Hocevar committed
416 417
STD_PLUGIN_COMMON =	plugins/idct/idct_common.o \
			plugins/motion/vdec_motion_common.o
Sam Hocevar's avatar
 
Sam Hocevar committed
418

Sam Hocevar's avatar
 
Sam Hocevar committed
419
# filter out duplicates from the plugin object lists
Sam Hocevar's avatar
 
Sam Hocevar committed
420
STD_PLUGIN_OBJ :=	$(filter-out $(STD_PLUGIN_COMMON), \
Sam Hocevar's avatar
 
Sam Hocevar committed
421
				 $(STD_PLUGIN_OBJ)) $(STD_PLUGIN_COMMON)
Sam Hocevar's avatar
 
Sam Hocevar committed
422

Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
423 424
NONSTD_PLUGIN_OBJ = \
		$(PLUGIN_GLIDE) \
Sam Hocevar's avatar
 
Sam Hocevar committed
425
		$(PLUGIN_GTK) \
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
426 427 428
		$(PLUGIN_GNOME)

NONSTD_CPP_PLUGIN_OBJ = \
Sam Hocevar's avatar
 
Sam Hocevar committed
429 430
		$(PLUGIN_BEOS) \
		$(PLUGIN_KDE)
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
431

Michel Kaempf's avatar
Michel Kaempf committed
432 433 434
#
# Other lists of files
#
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
435 436 437 438
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
439 440 441 442 443 444 445 446 447 448 449

# All symbols must be exported
export

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

#
# Virtual targets
#
450
all: vlc @ALIASES@ plugins
Michel Kaempf's avatar
Michel Kaempf committed
451 452

clean:
453
	rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
454
	rm -f plugins/*/*.o src/*/*.o lib/*.so
Sam Hocevar's avatar
 
Sam Hocevar committed
455
	rm -f vlc kvlc gvlc
Michel Kaempf's avatar
Michel Kaempf committed
456 457

distclean: clean
458
	rm -f src/*/*.o plugins/*/*.o **/*~ *.log
459 460
	rm -f Makefile include/defs.h include/config.h
	rm -f config.status config.cache config.log
461
	rm -f gmon.out core build-stamp
462
	rm -rf .dep
463 464

install:
Sam Hocevar's avatar
 
Sam Hocevar committed
465 466
	mkdir -p $(DESTDIR)$(bindir)
	$(INSTALL) vlc $(DESTDIR)$(bindir)
Benoit Steiner's avatar
 
Benoit Steiner committed
467
# ugly
Sam Hocevar's avatar
 
Sam Hocevar committed
468 469 470 471 472 473
	for alias in "" @ALIASES@ ; do if test $$alias ; then rm -f $(DESTDIR)$(bindir)/$$alias && ln -s vlc $(DESTDIR)$(bindir)/$$alias ; fi ; done
	mkdir -p $(DESTDIR)$(libdir)/videolan/vlc
	$(INSTALL) -m 644 $(PLUGINS:%=lib/%.so) $(DESTDIR)$(libdir)/videolan/vlc
	mkdir -p $(DESTDIR)$(datadir)/videolan
	$(INSTALL) -m 644 share/*.psf $(DESTDIR)$(datadir)/videolan
	$(INSTALL) -m 644 share/*.png $(DESTDIR)$(datadir)/videolan
Michel Kaempf's avatar
Michel Kaempf committed
474

Vincent Seguin's avatar
Vincent Seguin committed
475
show:
476
	@echo CC: $(CC)
477
	@echo CFLAGS: $(CFLAGS)
478
	@echo DCFLAGS: $(DCFLAGS)
479
	@echo LCFLAGS: $(LCFLAGS)
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
480 481
	@echo C_OBJ: $(C_OBJ)
	@echo CPP_OBJ: $(CPP_OBJ)
Sam Hocevar's avatar
 
Sam Hocevar committed
482
	@echo STD_PLUGIN_OBJ: $(STD_PLUGIN_OBJ)
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
483 484 485 486
	@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
487

Sam Hocevar's avatar
Sam Hocevar committed
488 489
# ugliest of all, but I have no time to do it -- sam
snapshot:
Sam Hocevar's avatar
 
Sam Hocevar committed
490
	rm -rf /tmp/vlc-@VLC_VERSION@* /tmp/vlc-@VLC_VERSION@nocss*
Sam Hocevar's avatar
 
Sam Hocevar committed
491
	# copy archive in /tmp
492
	find -type d | while read i ; \
Sam Hocevar's avatar
 
Sam Hocevar committed
493 494
		do mkdir -p /tmp/vlc-@VLC_VERSION@/$$i ; \
	done
Sam Hocevar's avatar
 
Sam Hocevar committed
495 496
	find debian -mindepth 1 -maxdepth 1 -type d | grep -v CVS | \
		while read i ; do rm -rf /tmp/vlc-@VLC_VERSION@/$$i ; done
497 498 499
	# 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
500 501 502 503 504
	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
505
	# copy misc files
Sam Hocevar's avatar
 
Sam Hocevar committed
506
	cp vlc.spec AUTHORS COPYING ChangeLog CONTRIBUTORS INSTALL README TODO \
Sam Hocevar's avatar
 
Sam Hocevar committed
507 508 509
		Makefile.in Makefile.dep configure configure.in install-sh \
		config.sub config.guess todo.pl \
			/tmp/vlc-@VLC_VERSION@/
Sam Hocevar's avatar
 
Sam Hocevar committed
510
	for file in control vlc-gtk.menu vlc.copyright vlc.docs changelog \
511 512 513 514 515 516
		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
517 518 519 520 521 522 523
	(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
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
	for x in plugins/dvd/dvd.c plugins/dvd/dvd_css.c ; do \
	rm -f /tmp/vlc-@VLC_VERSION@/$$x ; \
	perl -ne 'if (/^#e(lse|ndif).*HAVE_CSS/) { $$i=0; } \
			if (/^#if.*HAVE_CSS/) { $$i=1; } \
			elsif (!$$i && !/^#.*HAVE_CSS/) { print $$_; }' \
		< $$x >| /tmp/vlc-@VLC_VERSION@/$$x ; \
	done
	rm -f /tmp/vlc-@VLC_VERSION@/plugins/dvd/dvd_csstables.c
	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
Sam Hocevar's avatar
 
Sam Hocevar committed
546
	rm -rf /tmp/vlc-@VLC_VERSION@*
Sam Hocevar's avatar
Sam Hocevar committed
547

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

Benoit Steiner's avatar
 
Benoit Steiner committed
550
FORCE:
551

Sam Hocevar's avatar
Sam Hocevar committed
552
#
Sam Hocevar's avatar
 
Sam Hocevar committed
553
# GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat
Sam Hocevar's avatar
Sam Hocevar committed
554 555
# the namespace
#
Sam Hocevar's avatar
 
Sam Hocevar committed
556
gvlc kvlc: vlc
557 558
	rm -f $@ && ln -s vlc $@

Michel Kaempf's avatar
Michel Kaempf committed
559 560 561 562

#
# Generic rules (see below)
#
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
563 564 565 566
$(cdependancies): %.d: FORCE
	@$(MAKE) -s --no-print-directory -f Makefile.dep $@

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

569
$(C_OBJ): %.o: Makefile.dep
570
$(C_OBJ): %.o: .dep/%.d
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
571
$(C_OBJ): %.o: %.c
572
	$(CC) $(CFLAGS) -c -o $@ $<
Vincent Seguin's avatar
Vincent Seguin committed
573

Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
574 575
$(CPP_OBJ): %.o: Makefile.dep
$(CPP_OBJ): %.o: .dep/%.dpp
576
$(CPP_OBJ): %.o: %.cpp
577
	$(CC) $(CFLAGS) -c -o $@ $<
578

579
$(ASM_OBJ): %.o: Makefile.dep
Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
580
$(ASM_OBJ): %.o: %.S
581
	$(CC) $(CFLAGS) -c -o $@ $<
Michel Kaempf's avatar
Michel Kaempf committed
582

Benoit Steiner's avatar
 
Benoit Steiner committed
583 584 585 586 587
$(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
588 589 590 591 592
$(PLUGIN_GTK): %.o: Makefile.dep
$(PLUGIN_GTK): %.o: .dep/%.d
$(PLUGIN_GTK): %.o: %.c
	$(CC) $(CFLAGS) $(PCFLAGS) `gtk-config --cflags gtk` -c -o $@ $<

Benoit Steiner's avatar
 
Benoit Steiner committed
593
$(PLUGIN_GNOME): %.o: Makefile.dep
Sam Hocevar's avatar
 
Sam Hocevar committed
594
$(PLUGIN_GNOME): %.o: .dep/%.d
Benoit Steiner's avatar
 
Benoit Steiner committed
595
$(PLUGIN_GNOME): %.o: %.c
596
	$(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
Benoit Steiner's avatar
 
Benoit Steiner committed
597 598

$(PLUGIN_GLIDE): %.o: Makefile.dep
Sam Hocevar's avatar
 
Sam Hocevar committed
599
$(PLUGIN_GLIDE): %.o: .dep/%.d
Benoit Steiner's avatar
 
Benoit Steiner committed
600
$(PLUGIN_GLIDE): %.o: %.c
601
	$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/glide -c -o $@ $<
Benoit Steiner's avatar
 
Benoit Steiner committed
602

Sam Hocevar's avatar
 
Sam Hocevar committed
603 604 605 606 607
$(PLUGIN_KDE): %.o: Makefile.dep
$(PLUGIN_KDE): %.o: .dep/%.dpp
$(PLUGIN_KDE): %.o: %.cpp
	$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/include/kde -I/usr/include/qt -fno-rtti -c -o $@ $<

Jean-Marc Dressler's avatar
 
Jean-Marc Dressler committed
608 609 610 611 612
$(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
613
#
Sam Hocevar's avatar
 
Sam Hocevar committed
614
# Main application target
Benoit Steiner's avatar
 
Benoit Steiner committed
615
#
Sam Hocevar's avatar
 
Sam Hocevar committed
616

Benoit Steiner's avatar
 
Benoit Steiner committed
617 618 619 620 621 622
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
623
	$(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic @DYNAMIC_FLAG@ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)	
Benoit Steiner's avatar
 
Benoit Steiner committed
624
endif
625

Sam Hocevar's avatar
 
Sam Hocevar committed
626 627 628 629
#
# Plugin targets
#

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

633
lib/esd.so: $(PLUGIN_ESD)
634
ifneq (,$(findstring bsd,$(SYS)))
Sam Hocevar's avatar
 
Sam Hocevar committed
635
	$(CC) $(PCFLAGS) -shared -o $@ $^ -lesd
636
else
Sam Hocevar's avatar
 
Sam Hocevar committed
637
	$(CC) $(PCFLAGS) -shared -o $@ $^ -laudiofile -lesd
638
endif
639

640
lib/dsp.so: $(PLUGIN_DSP)
Sam Hocevar's avatar
 
Sam Hocevar committed
641
	$(CC) $(PCFLAGS) -shared -o $@ $^
642

Sam Hocevar's avatar
 
Sam Hocevar committed
643 644 645
lib/kde.so: $(PLUGIN_KDE)
	$(CC) $(PCFLAGS) -shared -o $@ $^ -lkdeui -lkdecore -lqt -ldl

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

649
lib/fb.so: $(PLUGIN_FB)
Sam Hocevar's avatar
 
Sam Hocevar committed
650
	$(CC) $(PCFLAGS) -shared -o $@ $^
651

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

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

Sam Hocevar's avatar
 
Sam Hocevar committed
658 659 660
lib/gtk.so: $(PLUGIN_GTK)
	$(CC) $(PCFLAGS) -shared -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'`

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

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

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

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

Sam Hocevar's avatar
 
Sam Hocevar committed
673
lib/ncurses.so: $(PLUGIN_NCURSES)
Sam Hocevar's avatar
 
Sam Hocevar committed
674
	$(CC) $(PCFLAGS) -shared -o $@ $^ -lncurses
Sam Hocevar's avatar
 
Sam Hocevar committed
675

676
ifeq ($(SYS),beos)
677 678 679
lib/null.so: $(PLUGIN_NULL)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
 
Sam Hocevar committed
680 681 682 683 684 685 686 687 688
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_

689 690 691
lib/dummy.so: $(PLUGIN_DUMMY)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
 
Sam Hocevar committed
692
lib/yuv.so: $(PLUGIN_YUV)
Sam Hocevar's avatar
 
Sam Hocevar committed
693
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
694 695

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

Sam Hocevar's avatar
 
Sam Hocevar committed
698 699 700 701 702 703 704 705 706 707 708 709
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
710 711 712
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_

Sam Hocevar's avatar
 
Sam Hocevar committed
713
lib/idctmmx.so: $(PLUGIN_IDCTMMX)
Sam Hocevar's avatar
 
Sam Hocevar committed
714
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
715 716 717

lib/idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
	$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
718
else
719 720 721
lib/null.so: $(PLUGIN_NULL)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
 
Sam Hocevar committed
722 723 724 725 726 727 728 729 730
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 $@ $^

731 732 733
lib/dummy.so: $(PLUGIN_DUMMY)
	$(CC) $(PCFLAGS) -shared -o $@ $^

Sam Hocevar's avatar
 
Sam Hocevar committed
734 735 736 737 738 739
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
740 741 742 743 744 745 746 747 748
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
749 750 751 752 753 754
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
755
lib/idctmmx.so: $(PLUGIN_IDCTMMX)
Sam Hocevar's avatar
 
Sam Hocevar committed
756
	$(CC) $(PCFLAGS) -shared -o $@ $^
757 758 759

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

Michel Kaempf's avatar
Michel Kaempf committed
762 763 764 765 766
################################################################################
# Note on generic rules and dependancies
################################################################################

# Note on dependancies: each .c file is associated with a .d file, which
767 768
# 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
769 770 771
# directory.
# The dep directory should be ignored by CVS.

772
# Note on inclusions: depending of the target, the dependancies files must
Michel Kaempf's avatar
Michel Kaempf committed
773
# or must not be included. The problem is that if we ask make to include a file,
774 775
# 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
776 777 778 779 780
# 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
781 782
# The object Makefile known how to make a .o from a .c, and includes
# dependancies for the target, but only those required.