1 ###############################################################################
2 # vlc (VideoLAN Client) options Makefile
4 ###############################################################################
6 ###############################################################################
8 ###############################################################################
12 # WARNING: if you do not have a dynamic loader on your platform, remove
13 # the plugins in this line and put them as built-ins, otherwise your
14 # application won't be able to load them.
19 # Built-in modules to build
20 # WARNING: do NOT put gtk and gnome together in this rule.
25 # Additional build options
38 PROFILING = @PROFILING@
53 # Installation environment
55 exec_prefix = @exec_prefix@
60 includedir = @includedir@
63 # Libraries for special cases
67 LIB_DARWIN = @LIB_DARWIN@
71 LIB_GLIDE = @LIB_GLIDE@
72 LIB_GNOME = @LIB_GNOME@
74 LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
76 LIB_MACOSX = @LIB_MACOSX@
78 LIB_NCURSES = @LIB_NCURSES@
82 LIB_DIRECTX = @LIB_DIRECTX@
84 LIB_XVIDEO = @LIB_XVIDEO@
88 # CFLAGS for special cases
90 CFLAGS_DVD = @CFLAGS_DVD@
91 CFLAGS_GTK = @CFLAGS_GTK@
92 CFLAGS_SDL = @CFLAGS_SDL@
93 CFLAGS_X11 = @CFLAGS_X11@
98 LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
100 ###############################################################################
101 # Configuration pre-processing
102 ###############################################################################
104 # PROGRAM_OPTIONS is an identification string of the compilation options
105 PROGRAM_OPTIONS = $(SYS) $(ARCH)
107 PROGRAM_OPTIONS += DEBUG
111 PROGRAM_OPTIONS += TRACE
114 ifeq ($(PROFILING),1)
115 PROGRAM_OPTIONS += PROFILING
116 DEFINE += -DPROFILING
119 PROGRAM_OPTIONS += STATS
123 # PROGRAM_BUILD is a complete identification of the build
124 # (we can't use fancy options with date since OSes like Solaris
125 # or FreeBSD have strange date implementations)
127 # XXX: beos does not support hostname (how lame...)
128 PROGRAM_BUILD = `date` $(USER)
130 PROGRAM_BUILD = `date` $(USER)@`hostname`
133 # PROGRAM_VERSION is the current vlc version
134 PROGRAM_VERSION=@VLC_VERSION@
135 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
137 # DEFINE will contain some of the constants definitions decided in Makefile,
138 # including SYS_xx. It will be passed to C compiler.
139 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
140 DEFINE += $(DEFINE_CONSTANTS)
142 # On Linux activate 64-bit off_t (by default under BSD)
143 ifneq (,$(findstring linux,$(SYS)))
144 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
147 ###############################################################################
148 # Tuning and other variables - do not change anything except if you know
149 # exactly what you are doing
150 ###############################################################################
153 # C headers directories
156 INCLUDE += -Iinclude -Iextras -I/usr/local/include
159 # Libraries needed by built-in modules
162 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
163 LIB += $(LIB_BUILTINS)
169 ifeq (1,$(LOCAL_LIBDVDCSS))
170 ifneq (,$(findstring dvd,$(BUILTINS)))
171 LIB += lib/libdvdcss.a
175 ifneq (,$(findstring mingw32,$(SYS)))
176 LIB += -lws2_32 -lnetapi32
179 LIB += -L/usr/local/lib @LIB@
182 # C compiler flags: mainstream compilation
185 CFLAGS += $(DEFINE) $(INCLUDE)
186 CFLAGS += -Wall -Winline
187 CFLAGS += -D_REENTRANT
188 CFLAGS += -D_GNU_SOURCE
190 # flags needed for clean beos compilation
192 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
195 ifneq (,$(findstring darwin,$(SYS)))
196 CFLAGS += -traditional-cpp
199 ifneq (,$(findstring mingw32,$(SYS)))
200 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
203 ifneq (,$(findstring bsd,$(SYS)))
207 # Optimizations : don't compile debug versions with them
210 CFLAGS += -ffast-math -funroll-loops
212 ifneq ($(PROFILING),1)
213 CFLAGS += -fomit-frame-pointer
217 # Optimizations for x86 familiy
218 ifneq (,$(findstring 86,$(ARCH)))
219 # Optional Pentium Pro optimizations
220 ifneq (,$(findstring ppro,$(ARCH)))
221 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
223 CFLAGS += -march=pentium -mcpu=pentium
227 # Optimizations for PowerPC
228 ifneq (,$(findstring powerpc,$(ARCH)))
229 CFLAGS += -mmultiple -mhard-float -mstring
232 # Optimizations for Sparc
233 ifneq (,$(findstring sparc,$(ARCH)))
234 CFLAGS += -mhard-float
237 #end of optimisations
241 # C compiler flags: dependancies
243 DCFLAGS += $(INCLUDE)
247 # C compiler flags: linking
249 LCFLAGS += @LCFLAGS@ $(LIB)
252 ifneq (,$(findstring mingw32,$(SYS)))
253 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
257 # C compiler flags: plugin compilation
259 ifneq (,$(findstring mingw32,$(SYS)))
260 PCFLAGS += -fnative-struct
266 # C compiler flags: plugin linking
268 PLCFLAGS += @PLCFLAGS@
271 # Debugging and profiling support
277 ifeq ($(PROFILING),1)