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@
77 LIB_NCURSES = @LIB_NCURSES@
81 LIB_DIRECTX = @LIB_DIRECTX@
83 LIB_XVIDEO = @LIB_XVIDEO@
87 # CFLAGS for special cases
89 CFLAGS_DVD = @CFLAGS_DVD@
90 CFLAGS_GTK = @CFLAGS_GTK@
91 CFLAGS_SDL = @CFLAGS_SDL@
92 CFLAGS_X11 = @CFLAGS_X11@
97 LOCAL_LIBDVDCSS = @LOCAL_LIBDVDCSS@
99 ###############################################################################
100 # Configuration pre-processing
101 ###############################################################################
103 # PROGRAM_OPTIONS is an identification string of the compilation options
104 PROGRAM_OPTIONS = $(SYS) $(ARCH)
106 PROGRAM_OPTIONS += DEBUG
110 PROGRAM_OPTIONS += TRACE
113 ifeq ($(PROFILING),1)
114 PROGRAM_OPTIONS += PROFILING
115 DEFINE += -DPROFILING
118 PROGRAM_OPTIONS += STATS
122 # PROGRAM_BUILD is a complete identification of the build
123 # (we can't use fancy options with date since OSes like Solaris
124 # or FreeBSD have strange date implementations)
126 # XXX: beos does not support hostname (how lame...)
127 PROGRAM_BUILD = `date` $(USER)
129 PROGRAM_BUILD = `date` $(USER)@`hostname`
132 # PROGRAM_VERSION is the current vlc version
133 PROGRAM_VERSION=@VLC_VERSION@
134 LIBDVDCSS_VERSION=@LIBDVDCSS_VERSION@
136 # DEFINE will contain some of the constants definitions decided in Makefile,
137 # including SYS_xx. It will be passed to C compiler.
138 DEFINE_CONSTANTS := -DSYS_$(shell echo $(SYS) | sed -e 's/-.*//' | tr '[a-z].' '[A-Z]_')
139 DEFINE += $(DEFINE_CONSTANTS)
141 # On Linux activate 64-bit off_t (by default under BSD)
142 ifneq (,$(findstring linux,$(SYS)))
143 DEFINE += -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98
146 ###############################################################################
147 # Tuning and other variables - do not change anything except if you know
148 # exactly what you are doing
149 ###############################################################################
152 # C headers directories
155 INCLUDE += -Iinclude -Iextras -I/usr/local/include
158 # Libraries needed by built-in modules
161 LIB_BUILTINS := $(shell for i in ${BUILTINS} ; do echo $$i | tr '[a-z]' '[A-Z]' | sed -e 's/.*/$$LIB_&/' ; done)
162 LIB += $(LIB_BUILTINS)
168 ifeq (1,$(LOCAL_LIBDVDCSS))
169 ifneq (,$(findstring dvd,$(BUILTINS)))
170 LIB += lib/libdvdcss.a
174 ifneq (,$(findstring mingw32,$(SYS)))
175 LIB += -lws2_32 -lnetapi32
178 LIB += -L/usr/local/lib @LIB@
181 # C compiler flags: mainstream compilation
184 CFLAGS += $(DEFINE) $(INCLUDE)
185 CFLAGS += -Wall -Winline
186 CFLAGS += -D_REENTRANT
187 CFLAGS += -D_GNU_SOURCE
189 # flags needed for clean beos compilation
191 CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
194 ifneq (,$(findstring darwin,$(SYS)))
195 CFLAGS += -traditional-cpp
198 ifneq (,$(findstring mingw32,$(SYS)))
199 CFLAGS += -fnative-struct -D_OFF_T_ -D_off_t=long
202 ifneq (,$(findstring bsd,$(SYS)))
206 # Optimizations : don't compile debug versions with them
209 CFLAGS += -ffast-math -funroll-loops
211 ifneq ($(PROFILING),1)
212 CFLAGS += -fomit-frame-pointer
216 # Optimizations for x86 familiy
217 ifneq (,$(findstring 86,$(ARCH)))
218 # Optional Pentium Pro optimizations
219 ifneq (,$(findstring ppro,$(ARCH)))
220 CFLAGS += -march=pentiumpro -mcpu=pentiumpro
222 CFLAGS += -march=pentium -mcpu=pentium
226 # Optimizations for PowerPC
227 ifneq (,$(findstring powerpc,$(ARCH)))
228 CFLAGS += -mmultiple -mhard-float -mstring
231 # Optimizations for Sparc
232 ifneq (,$(findstring sparc,$(ARCH)))
233 CFLAGS += -mhard-float
236 #end of optimisations
240 # C compiler flags: dependancies
242 DCFLAGS += $(INCLUDE)
246 # C compiler flags: linking
248 LCFLAGS += @LCFLAGS@ $(LIB)
251 ifneq (,$(findstring mingw32,$(SYS)))
252 LCFLAGS += -mwindows -Xlinker --force-exe-suffix
256 # C compiler flags: plugin compilation
258 ifneq (,$(findstring mingw32,$(SYS)))
259 PCFLAGS += -fnative-struct
265 # C compiler flags: plugin linking
267 PLCFLAGS += @PLCFLAGS@
270 # Debugging and profiling support
276 ifeq ($(PROFILING),1)