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