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

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

13
# Audio output settings
14
AOUT += dsp
15
#AOUT += esd
16
# Not yet supported
17
#AOUT += alsa
18
# Fallback method that should always work
19
AOUT += dummy
20

Vincent Seguin's avatar
Vincent Seguin committed
21
# Video output settings
22
VOUT += x11
23 24 25 26
#VOUT += fb
#VOUT += ggi
#VOUT += glide
# Not yet supported
27
#VOUT += gnome
28
#VOUT += beos
29 30 31 32 33
#VOUT += dga
# Fallback method that should always work
VOUT += dummy

# Interface settings
34
INTF += x11
35 36 37
#INTF += fb
#INTF += ggi
#INTF += glide
38
# Not yet supported
39
#INTF += gnome
40
#INTF += beos
41
#INTF += dga
42
# Fallback method that should always work
43
INTF += dummy
Vincent Seguin's avatar
Vincent Seguin committed
44

45 46
# Target architecture
ARCH=X86
Vincent Seguin's avatar
Vincent Seguin committed
47
#ARCH=PPC
48
#ARCH=SPARC
Vincent Seguin's avatar
Vincent Seguin committed
49

Vincent Seguin's avatar
Vincent Seguin committed
50 51
# Target operating system
SYS=LINUX
52
#SYS=GNU
Vincent Seguin's avatar
Vincent Seguin committed
53 54 55
#SYS=BSD
#SYS=BEOS

56
# For x86 architecture, choose MMX support
57
ARCH += MMX
58 59
# For x86 architecture, optimize for Pentium Pro
# (choose NO if you get `Invalid instruction' errors)
60
ARCH += PPRO
61

62
# Decoder choice - ?? old decoder will be removed soon
63 64
#DECODER=old
DECODER=new
Vincent Seguin's avatar
Vincent Seguin committed
65

66
# Debugging mode on or off (set to 1 to activate)
67
DEBUG=0
68

Vincent Seguin's avatar
Vincent Seguin committed
69 70
#----------------- do not change anything below this line ----------------------

71 72 73
prefix=@prefix@
INSTALL=@INSTALL@

Vincent Seguin's avatar
Vincent Seguin committed
74 75 76 77
################################################################################
# Configuration pre-processing
################################################################################

Vincent Seguin's avatar
Vincent Seguin committed
78
# PROGRAM_OPTIONS is an identification string of the compilation options
79
PROGRAM_OPTIONS = $(SYS) $(ARCH)
80
ifeq ($(DEBUG),1)
Vincent Seguin's avatar
Vincent Seguin committed
81 82 83 84
PROGRAM_OPTIONS += DEBUG
endif

# PROGRAM_BUILD is a complete identification of the build
85 86
# ( we can't use fancy options with date since OSes like Solaris
# or FreeBSD have strange date implementations )
87 88 89
PROGRAM_BUILD = `date` $(USER)
# XXX: beos does not support hostname
#PROGRAM_BUILD = `date` $(USER)@`hostname`
Vincent Seguin's avatar
Vincent Seguin committed
90 91

# DEFINE will contain some of the constants definitions decided in Makefile, 
92
# including ARCH_xx and SYS_xx. It will be passed to C compiler.
93
DEFINE += -DARCH_$(shell echo $(ARCH) | cut -f1 -d' ')
Vincent Seguin's avatar
Vincent Seguin committed
94
DEFINE += -DSYS_$(SYS)
95 96
DEFINE += -DPLUGIN_PATH="\"$(prefix)/lib/videolan/vlc\""
DEFINE += -DDATA_PATH="\"$(prefix)/share/videolan/vlc\""
97 98
#DEFINE += -DPROGRAM_OPTIONS="\"$(shell echo $(PROGRAM_OPTIONS) | tr 'A-Z' 'a-z')\""
#DEFINE += -DPROGRAM_BUILD="\"$(PROGRAM_BUILD)\""
99
ifeq ($(DEBUG),1)
Vincent Seguin's avatar
Vincent Seguin committed
100 101
DEFINE += -DDEBUG
endif
Vincent Seguin's avatar
Vincent Seguin committed
102

Michel Kaempf's avatar
Michel Kaempf committed
103
################################################################################
104
# Tuning and other variables - do not change anything except if you know
Vincent Seguin's avatar
Vincent Seguin committed
105
# exactly what you are doing
Michel Kaempf's avatar
Michel Kaempf committed
106 107 108 109 110
################################################################################

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

Michel Kaempf's avatar
Michel Kaempf committed
113 114 115
#
# Libraries
#
116 117

ifeq ($(SYS),GNU)
118 119 120 121 122 123
LIB += -lthreads -ldl
endif

ifeq ($(SYS),BSD)
LIB += -pthread -lgnugetopt
LIB += -L/usr/local/lib
124
endif
125 126 127 128 129

