]> git.sesse.net Git - vlc/blob - Makefile
Modifications de Polusque depuis la DR2, � savoir :
[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 #CC = gcc
13 #SHELL = /bin/sh
14
15 ################################################################################
16 # Settings and other variables
17 ################################################################################
18
19 #
20 # C headers directories
21 #
22 INCLUDE += -Iinclude
23 INCLUDE += -I/usr/X11R6/include/X11
24
25 #
26 # Libraries
27 #
28 LIB += -L/usr/X11R6/lib
29 LIB += -lX11
30 LIB += -lXext 
31 LIB += -lpthread
32 LIB += -lXpm
33
34 #
35 # C compiler flags: compilation
36 #
37 CCFLAGS += $(INCLUDE)
38 CCFLAGS += -Wall
39 CCFLAGS += -D_REENTRANT
40 CCFLAGS += -D_GNU_SOURCE
41
42 # Optimizations : don't compile debug versions with them
43 CCFLAGS += -O6
44 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
45 #CCFLAGS += -fomit-frame-pointer -s
46 #LCFLAGS += -s
47
48 # Platform-specific optimizations
49 # Optimizations for x86 familiy :
50 CCFLAGS += -malign-double
51 CCFLAGS += -march=pentiumpro
52 #CCFLAGS += -march=pentium
53
54 # MMX support :
55 CFLAGS += -DHAVE_MMX
56 assembly_obj =                video_decoder_ref/idctmmx.o \
57                         video_decoder_ref/yuv12-rgb16.o
58
59 #Optimizations for PowerPC :
60 #CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
61
62 #
63 # C compiler flags: dependancies
64 #
65 DCFLAGS += $(INCLUDE)
66 DCFLAGS += -MM
67
68 #
69 # C compiler flags: linking
70 #
71 LCFLAGS += $(LIB)
72 LCFLAGS += -Wall
73
74 #
75 # C compiler flags: functions flow
76 #
77 FCFLAGS += $(INCLUDE)
78 FCFLAGS += -A
79 FCFLAGS += -P
80 FCFLAGS += -v
81 FCFLAGS += -a
82 FCFLAGS += -X errno.h
83 FCFLAGS += -X fcntl.h
84 FCFLAGS += -X signal.h
85 FCFLAGS += -X stdio.h
86 FCFLAGS += -X stdlib.h
87 FCFLAGS += -X string.h
88 FCFLAGS += -X unistd.h
89 FCFLAGS += -X sys/ioctl.h
90 FCFLAGS += -X sys/stat.h
91 FCFLAGS += -X X11/Xlib.h
92 FFILTER = grep -v "intf_.*Msg.*\.\.\."
93
94 #
95 # C compiler flags: common flags
96 #
97 # CFLAGS
98
99 #
100 # Additionnal debugging flags
101 #
102 # Debugging settings: electric fence, debuging symbols and profiling support. 
103 # Note that electric fence and accurate profiling are quite uncompatible.
104 #CCFLAGS += -g
105 #CCFLAGS += -pg
106 #LCFLAGS += -g
107 #LCFLAGS += -pg
108 #LIB += -ldmalloc
109 #LIB += -lefence
110
111 #################################################################################
112 # Objects and files
113 #################################################################################
114
115 #
116 # Objects
117
118 interface_obj =                 interface/main.o \
119                                                 interface/interface.o \
120                                                 interface/intf_msg.o \
121                                                 interface/intf_cmd.o \
122                                                 interface/intf_ctrl.o \
123                                                 interface/control.o \
124                                                 interface/xconsole.o 
125
126 input_obj =                     input/input_vlan.o \
127                                                 input/input_file.o \
128                                                 input/input_netlist.o \
129                                                 input/input_network.o \
130                                                 input/input_ctrl.o \
131                                                 input/input_pcr.o \
132                                                 input/input_psi.o \
133                                                 input/input.o
134
135 audio_output_obj =              audio_output/audio_output.o \
136                                                 audio_output/audio_dsp.o
137
138 video_output_obj =              video_output/video_output.o \
139                                                 video_output/video_x11.o \
140                                                 video_output/video_graphics.o 
141
142 audio_decoder_obj =             audio_decoder/audio_decoder.o \
143                                                 audio_decoder/audio_math.o
144
145 #generic_decoder_obj =          generic_decoder/generic_decoder.o
146
147 video_decoder_obj =             video_decoder_ref/video_decoder.o \
148                                                 video_decoder_ref/display.o \
149                                                 video_decoder_ref/getblk.o \
150                                                 video_decoder_ref/gethdr.o \
151                                                 video_decoder_ref/getpic.o \
152                                                 video_decoder_ref/getvlc.o \
153                                                 video_decoder_ref/idct.o \
154                                                 video_decoder_ref/motion.o \
155                                                 video_decoder_ref/mpeg2dec.o \
156                                                 video_decoder_ref/recon.o \
157                                                 video_decoder_ref/spatscal.o
158
159 misc_obj =                      misc/mtime.o \
160                                                 misc/xutils.o \
161                                                 misc/rsc_files.o \
162                                                 misc/netutils.o
163
164 OBJ =   $(interface_obj) \
165                 $(input_obj) \
166                 $(audio_output_obj) \
167                 $(video_output_obj) \
168                 $(audio_decoder_obj) \
169                 $(generic_decoder_obj) \
170                 $(video_decoder_obj) \
171                 $(vlan_obj) \
172                 $(misc_obj)
173
174
175 #
176 # Other lists of files
177 #
178 sources := $(OBJ:%.o=%.c)
179 dependancies := $(sources:%.c=dep/%.d)
180
181 # All symbols must be exported
182 export
183
184 ################################################################################
185 # Targets
186 ################################################################################
187
188 #
189 # Virtual targets
190 #
191 all: vlc
192
193 clean:
194         rm -f $(OBJ)
195
196 distclean: clean
197         rm -f **/*.o **/*~ *.log
198         rm -f vlc gmon.out core Documentation/cflow
199         rm -rf dep
200
201 FORCE:
202
203 #
204 # Real targets
205 #
206 vlc: $(OBJ)
207         $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(OBJ) $(assembly_obj)
208
209 Documentation/cflow: $(sources)
210         cflow $(FCFLAGS) $(CFLAGS) $(sources) | $(FFILTER) > $@
211
212 #
213 # Generic rules (see below)
214 #
215 $(dependancies): %.d: FORCE
216         @make -s --no-print-directory -f Makefile.dep $@
217
218 $(OBJ): %.o: dep/%.d
219 $(OBJ): %.o: %.c
220         $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
221
222 ################################################################################
223 # Note on generic rules and dependancies
224 ################################################################################
225
226 # Note on dependancies: each .c file is associated with a .d file, which
227 # depends of it. The .o file associated with a .c file depends of the .d, of the 
228 # .c itself, and of Makefile. The .d files are stored in a separate dep/ 
229 # directory.
230 # The dep directory should be ignored by CVS.
231
232 # Note on inclusions: depending of the target, the dependancies files must 
233 # or must not be included. The problem is that if we ask make to include a file,
234 # and this file does not exist, it is made before it can be included. In a 
235 # general way, a .d file should be included if and only if the corresponding .o 
236 # needs to be re-made.
237
238 # Two makefiles are used: the main one (this one) has regular generic rules,
239 # except for .o files, for which it calls the object Makefile. Dependancies
240 # are not included in this file.
241 # The object Makefile known how to make a .o from a .c, and includes
242 # dependancies for the target, but only those required.