################################################################################
# Debugging mode on or off (set to 1 to activate)
-DEBUG=0
+DEBUG=@DEBUG@
+STATS=@STATS@
+OPTIMS=@OPTIMS@
SYS=@SYS@
PLUGINS=@PLUGINS@
PROGRAM_OPTIONS += DEBUG
DEFINE += -DDEBUG
endif
+ifeq ($(STATS),1)
+PROGRAM_OPTIONS += DEBUG
+DEFINE += -DSTATS
+endif
# PROGRAM_BUILD is a complete identification of the build
# ( we can't use fancy options with date since OSes like Solaris
#
# C compiler flags: compilation
#
-CCFLAGS += $(DEFINE) $(INCLUDE)
-CCFLAGS += -Wall -Winline
-CCFLAGS += -D_REENTRANT
-CCFLAGS += -D_GNU_SOURCE
+CFLAGS += $(DEFINE) $(INCLUDE)
+CFLAGS += -Wall -Winline
+CFLAGS += -D_REENTRANT
+CFLAGS += -D_GNU_SOURCE
# flags needed for clean beos compilation
ifeq ($(SYS),beos)
-CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
+CFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
endif
# Optimizations : don't compile debug versions with them
-ifeq ($(DEBUG),0)
-CCFLAGS += -O6
-CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
-CCFLAGS += -fomit-frame-pointer
+ifeq ($(OPTIMS),1)
+CFLAGS += -O6
+CFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
+CFLAGS += -fomit-frame-pointer
# Optimizations for x86 familiy
ifneq (,$(findstring 86,$(ARCH)))
-CCFLAGS += -malign-double
-# Eventual Pentium Pro optimizations
+CFLAGS += -malign-double
+# Optional Pentium Pro optimizations
ifneq (,$(findstring ppro,$(ARCH)))
ifneq ($(SYS), BSD)
-CCFLAGS += -march=pentiumpro
+CFLAGS += -march=pentiumpro
endif
else
-CCFLAGS += -march=pentium
-endif
-# Eventual MMX optimizations for x86
-ifneq (,$(findstring mmx,$(ARCH)))
-CFLAGS += -DHAVE_MMX
+CFLAGS += -march=pentium
endif
endif
# Optimizations for PowerPC
-ifneq (,$(findstring ppc,$(ARCH)))
-CCFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
+ifneq (,$(findstring powerpc,$(ARCH)))
+# 604e
+CFLAGS += -mcpu=604e -mmultiple -mhard-float -mstring
+# G3
+#CFLAGS += -mcpu=750 -mmultiple -mhard-float -mstring
+# G4
+#CFLAGS += -mcpu=7400 -mmultiple -mhard-float -mstring
endif
# Optimizations for Sparc
ifneq (,$(findstring sparc,$(ARCH)))
-CCFLAGS += -mhard-float
+CFLAGS += -mhard-float
endif
-# End of optimizations
+# /debug
endif
+# Optional MMX optimizations for x86
+ifneq (,$(findstring mmx,$(ARCH)))
+CFLAGS += -DHAVE_MMX
+endif
+
+# End of optimizations
+
#
# C compiler flags: dependancies
#
#
# Debugging and profiling support
-ifneq ($(DEBUG),0)
-ifeq ($(SYS),beos)
+ifneq ($(OPTIMS),0)
CFLAGS += -g
-else
-CFLAGS += -pg
-endif
endif
#################################################################################
PLUGIN_SDL = plugins/sdl/sdl.o \
plugins/sdl/intf_sdl.o \
- plugins/sdl/vout_sdl.o
+ plugins/sdl/vout_sdl.o
+# plugins/sdl/video_yuv.o \
+# plugins/sdl/video_yuvall.o
+
PLUGIN_GLIDE = plugins/glide/glide.o \
plugins/glide/intf_glide.o \
plugins/yuv/video_yuv24.o \
plugins/yuv/video_yuv32.o
+
PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
plugins/yuvmmx/video_yuv.o \
plugins/yuvmmx/video_yuv8.o \
plugins/yuvmmx/video_yuv24.o \
plugins/yuvmmx/video_yuv32.o
+PLUGIN_ALSA = plugins/alsa/alsa.o \
+ plugins/alsa/aout_alsa.o
+
PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \
$(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \
$(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_YUV) $(PLUGIN_YUVMMX) \
- $(PLUGIN_SDL)
+ $(PLUGIN_SDL) $(PLUGIN_ALSA)
#
# Other lists of files
#
rm -f Makefile include/defs.h include/config.h
rm -f config.status config.cache config.log
rm -f gmon.out core build-stamp
- rm -rf .dep debian/tmp
+ rm -rf .dep
+ rm -rf debian/tmp debian/files debian/*.debhelper debian/*.substvars
+ find debian/* -type d -maxdepth 0 -name 'vlc-*' | xargs rm -rf
install:
mkdir -p $(prefix)/bin
$(INSTALL) vlc $(prefix)/bin
- for alias in @ALIASES@ ; do ln -s vlc $(prefix)/bin/$$alias ; done
+ # ugly
+ for alias in "" @ALIASES@ ; do if test $$alias ; then ln -s vlc $(prefix)/bin/$$alias ; fi ; done
mkdir -p $(prefix)/lib/videolan/vlc
$(INSTALL) -m 644 $(PLUGINS) $(prefix)/lib/videolan/vlc
mkdir -p $(prefix)/share/videolan
show:
@echo CC: $(CC)
- @echo CCFLAGS: $(CCFLAGS)
+ @echo CFLAGS: $(CFLAGS)
@echo DCFLAGS: $(DCFLAGS)
- @echo LCFLAGS: $(CCFLAGS)
+ @echo LCFLAGS: $(LCFLAGS)
# ugliest of all, but I have no time to do it -- sam
snapshot:
rm -rf /tmp/${SNAPSHOTDIR}
mkdir /tmp/${SNAPSHOTDIR}
- cp -r * /tmp/${SNAPSHOTDIR}
+ cp -a * /tmp/${SNAPSHOTDIR}
(cd /tmp/${SNAPSHOTDIR} ; \
make distclean ; \
find . -type d -name CVS | xargs rm -rf ; \
#
vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
ifeq ($(SYS),beos)
- $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
+ $(CC) $(CFLAGS) $(LCFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
rm -f ./plugins/_APP_
ln -s ../vlc ./plugins/_APP_
else
- $(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
+ $(CC) $(CFLAGS) $(LCFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
endif
#
$(C_OBJ): %.o: Makefile.dep
$(C_OBJ): %.o: .dep/%.d
$(C_OBJ): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
$(CPP_OBJ): %.o: %.cpp
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
$(ASM_OBJ): %.o: Makefile.dep
$(ASM_OBJ): %.o: %.S
#$(PLUGIN_OBJ): %.so: .dep/%.d
lib/beos.so: $(PLUGIN_BEOS)
- $(CC) $(CCFLAGS) $(CFLAGS) $(LCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+ $(CC) $(CFLAGS) $(LCFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
$(PLUGIN_BEOS): %.o: %.cpp
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/esd.so: $(PLUGIN_ESD)
ifneq (,$(findstring bsd,$(SYS)))
ld -shared -laudiofile -lesd -o $@ $^
endif
$(PLUGIN_ESD): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/dsp.so: $(PLUGIN_DSP)
ld -shared -o $@ $^
$(PLUGIN_DSP): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+lib/alsa.so: $(PLUGIN_ALSA)
+ ld -shared -o $@ $^
+$(PLUGIN_ALSA): %.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/dummy.so: $(PLUGIN_DUMMY)
ld -shared -o $@ $^
$(PLUGIN_DUMMY): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/fb.so: $(PLUGIN_FB)
ld -shared -o $@ $^
$(PLUGIN_FB): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/x11.so: $(PLUGIN_X11)
ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
$(PLUGIN_X11): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/mga.so: $(PLUGIN_MGA)
ld -shared -L/usr/X11R6/lib -lX11 -lXext -o $@ $^
$(PLUGIN_MGA): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/gnome.so: $(PLUGIN_GNOME)
ld -shared `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` -o $@ $^
$(PLUGIN_GNOME): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
+ $(CC) $(CFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
lib/glide.so: $(PLUGIN_GLIDE)
ld -shared -lglide2x -o $@ $^
$(PLUGIN_GLIDE): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -I/usr/include/glide -c -o $@ $<
+ $(CC) $(CFLAGS) -I/usr/include/glide -c -o $@ $<
lib/ggi.so: $(PLUGIN_GGI)
ld -shared -lggi -o $@ $^
$(PLUGIN_GGI): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/sdl.so: $(PLUGIN_SDL)
ld -shared -lSDL -o $@ $^
$(PLUGIN_SDL): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
lib/yuv.so: $(PLUGIN_YUV)
ifeq ($(SYS),beos)
- $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+ $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
ld -shared -o $@ $^
endif
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
ifeq ($(SYS),beos)
- $(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+ $(CC) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
ld -shared -o $@ $^
endif
$(PLUGIN_YUVMMX): %.o: %.c
- $(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) -c -o $@ $<
################################################################################
# Note on generic rules and dependancies