ifeq ($(SYS),LINUX)
LIB += -lpthread -ldl
endif

130 131 132 133
ifeq ($SYS),BEOS)
LIB += -llibroot -llibgame -llibbe
endif

134
LIB += -lm
135

Michel Kaempf's avatar
Michel Kaempf committed
136 137 138
#
# C compiler flags: compilation
#
Vincent Seguin's avatar
Vincent Seguin committed
139
CCFLAGS += $(DEFINE) $(INCLUDE)
Michel Kaempf's avatar
Michel Kaempf committed
140 141 142 143 144
CCFLAGS += -Wall
CCFLAGS += -D_REENTRANT
CCFLAGS += -D_GNU_SOURCE

# Optimizations : don't compile debug versions with them
145 146
CCFLAGS += -O6
CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
147
CCFLAGS += -fomit-frame-pointer
148

149
# Optimizations for x86 familiy
150
ifneq (,$(findstring X86,$(ARCH)))
151
CCFLAGS += -malign-double
152
#CCFLAGS += -march=pentium
153 154
# Eventual Pentium Pro optimizations
ifneq (,$(findstring PPRO,$(ARCH)))
155
ifneq ($(SYS), BSD)
156 157
CCFLAGS += -march=pentiumpro
endif
158
endif
159
# Eventual MMX optimizations for x86
160
ifneq (,$(findstring MMX,$(ARCH)))
161 162
CFLAGS += -DHAVE_MMX
endif
Vincent Seguin's avatar
Vincent Seguin committed
163
endif
164

Vincent Seguin's avatar
Vincent Seguin committed
165
# Optimizations for PowerPC
166
ifneq (,$(findstring PPC,$(ARCH)))
Vincent Seguin's avatar
Vincent Seguin committed
167 168
CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
endif
Michel Kaempf's avatar
Michel Kaempf committed
169

170
# Optimizations for Sparc
171
ifneq (,$(findstring SPARC,$(ARCH)))
172 173 174
CCFLAGS += -mhard-float
endif

Michel Kaempf's avatar
Michel Kaempf committed
175 176 177 178 179 180 181 182 183 184 185
#
# C compiler flags: dependancies
#
DCFLAGS += $(INCLUDE)
DCFLAGS += -MM

#
# C compiler flags: linking
#
LCFLAGS += $(LIB)
LCFLAGS += -Wall
Vincent Seguin's avatar
Vincent Seguin committed
186
#LCFLAGS += -s
Michel Kaempf's avatar
Michel Kaempf committed
187 188 189 190

#
# Additionnal debugging flags
#
Vincent Seguin's avatar
Vincent Seguin committed
191 192

# Debugging support
193
ifeq ($(DEBUG),1)
Vincent Seguin's avatar
Vincent Seguin committed
194 195 196
CFLAGS += -g
#CFLAGS += -pg
endif
Michel Kaempf's avatar
Michel Kaempf committed
197 198 199 200 201 202

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

#
Vincent Seguin's avatar
Vincent Seguin committed
203
# C Objects
Michel Kaempf's avatar
Michel Kaempf committed
204 205 206 207 208 209
# 
interface_obj =  		interface/main.o \
						interface/interface.o \
						interface/intf_msg.o \
						interface/intf_cmd.o \
						interface/intf_ctrl.o \
210
						interface/intf_console.o
Michel Kaempf's avatar
Michel Kaempf committed
211 212 213 214 215 216 217 218 219 220

input_obj =         		input/input_vlan.o \
						input/input_file.o \
						input/input_netlist.o \
						input/input_network.o \
						input/input_ctrl.o \
						input/input_pcr.o \
						input/input_psi.o \
						input/input.o

221
audio_output_obj = 		audio_output/audio_output.o
Michel Kaempf's avatar
Michel Kaempf committed
222

Vincent Seguin's avatar
Vincent Seguin committed
223
video_output_obj = 		video_output/video_output.o \
224
						video_output/video_text.o \
Sam Hocevar's avatar
Sam Hocevar committed
225
						video_output/video_spu.o \
226
						video_output/video_yuv.o
Michel Kaempf's avatar
Michel Kaempf committed
227

228 229
ac3_decoder_obj =		ac3_decoder/ac3_decoder_thread.o \
						ac3_decoder/ac3_decoder.o \
230 231 232 233 234 235 236
						ac3_decoder/ac3_parse.o \
						ac3_decoder/ac3_exponent.o \
						ac3_decoder/ac3_bit_allocate.o \
						ac3_decoder/ac3_mantissa.o \
						ac3_decoder/ac3_rematrix.o \
						ac3_decoder/ac3_imdct.o \
						ac3_decoder/ac3_downmix.o
Michel Kaempf's avatar
Michel Kaempf committed
237

