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