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