238 239
audio_decoder_obj =		audio_decoder/audio_decoder_thread.o \
						audio_decoder/audio_decoder.o \
240
						audio_decoder/audio_math.o
Michel Kaempf's avatar
Michel Kaempf committed
241

242
spu_decoder_obj =		spu_decoder/spu_decoder.o
243

Vincent Seguin's avatar
Vincent Seguin committed
244 245
#??generic_decoder_obj =		generic_decoder/generic_decoder.o
# remeber to add it to OBJ 
246

247
ifeq ($(DECODER),old)
248
CFLAGS += -DOLD_DECODER
249 250 251 252 253 254 255 256 257 258
video_decoder_obj =		video_decoder_ref/video_decoder.o \
						video_decoder_ref/display.o \
						video_decoder_ref/getblk.o \
						video_decoder_ref/gethdr.o \
						video_decoder_ref/getpic.o \
						video_decoder_ref/getvlc.o \
						video_decoder_ref/idct.o \
						video_decoder_ref/motion.o \
						video_decoder_ref/mpeg2dec.o \
						video_decoder_ref/recon.o \
259 260 261 262 263 264 265 266 267 268
						video_decoder_ref/spatscal.o
else
video_parser_obj = 		video_parser/video_parser.o \
						video_parser/vpar_headers.o \
						video_parser/vpar_blocks.o \
						video_parser/vpar_synchro.o \
						video_parser/video_fifo.o

video_decoder_obj =		video_decoder/video_decoder.o \
						video_decoder/vdec_motion.o \
269
						video_decoder/vdec_motion_inner.o \
Vincent Seguin's avatar
Vincent Seguin committed
270
			                        video_decoder/vdec_idct.o
271
endif
272

Michel Kaempf's avatar
Michel Kaempf committed
273 274
misc_obj =			misc/mtime.o \
						misc/rsc_files.o \
275
						misc/netutils.o \
276
						misc/plugins.o \
277
						misc/decoder_fifo.o
Michel Kaempf's avatar
Michel Kaempf committed
278

279
C_OBJ = $(interface_obj) \
Michel Kaempf's avatar
Michel Kaempf committed
280 281 282
		$(input_obj) \
		$(audio_output_obj) \
		$(video_output_obj) \
Michel Kaempf's avatar
Michel Kaempf committed
283
		$(ac3_decoder_obj) \
Michel Kaempf's avatar
Michel Kaempf committed
284
		$(audio_decoder_obj) \
285
		$(spu_decoder_obj) \
Michel Kaempf's avatar
Michel Kaempf committed
286
		$(generic_decoder_obj) \
287
		$(video_parser_obj) \
Michel Kaempf's avatar
Michel Kaempf committed
288 289
		$(video_decoder_obj) \
		$(vlan_obj) \
Vincent Seguin's avatar
Vincent Seguin committed
290
		$(misc_obj)
Michel Kaempf's avatar
Michel Kaempf committed
291

Vincent Seguin's avatar
Vincent Seguin committed
292 293 294
#
# Assembler Objects
# 
295 296
ifneq (,$(findstring X86,$(ARCH)))
ifneq (,$(findstring MMX,$(ARCH)))
297
ifeq ($(DECODER),new)
298
ASM_OBJ = 			video_decoder/vdec_idctmmx.o \
Vincent Seguin's avatar
Vincent Seguin committed
299 300
						video_output/video_yuv_mmx.o
else
301
ASM_OBJ = 			video_decoder_ref/vdec_idctmmx.o \
Vincent Seguin's avatar
Vincent Seguin committed
302 303 304
						video_output/video_yuv_mmx.o
endif
endif
305
endif
Vincent Seguin's avatar
Vincent Seguin committed
306

307 308 309
#
# Plugins
#
310 311 312
intf_plugin =           $(INTF:%=plugins/intf/intf_%.so)
aout_plugin =           $(AOUT:%=plugins/aout/aout_%.so)
vout_plugin =           $(VOUT:%=plugins/vout/vout_%.so)
313

314
PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
315

Michel Kaempf's avatar
Michel Kaempf committed
316 317 318
#
# Other lists of files
#
319 320
C_OBJ := $(C_OBJ:%.o=src/%.o)
ASM_OBJ := $(ASM_OBJ:%.o=src/%.o)
321
sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c)
322
dependancies := $(sources:%.c=.dep/%.d)
Michel Kaempf's avatar
Michel Kaempf committed
323 324 325 326 327 328 329 330 331 332 333 334 335 336

# All symbols must be exported
export

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

#
# Virtual targets
#
all: vlc

clean:
337
	rm -f $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
Michel Kaempf's avatar
Michel Kaempf committed
338 339

