1 ################################################################################
2 # vlc (VideoLAN Client) main makefile
4 ################################################################################
5 # This makefile is the main makefile for the VideoLAN client.
6 ################################################################################
8 ################################################################################
10 ################################################################################
15 ################################################################################
16 # Settings and other variables
17 ################################################################################
20 # C headers directories
23 INCLUDE += -I/usr/X11R6/include/X11
28 LIB += -L/usr/X11R6/lib
35 # C compiler flags: compilation
39 CCFLAGS += -D_REENTRANT
40 CCFLAGS += -D_GNU_SOURCE
42 # Optimizations : don't compile debug versions with them
44 CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
45 #CCFLAGS += -fomit-frame-pointer -s
48 # Platform-specific optimizations
49 # Optimizations for x86 familiy :
50 CCFLAGS += -malign-double
51 CCFLAGS += -march=pentiumpro
52 #CCFLAGS += -march=pentium
56 ASM_OBJ = video_decoder_ref/idctmmx.o \
57 video_decoder_ref/yuv12-rgb16.o
59 #Optimizations for PowerPC :
60 #CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
63 # C compiler flags: dependancies
69 # C compiler flags: linking
75 # C compiler flags: functions flow
84 FCFLAGS += -X signal.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.*\.\.\."
95 # C compiler flags: common flags
100 # Additionnal debugging flags
102 # Debugging settings: electric fence, debuging symbols and profiling support.
103 # Note that electric fence and accurate profiling are quite uncompatible.
111 #################################################################################
113 #################################################################################
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 \
126 input_obj = input/input_vlan.o \
128 input/input_netlist.o \
129 input/input_network.o \
135 audio_output_obj = audio_output/audio_output.o \
136 audio_output/audio_dsp.o
138 video_output_obj = video_output/video_output.o \
139 video_output/video_x11.o \
140 video_output/video_graphics.o
142 audio_decoder_obj = audio_decoder/audio_decoder.o \
143 audio_decoder/audio_math.o
145 #generic_decoder_obj = generic_decoder/generic_decoder.o
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
159 misc_obj = misc/mtime.o \
164 C_OBJ = $(interface_obj) \
166 $(audio_output_obj) \
167 $(video_output_obj) \
168 $(audio_decoder_obj) \
169 $(generic_decoder_obj) \
170 $(video_decoder_obj) \
175 # Other lists of files
177 sources := $(C_OBJ:%.o=%.c)
178 dependancies := $(sources:%.c=dep/%.d)
180 # All symbols must be exported
183 ################################################################################
185 ################################################################################
193 rm -f $(C_OBJ) $(ASM_OBJ)
196 rm -f **/*.o **/*~ *.log
197 rm -f vlc gmon.out core Documentation/cflow
205 vlc: $(C_OBJ) $(ASM_OBJ)
206 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(C_OBJ) $(ASM_OBJ)
208 Documentation/cflow: $(sources)
209 cflow $(FCFLAGS) $(CFLAGS) $(sources) | $(FFILTER) > $@
212 # Generic rules (see below)
214 $(dependancies): %.d: FORCE
215 @make -s --no-print-directory -f Makefile.dep $@
217 $(C_OBJ): %.o: dep/%.d
220 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
224 ################################################################################
225 # Note on generic rules and dependancies
226 ################################################################################
228 # Note on dependancies: each .c file is associated with a .d file, which
229 # depends of it. The .o file associated with a .c file depends of the .d, of the
230 # .c itself, and of Makefile. The .d files are stored in a separate dep/
232 # The dep directory should be ignored by CVS.
234 # Note on inclusions: depending of the target, the dependancies files must
235 # or must not be included. The problem is that if we ask make to include a file,
236 # and this file does not exist, it is made before it can be included. In a
237 # general way, a .d file should be included if and only if the corresponding .o
238 # needs to be re-made.
240 # Two makefiles are used: the main one (this one) has regular generic rules,
241 # except for .o files, for which it calls the object Makefile. Dependancies
242 # are not included in this file.
243 # The object Makefile known how to make a .o from a .c, and includes
244 # dependancies for the target, but only those required.