]> 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 += -O2
44 #CCFLAGS += -O8
45 #CCFLAGS += -s -fargument-noalias-global -fexpensive-optimizations -ffast-math -funroll-loops -fomit-frame-pointer #-march=pentiumpro
46 #(Uncomment -march=pentiumpro if it applies)
47
48
49 #
50 # C compiler flags: dependancies
51 #
52 DCFLAGS += $(INCLUDE)
53 DCFLAGS += -MM
54
55 #
56 # C compiler flags: linking
57 #
58 LCFLAGS += $(LIB)
59 LCFLAGS += -Wall
60
61 #
62 # C compiler flags: functions flow
63 #
64 FCFLAGS += $(INCLUDE)
65 FCFLAGS += -A
66 FCFLAGS += -P
67 FCFLAGS += -v
68 FCFLAGS += -a
69 FCFLAGS += -X errno.h
70 FCFLAGS += -X fcntl.h
71 FCFLAGS += -X signal.h
72 FCFLAGS += -X stdio.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.*\.\.\."
80
81 #
82 # C compiler flags: common flags
83 #
84 # CFLAGS
85
86 #
87 # Additionnal debugging flags
88 #
89 # Debugging settings: electric fence, debuging symbols and profiling support. 
90 # Note that electric fence and accurate profiling are quite uncompatible.
91 CCFLAGS += -g
92 CCFLAGS += -pg
93 LCFLAGS += -g
94 LCFLAGS += -pg
95 #LIB += -ldmalloc
96 #LIB += -lefence
97
98 #################################################################################
99 # Objects and files
100 #################################################################################
101
102 #
103 # Objects
104
105 interface_obj =                 interface/main.o \
106                                                 interface/interface.o \
107                                                 interface/intf_msg.o \
108                                                 interface/intf_cmd.o \
109                                                 interface/intf_ctrl.o \
110                                                 interface/control.o \
111                                                 interface/xconsole.o 
112
113 input_obj =                     input/input_vlan.o \
114                                                 input/input_file.o \
115                                                 input/input_netlist.o \
116                                                 input/input_network.o \
117                                                 input/input_ctrl.o \
118                                                 input/input_pcr.o \
119                                                 input/input_psi.o \
120                                                 input/input.o
121
122 audio_output_obj =              audio_output/audio_output.o \
123                                                 audio_output/audio_dsp.o
124
125 video_output_obj =              video_output/video_output.o \
126                                                 video_output/video_x11.o \
127                                                 video_output/video_graphics.o 
128
129 audio_decoder_obj =             audio_decoder/audio_decoder.o \
130                                                 audio_decoder/audio_math.o
131
132 generic_decoder_obj =           generic_decoder/generic_decoder.o
133
134 video_decoder_obj =             video_decoder/video_decoder.o
135
136 misc_obj =                      misc/mtime.o \
137                                                 misc/xutils.o \
138                                                 misc/rsc_files.o \
139                                                 misc/netutils.o
140
141 OBJ =   $(interface_obj) \
142                 $(input_obj) \
143                 $(audio_output_obj) \
144                 $(video_output_obj) \
145                 $(audio_decoder_obj) \
146                 $(generic_decoder_obj) \
147                 $(video_decoder_obj) \
148                 $(vlan_obj) \
149                 $(misc_obj)
150
151
152 #
153 # Other lists of files
154 #
155 sources := $(OBJ:%.o=%.c)
156 dependancies := $(sources:%.c=dep/%.d)
157
158 # All symbols must be exported
159 export
160
161 ################################################################################
162 # Targets
163 ################################################################################
164
165 #
166 # Virtual targets
167 #
168 all: vlc
169
170 clean:
171         rm -f $(OBJ)
172
173 distclean: clean
174         rm -f **/*.o **/*~ *.log
175         rm -f vlc gmon.out core Documentation/cflow
176         rm -rf dep
177
178 FORCE:
179
180 #
181 # Real targets
182 #
183 vlc: $(OBJ)
184         $(CC) $(LCFLAGS) $(CFLAGS) -o $@ $(OBJ)
185
186 Documentation/cflow: $(sources)
187         cflow $(FCFLAGS) $(CFLAGS) $(sources) | $(FFILTER) > $@
188
189 #
190 # Generic rules (see below)
191 #
192 $(dependancies): %.d: FORCE
193         @make -s --no-print-directory -f Makefile.dep $@
194
195 $(OBJ): %.o: dep/%.d
196 $(OBJ): %.o: %.c
197         $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
198
199 ################################################################################
200 # Note on generic rules and dependancies
201 ################################################################################
202
203 # Note on dependancies: each .c file is associated with a .d file, which
204 # depends of it. The .o file associated with a .c file depends of the .d, of the 
205 # .c itself, and of Makefile. The .d files are stored in a separate dep/ 
206 # directory.
207 # The dep directory should be ignored by CVS.
208
209 # Note on inclusions: depending of the target, the dependancies files must 
210 # or must not be included. The problem is that if we ask make to include a file,
211 # and this file does not exist, it is made before it can be included. In a 
212 # general way, a .d file should be included if and only if the corresponding .o 
213 # needs to be re-made.
214
215 # Two makefiles are used: the main one (this one) has regular generic rules,
216 # except for .o files, for which it calls the object Makefile. Dependancies
217 # are not included in this file.
218 # The object Makefile known how to make a .o from a .c, and includes
219 # dependancies for the target, but only those required.