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 += -s -fargument-noalias-global -fexpensive-optimizations -ffast-math -funroll-loops -fomit-frame-pointer #-march=pentiumpro
45 #(Uncomment -march=pentiumpro if it applies)
49 # C compiler flags: dependancies
55 # C compiler flags: linking
61 # C compiler flags: functions flow
70 FCFLAGS += -X signal.h
72 FCFLAGS += -X stdlib.h
73 FCFLAGS += -X string.h
74 FCFLAGS += -X unistd.h
75 FCFLAGS += -X sys/ioctl.h
76 FCFLAGS += -X sys/stat.h
77 FCFLAGS += -X X11/Xlib.h
78 FFILTER = grep -v "intf_.*Msg.*\.\.\."
81 # C compiler flags: common flags
86 # Additionnal debugging flags
88 # Debugging settings: electric fence, debuging symbols and profiling support.
89 # Note that electric fence and accurate profiling are quite uncompatible.
95 #################################################################################
97 #################################################################################
102 interface_obj = interface/main.o \
103 interface/interface.o \
104 interface/intf_msg.o \
105 interface/intf_cmd.o \
106 interface/intf_ctrl.o \
107 interface/control.o \
110 input_obj = input/input_vlan.o \
112 input/input_netlist.o \
113 input/input_network.o \
119 audio_output_obj = audio_output/audio_output.o \
120 audio_output/audio_dsp.o
122 video_output_obj = video_output/video_output.o \
123 video_output/video_x11.o \
124 video_output/video_graphics.o
126 audio_decoder_obj = audio_decoder/audio_decoder.o \
127 audio_decoder/audio_math.o
129 generic_decoder_obj = generic_decoder/generic_decoder.o
131 video_decoder_obj = video_decoder/video_decoder.o
133 misc_obj = misc/mtime.o \
138 OBJ = $(interface_obj) \
140 $(audio_output_obj) \
141 $(video_output_obj) \
142 $(audio_decoder_obj) \
143 $(generic_decoder_obj) \
144 $(video_decoder_obj) \
150 # Other lists of files
152 sources := $(OBJ:%.o=%.c)
153 dependancies := $(sources:%.c=dep/%.d)
155 # All symbols must be exported
158 ################################################################################
160 ################################################################################
171 rm -f **/*.o **/*~ *.log
172 rm -f vlc gmon.out core Documentation/cflow
181 $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(OBJ)
183 Documentation/cflow: $(sources)
184 cflow $(FCFLAGS) $(CFLAGS) $(sources) | $(FFILTER) > $@
187 # Generic rules (see below)
189 $(dependancies): %.d: FORCE
190 @make -s --no-print-directory -f Makefile.dep $@
194 $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
196 ################################################################################
197 # Note on generic rules and dependancies
198 ################################################################################
200 # Note on dependancies: each .c file is associated with a .d file, which
201 # depends of it. The .o file associated with a .c file depends of the .d, of the
202 # .c itself, and of Makefile. The .d files are stored in a separate dep/
204 # The dep directory should be ignored by CVS.
206 # Note on inclusions: depending of the target, the dependancies files must
207 # or must not be included. The problem is that if we ask make to include a file,
208 # and this file does not exist, it is made before it can be included. In a
209 # general way, a .d file should be included if and only if the corresponding .o
210 # needs to be re-made.
212 # Two makefiles are used: the main one (this one) has regular generic rules,
213 # except for .o files, for which it calls the object Makefile. Dependancies
214 # are not included in this file.
215 # The object Makefile known how to make a .o from a .c, and includes dependancies
216 # for the target, but only those required.