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
45 #CCFLAGS += -s -fargument-noalias-global -fexpensive-optimizations -ffast-math -funroll-loops -fomit-frame-pointer #-march=pentiumpro
46 #(Uncomment -march=pentiumpro if it applies)
50 # C compiler flags: dependancies
56 # C compiler flags: linking
62 # C compiler flags: functions flow
71 FCFLAGS += -X signal.h
73 FCFLAGS += -X stdlib.h
74 FCFLAGS += -X string.h
75 FCFLAGS += -X unistd.h
76 FCFLAGS += -X sys/ioctl.h
77 FCFLAGS += -X sys/stat.h
78 FCFLAGS += -X X11/Xlib.h
79 FFILTER = grep -v "intf_.*Msg.*\.\.\."
82 # C compiler flags: common flags
87 # Additionnal debugging flags
89 # Debugging settings: electric fence, debuging symbols and profiling support.
90 # Note that electric fence and accurate profiling are quite uncompatible.
96 #################################################################################
98 #################################################################################
103 interface_obj = interface/main.o \
104 interface/interface.o \
105 interface/intf_msg.o \
106 interface/intf_cmd.o \
107 interface/intf_ctrl.o \
108 interface/control.o \
111 input_obj = input/input_vlan.o \
113 input/input_netlist.o \
114 input/input_network.o \
120 audio_output_obj = audio_output/audio_output.o \
121 audio_output/audio_dsp.o
123 video_output_obj = video_output/video_output.o \
124 video_output/video_x11.o \
125 video_output/video_graphics.o
127 audio_decoder_obj = audio_decoder/audio_decoder.o \
128 audio_decoder/audio_math.o
130 generic_decoder_obj = generic_decoder/generic_decoder.o
132 video_decoder_obj = video_decoder/video_decoder.o
134 misc_obj = misc/mtime.o \
139 OBJ = $(interface_obj) \
141 $(audio_output_obj) \
142 $(video_output_obj) \
143 $(audio_decoder_obj) \
144 $(generic_decoder_obj) \
145 $(video_decoder_obj) \
151 # Other lists of files
153 sources := $(OBJ:%.o=%.c)
154 dependancies := $(sources:%.c=dep/%.d)
156 # All symbols must be exported
159 ################################################################################
161 ################################################################################
172 rm -f **/*.o **/*~ *.log
173 rm -f vlc gmon.out core Documentation/cflow
182 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(OBJ)
184 Documentation/cflow: $(sources)
185 cflow $(FCFLAGS) $(CFLAGS) $(sources) | $(FFILTER) > $@
188 # Generic rules (see below)
190 $(dependancies): %.d: FORCE
191 @make -s --no-print-directory -f Makefile.dep $@
195 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
197 ################################################################################
198 # Note on generic rules and dependancies
199 ################################################################################
201 # Note on dependancies: each .c file is associated with a .d file, which
202 # depends of it. The .o file associated with a .c file depends of the .d, of the
203 # .c itself, and of Makefile. The .d files are stored in a separate dep/
205 # The dep directory should be ignored by CVS.
207 # Note on inclusions: depending of the target, the dependancies files must
208 # or must not be included. The problem is that if we ask make to include a file,
209 # and this file does not exist, it is made before it can be included. In a
210 # general way, a .d file should be included if and only if the corresponding .o
211 # needs to be re-made.
213 # Two makefiles are used: the main one (this one) has regular generic rules,
214 # except for .o files, for which it calls the object Makefile. Dependancies
215 # are not included in this file.
216 # The object Makefile known how to make a .o from a .c, and includes
217 # dependancies for the target, but only those required.