]> git.sesse.net Git - vlc/blob - Makefile
A tout kass�.
[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/xutils.o \
202                                                 misc/rsc_files.o \
203                                                 misc/netutils.o
204
205
206 ifeq ($(ARCH),MMX)
207 ASM_OBJ =                       video_decoder_ref/idctmmx.o \
208                                                 video_decoder_ref/yuv12-rgb16.o
209 endif
210
211 C_OBJ = $(interface_obj) \
212                 $(input_obj) \
213                 $(audio_output_obj) \
214                 $(video_output_obj) \
215                 $(audio_decoder_obj) \
216                 $(generic_decoder_obj) \
217                 $(video_parser_obj) \
218                 $(video_decoder_obj) \
219                 $(vlan_obj) \
220                 $(misc_obj)
221
222 #
223 # Other lists of files
224 #
225 sources := $(C_OBJ:%.o=%.c)
226 dependancies := $(sources:%.c=dep/%.d)
227
228 # All symbols must be exported
229 export
230
231 ################################################################################
232 # Targets
233 ################################################################################
234
235 #
236 # Virtual targets
237 #
238 all: vlc
239
240 clean:
241         rm -f $(C_OBJ) $(ASM_OBJ)
242
243 distclean: clean
244         rm -f **/*.o **/*~ *.log
245         rm -f vlc gmon.out core
246         rm -rf dep
247
248 FORCE:
249
250 #
251 # Real targets
252 #
253 vlc: $(C_OBJ) $(ASM_OBJ)
254         $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
255
256 #
257 # Generic rules (see below)
258 #
259 $(dependancies): %.d: FORCE
260         @make -s --no-print-directory -f Makefile.dep $@
261
262 $(C_OBJ): %.o: dep/%.d
263
264 $(C_OBJ): %.o: %.c
265         $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
266 $(ASM_OBJ): %.o: %.S
267         $(CC) $(CFLAGS) -c -o $@ $<
268
269 ################################################################################
270 # Note on generic rules and dependancies
271 ################################################################################
272
273 # Note on dependancies: each .c file is associated with a .d file, which
274 # depends of it. The .o file associated with a .c file depends of the .d, of the 
275 # .c itself, and of Makefile. The .d files are stored in a separate dep/ 
276 # directory.
277 # The dep directory should be ignored by CVS.
278
279 # Note on inclusions: depending of the target, the dependancies files must 
280 # or must not be included. The problem is that if we ask make to include a file,
281 # and this file does not exist, it is made before it can be included. In a 
282 # general way, a .d file should be included if and only if the corresponding .o 
283 # needs to be re-made.
284
285 # Two makefiles are used: the main one (this one) has regular generic rules,
286 # except for .o files, for which it calls the object Makefile. Dependancies
287 # are not included in this file.
288 # The object Makefile known how to make a .o from a .c, and includes
289 # dependancies for the target, but only those required.