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