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