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