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@
75 LIB_MACOSX = @LIB_MACOSX@
76 LIB_NCURSES = @LIB_NCURSES@
80 LIB_DIRECTX = @LIB_DIRECTX@
82 LIB_XVIDEO = @LIB_XVIDEO@
86 # CFLAGS for special cases
88 CFLAGS_DVD = @CFLAGS_DVD@
89 CFLAGS_GTK = @CFLAGS_GTK@
90 CFLAGS_SDL = @CFLAGS_SDL@
91 CFLAGS_X11 = @CFLAGS_X11@
96 LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
98 ###############################################################################
99 # Configuration pre-processing
100 ###############################################################################
102 # PROGRAM_OPTIONS is an identification string of the compilation options
103 PROGRAM_OPTIONS = $(SYS) $(ARCH)
105 PROGRAM_OPTIONS += DEBUG
109 PROGRAM_OPTIONS += TRACE
112 ifeq ($(PROFILING),1)
113 PROGRAM_OPTIONS += PROFILING
114 DEFINE += -DPROFILING
117 PROGRAM_OPTIONS += STATS
121 # PROGRAM_BUILD is a complete identification of the build
122 # (we can't use fancy options with date since OSes like Solaris
123 # or FreeBSD have strange date implementations)
125 # XXX: beos does not support hostname (how lame...)
126 PROGRAM_BUILD = `date` $(USER)
128 PROGRAM_BUILD = `date` $(USER)@`hostname`
131 # PROGRAM_VERSION is the current vlc version
132 PROGRAM_VERSION=@VLC_VERSION@
133 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
135 # DEFINE will contain some of the constants definitions decided in Makefile,
136 # including SYS_xx. It will be passed to C compiler.
137 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
138 DEFINE += $(DEFINE_CONSTANTS)
140 # On Linux activate 64-bit off_t (by default under BSD)
141 ifneq (,$(findstring linux,$(SYS)))
142 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
145 ###############################################################################
146 # Tuning and other variables - do not change anything except if you know
147 # exactly what you are doing
148 ###############################################################################
151 # C headers directories
154 INCLUDE += -Iinclude -Iextras -I/usr/local/include
157 # Libraries needed by built-in modules
160 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
161 LIB += $(LIB_BUILTINS)
167 ifeq (1,$(LOCAL_LIBDVDCSS))
168 ifneq (,$(findstring dvd,$(BUILTINS)))
169 LIB += lib/libdvdcss.a
173 ifneq (,$(findstring mingw32,$(SYS)))
174 LIB += -lws2_32 -lnetapi32
177 LIB += -L/usr/local/lib @LIB@
180 # C compiler flags: mainstream compilation
183 CFLAGS += $(DEFINE) $(INCLUDE)
184 CFLAGS += -Wall -Winline
185 CFLAGS += -D_REENTRANT
186 CFLAGS += -D_GNU_SOURCE
188 # flags needed for clean beos compilation
190 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
193 ifneq (,$(findstring darwin,$(SYS)))
194 CFLAGS += -traditional-cpp
197 ifneq (,$(findstring mingw32,$(SYS)))
198 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
201 # Optimizations : don't compile debug versions with them
204 CFLAGS += -ffast-math -funroll-loops
206 ifneq ($(PROFILING),1)
207 CFLAGS += -fomit-frame-pointer
211 # Optimizations for x86 familiy
212 ifneq (,$(findstring 86,$(ARCH)))
213 # Optional Pentium Pro optimizations
214 ifneq (,$(findstring ppro,$(ARCH)))
215 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
217 CFLAGS += -march=pentium -mcpu=pentium
221 # Optimizations for PowerPC
222 ifneq (,$(findstring powerpc,$(ARCH)))
223 CFLAGS += -mmultiple -mhard-float -mstring
226 # Optimizations for Sparc
227 ifneq (,$(findstring sparc,$(ARCH)))
228 CFLAGS += -mhard-float
231 #end of optimisations
235 # C compiler flags: dependancies
237 DCFLAGS += $(INCLUDE)
241 # C compiler flags: linking
243 LCFLAGS += @LCFLAGS@ $(LIB)
246 ifneq (,$(findstring mingw32,$(SYS)))
247 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
251 # C compiler flags: plugin compilation
253 ifneq (,$(findstring mingw32,$(SYS)))
254 PCFLAGS += -fnative-struct
260 # C compiler flags: plugin linking
262 PLCFLAGS += @PLCFLAGS@
265 # Debugging and profiling support
271 ifeq ($(PROFILING),1)