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