distclean: clean
340
	rm -f **/*.o **/*.so **/*~ *.log
341
	rm -f Makefile include/defs.h config.cache config.log
Vincent Seguin's avatar
Vincent Seguin committed
342
	rm -f vlc gmon.out core
343 344 345
	rm -rf .dep

install:
346 347 348 349 350
	$(INSTALL) vlc $(prefix)/bin
	mkdir -p $(prefix)/lib/videolan/vlc
	$(INSTALL) $(PLUGIN_OBJ) $(prefix)/lib/videolan/vlc
	$(INSTALL) share/*.psf $(prefix)/share/videolan/vlc
	$(INSTALL) share/*.png $(prefix)/share/videolan/vlc
Michel Kaempf's avatar
Michel Kaempf committed
351

Vincent Seguin's avatar
Vincent Seguin committed
352 353 354 355 356 357 358
show:
	@echo "Command line for C objects:"
	@echo $(CC) $(CCFLAGS) $(CFLAGS) -c -o "<dest.o>" "<src.c>"
	@echo
	@echo "Command line for assembler objects:"
	@echo $(CC) $(CFLAGS) -c -o "<dest.o>" "<src.S>"

Michel Kaempf's avatar
Michel Kaempf committed
359 360 361 362 363
FORCE:

#
# Real targets
#
364
vlc: $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
365
	$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(ASM_OBJ)	
Michel Kaempf's avatar
Michel Kaempf committed
366 367 368 369 370

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

373
$(C_OBJ): %.o: Makefile.dep
374
$(C_OBJ): %.o: .dep/%.d
375
$(C_OBJ): %.o: %.c
376
	@echo "compiling $*.o from $*.c"
Vincent Seguin's avatar
Vincent Seguin committed
377 378
	@$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<

379
$(ASM_OBJ): %.o: Makefile.dep
380
$(ASM_OBJ): %.o: %.S
381
	@echo "assembling $*.o from $*.S"
Vincent Seguin's avatar
Vincent Seguin committed
382
	@$(CC) $(CFLAGS) -c -o $@ $<
Michel Kaempf's avatar
Michel Kaempf committed
383

384
$(PLUGIN_OBJ): %.so: Makefile.dep
385
$(PLUGIN_OBJ): %.so: .dep/%.d
386 387

# audio plugins
388
plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
389
		@echo "compiling $*.so from $*.c"
390 391 392
ifeq ($(SYS), BEOS)
		@$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
else
393
		@$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
394
endif
395

396
plugins/aout/aout_esd.so: %.so: %.c
397
		@echo "compiling $*.so from $*.c"
398 399 400
ifeq ($(SYS), BSD)
		@$(CC) $(CCFLAGS) $(CFLAGS) -lesd -shared -o $@ $<
else
401
		@$(CC) $(CCFLAGS) $(CFLAGS) -laudiofile -lesd -shared -o $@ $<
402
endif
403 404

# video plugins
405 406
plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
	plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
407
		@echo "compiling $*.so from $*.c"
408 409 410
ifeq ($(SYS), BEOS)
		@$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $<
else
411
		@$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
412
endif
413

414
plugins/intf/intf_x11.so plugins/vout/vout_x11.so: %.so: %.c
415 416 417
		@echo "compiling $*.so from $*.c"
		@$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<

418 419 420 421 422 423 424 425
plugins/intf/intf_gnome.so: %.so: %.c
		@echo "compiling $*.so from $*.c"
		@$(CC) $(CCFLAGS) $(CFLAGS) $(LCFLAGS) `gnome-config --libs --cflags gnomeui` -shared -o $@ $< plugins/intf/intf_gnome_callbacks.c plugins/intf/intf_gnome_interface.c plugins/intf/intf_gnome_support.c

plugins/vout/vout_gnome.so: %.so: %.c
		@echo "compiling $*.so from $*.c"
		@$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lXext -shared -o $@ $<

426
plugins/intf/intf_glide.so plugins/vout/vout_glide.so: %.so: %.c
427 428 429
		@echo "compiling $*.so from $*.c"
		@$(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -lglide2x -shared -o $@ $<

430
plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
431 432 433 434
		@echo "compiling $*.so from $*.c"
		@$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<


Michel Kaempf's avatar
Michel Kaempf committed
435 436 437 438 439
################################################################################
# Note on generic rules and dependancies
################################################################################

# Note on dependancies: each .c file is associated with a .d file, which
440 441
# 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
442 443 444
# directory.
# The dep directory should be ignored by CVS.

445
# Note on inclusions: depending of the target, the dependancies files must
Michel Kaempf's avatar
Michel Kaempf committed
446
# or must not be included. The problem is that if we ask make to include a file,
447 448
# 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
449 450 451 452 453
# 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
454 455
# The object Makefile known how to make a .o from a .c, and includes
# dependancies for the target, but only those required.