]> git.sesse.net Git - vlc/blob - Makefile
* audio_output/audio_output.c :
[vlc] / Makefile
1 ################################################################################
2 # vlc (VideoLAN Client) main makefile
3 # (c)1998 VideoLAN
4 ################################################################################
5 # This makefile is the main makefile for the VideoLAN client.
6 ################################################################################
7
8 ################################################################################
9 # Configuration
10 ################################################################################
11
12 # Environment
13 #CC = gcc
14 #SHELL = /bin/sh
15
16 # Video output settings
17 VIDEO=X11
18 #VIDEO=DGA (not yet supported)
19 #VIDEO=FB
20 #VIDEO=GGI
21 #VIDEO=BEOS (not yet supported)
22
23 # Target architecture and optimization
24 #ARCH=
25 ARCH=MMX
26 #ARCH=PPC
27 #ARCH=SPARC
28
29 # Decoder choice - ?? old decoder will be removed soon
30 DECODER=old
31 #DECODER=new
32 # !!! don't forget to run this command after changing decoder type !!!
33 # touch input/input.c input/input_ctrl.c include/vlc.h include/video_decoder.h
34
35 #----------------- do not change anything below this line ----------------------
36
37 ################################################################################
38 # Configuration pre-processing
39 ################################################################################
40
41 # DEFINE will contain all the constants definitions decided in Makefile
42 DEFINE = -DVIDEO_$(VIDEO)
43
44 # video is a lowercase version of VIDEO used for filenames
45 video = $(shell echo $(VIDEO) | tr 'A-Z' 'a-z')
46
47 ################################################################################
48 # Tunning and other variables
49 ################################################################################
50
51 #
52 # Transformation for video decompression (Fourier or cosine)
53 #
54 TRANSFORM=vdec_idct
55 #TRANSFORM=vdec_idft
56
57 #
58 # C headers directories
59 #
60 INCLUDE += -Iinclude
61
62 ifeq ($(VIDEO),X11)
63 INCLUDE += -I/usr/X11R6/include
64 endif
65
66 #
67 # Libraries
68 #
69 LIB += -lpthread
70 LIB += -lm
71
72 ifeq ($(VIDEO),X11)
73 LIB += -L/usr/X11R6/lib
74 LIB += -lX11
75 LIB += -lXext 
76 endif
77 ifeq ($(VIDEO),GGI)
78 LIB += -lggi
79 endif
80
81 # System dependant libraries
82 #??LIB += -lXxf86dga
83
84 #
85 # C compiler flags: compilation
86 #
87 CCFLAGS += $(DEFINE) $(INCLUDE)
88 CCFLAGS += -Wall
89 CCFLAGS += -D_REENTRANT
90 CCFLAGS += -D_GNU_SOURCE
91
92 # Optimizations : don't compile debug versions with them
93 CCFLAGS += -g
94 CCFLAGS += -O6
95 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
96 CCFLAGS += -fomit-frame-pointer
97
98 # Optimizations for x86 familiy, without MMX
99 ifeq ($(ARCH),)
100 CCFLAGS += -malign-double
101 CCFLAGS += -march=pentiumpro
102 #CCFLAGS += -march=pentium
103 endif
104
105 # Optimization for x86 with MMX support
106 ifeq ($(ARCH),MMX)
107 CCFLAGS += -malign-double
108 CCFLAGS += -march=pentiumpro
109 endif
110
111 # Optimizations for PowerPC
112 ifeq ($(ARCH),PPC)
113 CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
114 endif
115
116 # Optimizations for Sparc
117 ifeq ($(ARCH),SPARC)
118 CCFLAGS += -mhard-float
119 endif
120
121 #
122 # C compiler flags: dependancies
123 #
124 DCFLAGS += $(INCLUDE)
125 DCFLAGS += -MM
126
127 #
128 # C compiler flags: linking
129 #
130 LCFLAGS += $(LIB)
131 LCFLAGS += -Wall
132 #LCFLAGS += -s
133
134 #
135 # C compiler flags: common flags
136 #
137
138 # Optimizations for x86 with MMX support
139 ifeq ($(ARCH),MMX)
140 CFLAGS += -DHAVE_MMX
141 endif
142
143 #
144 # Additionnal debugging flags
145 #
146 # Debugging settings: electric fence, debuging symbols and profiling support. 
147 # Note that electric fence and accurate profiling are quite uncompatible.
148 #CCFLAGS += -g
149 #CCFLAGS += -pg
150 #LCFLAGS += -g 
151 #LCFLAGS += -pg
152 #LIB += -ldmalloc
153 #LIB += -lefence
154
155 #################################################################################
156 # Objects and files
157 #################################################################################
158
159 #
160 # Objects
161
162 interface_obj =                 interface/main.o \
163                                                 interface/interface.o \
164                                                 interface/intf_msg.o \
165                                                 interface/intf_cmd.o \
166                                                 interface/intf_ctrl.o \
167                                                 interface/control.o \
168                                                 interface/intf_console.o \
169                                                 interface/intf_$(video).o
170
171 input_obj =                     input/input_vlan.o \
172                                                 input/input_file.o \
173                                                 input/input_netlist.o \
174                                                 input/input_network.o \
175                                                 input/input_ctrl.o \
176                                                 input/input_pcr.o \
177                                                 input/input_psi.o \
178                                                 input/input.o
179
180 audio_output_obj =              audio_output/audio_output.o \
181                                                 audio_output/audio_dsp.o
182
183 video_output_obj =              video_output/video_output.o \
184                                                 video_output/video_$(video).o \
185                                                 video_output/video_yuv.o
186
187 ac3_decoder_obj =               ac3_decoder/ac3_decoder.o \
188                                                 ac3_decoder/ac3_parse.o \
189                                                 ac3_decoder/ac3_exponent.o \
190                                                 ac3_decoder/ac3_bit_allocate.o \
191                                                 ac3_decoder/ac3_mantissa.o \
192                                                 ac3_decoder/ac3_rematrix.o \
193                                                 ac3_decoder/ac3_imdct.o \
194                                                 ac3_decoder/ac3_downmix.o
195
196 audio_decoder_obj =             audio_decoder/audio_decoder.o \
197                                                 audio_decoder/audio_math.o
198
199 subtitle_decoder_obj =          subtitle_decoder/subtitle_decoder.o
200
201 #??generic_decoder_obj =                generic_decoder/generic_decoder.o
202 # remeber to add it to OBJ 
203
204 ifeq ($(DECODER),old)
205 CFLAGS += -DOLD_DECODER
206 video_decoder_obj =             video_decoder_ref/video_decoder.o \
207                                                 video_decoder_ref/display.o \
208                                                 video_decoder_ref/getblk.o \
209                                                 video_decoder_ref/gethdr.o \
210                                                 video_decoder_ref/getpic.o \
211                                                 video_decoder_ref/getvlc.o \
212                                                 video_decoder_ref/idct.o \
213                                                 video_decoder_ref/motion.o \
214                                                 video_decoder_ref/mpeg2dec.o \
215                                                 video_decoder_ref/recon.o \
216                                                 video_decoder_ref/spatscal.o
217 else
218 video_parser_obj =              video_parser/video_parser.o \
219                                                 video_parser/vpar_headers.o \
220                                                 video_parser/vpar_blocks.o \
221                                                 video_parser/vpar_motion.o \
222                                                 video_parser/vpar_synchro.o \
223                                                 video_parser/video_fifo.o
224
225 video_decoder_obj =             video_decoder/video_decoder.o \
226                                                 video_decoder/vdec_motion.o \
227                         video_decoder/$(TRANSFORM).o
228 endif
229
230 misc_obj =                      misc/mtime.o \
231                                                 misc/rsc_files.o \
232                                                 misc/netutils.o
233
234 ifeq ($(ARCH),MMX)
235 ifeq ($(DECODER),old)
236 ASM_OBJ =                       video_decoder_ref/idctmmx.o \
237                                                 video_output/video_yuv_mmx.o
238 else
239 ASM_OBJ =                       video_decoder/idctmmx.o \
240                                                 video_output/video_yuv_mmx.o
241 endif
242
243 endif
244
245 C_OBJ = $(interface_obj) \
246                 $(input_obj) \
247                 $(audio_output_obj) \
248                 $(video_output_obj) \
249                 $(ac3_decoder_obj) \
250                 $(audio_decoder_obj) \
251                 $(subtitle_decoder_obj) \
252                 $(generic_decoder_obj) \
253                 $(video_parser_obj) \
254                 $(video_decoder_obj) \
255                 $(vlan_obj) \
256                 $(misc_obj)
257
258 #
259 # Other lists of files
260 #
261 sources := $(C_OBJ:%.o=%.c)
262 dependancies := $(sources:%.c=dep/%.d)
263
264 # All symbols must be exported
265 export
266
267 ################################################################################
268 # Targets
269 ################################################################################
270
271 #
272 # Virtual targets
273 #
274 all: vlc
275
276 clean:
277         rm -f $(C_OBJ) $(ASM_OBJ)
278
279 distclean: clean
280         rm -f **/*.o **/*~ *.log
281         rm -f vlc gmon.out core
282         rm -rf dep
283
284 FORCE:
285
286 #
287 # Real targets
288 #
289 vlc: $(C_OBJ) $(ASM_OBJ)
290         $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
291
292 #
293 # Generic rules (see below)
294 #
295 $(dependancies): %.d: FORCE
296         @$(MAKE) -s --no-print-directory -f Makefile.dep $@
297
298 $(C_OBJ): %.o: dep/%.d
299
300 $(C_OBJ): %.o: %.c
301         $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
302 $(ASM_OBJ): %.o: %.S
303         $(CC) $(CFLAGS) -c -o $@ $<
304
305 ################################################################################
306 # Note on generic rules and dependancies
307 ################################################################################
308
309 # Note on dependancies: each .c file is associated with a .d file, which
310 # depends of it. The .o file associated with a .c file depends of the .d, of the 
311 # .c itself, and of Makefile. The .d files are stored in a separate dep/ 
312 # directory.
313 # The dep directory should be ignored by CVS.
314
315 # Note on inclusions: depending of the target, the dependancies files must 
316 # or must not be included. The problem is that if we ask make to include a file,
317 # and this file does not exist, it is made before it can be included. In a 
318 # general way, a .d file should be included if and only if the corresponding .o 
319 # needs to be re-made.
320
321 # Two makefiles are used: the main one (this one) has regular generic rules,
322 # except for .o files, for which it calls the object Makefile. Dependancies
323 # are not included in this file.
324 # The object Makefile known how to make a .o from a .c, and includes
325 # dependancies for the target, but only those required.