--- trunk/xvidcore/build/generic/Makefile.linuxppc 2002/09/22 12:10:34 511 +++ trunk/xvidcore/build/generic/Makefile.linuxppc 2002/09/22 12:13:21 512 @@ -1,33 +1,92 @@ -#/************************************************************************** -# * -# * Linux PPC makefile -# * -# * Adapted from linux x86 Makefile by Guillaume Morin -# * -# * libso: -# * (-lm not neccessary if using -ffast-math) -# * -# *************************************************************************/ - +############################################################################# +# +# GNU/Linux PPC Makefile +# +# Edit this file to enable/disable optimizations +# +# $Id: Makefile.linuxppc,v 1.7 2002-09-22 12:13:21 edgomez Exp $ +# +############################################################################# include Makefile.inc -CC = gcc +# You can set/add options to CC and CFLAGS without editing this Makefile +# You have just to export an environment CC/CFLAGS variable before running +# make. +# +# Examples : +# $ export CC='gcc-3.1' +# $ export CFLAGS='-maccumulate-outgoing-args' +# $ make +# ... -CFLAGS = -DLINUX -DARCH_PPC -DARCH_IS_BIG_ENDIAN -LIBDIR = /usr/local/lib +# You can choose a specific compiler here removing the sharp symbol +# - Default is 'cc' which is a symlink to your default distro gcc -CFLAGS += -Wall -O3 -funroll-loops -ffast-math -CFLAGS += -fstrict-aliasing -fomit-frame-pointer -## for profiling, uncomment the next line. -#CFLAGS += -D_PROFILING_ +# CC = gcc +# CC = gcc-3.1 -## for debugging, comment the previous lines and uncomment the next one. -#CFLAGS += -Wall -g +# Assembler +AS = as +# Constants which should not be modified +CFLAGS += -DLINUX +CFLAGS += -DARCH_PPC +CFLAGS += -DARCH_IS_BIG_ENDIAN + +# Enable some experimental/debugging code +# (Use only if you know what you're doing !) + # PSNR during encoding +# CFLAGS += -D_DEBUG_PSNR -AS = as +# Enable BFrame decoding (still beta) +# CFLAGS += -DBRAMES_DEC + +LIBDIR = /usr/local/lib + + # Warning level options + # Shows all warnings + CFLAGS += -Wall + # To detect non ANSI C code (xvid is not ANSI C (yet?)) + # CFLAGS += -pedantic + + + # General Optimization options + # Optimize code for size (implies -O2) + CFLAGS += -Os + # Unroll loops code, this might speed up loops + CFLAGS += -funroll-loops + # Generates FPU math code + CFLAGS += -ffast-math + # ??? (man gcc) + CFLAGS += -fstrict-aliasing + # Omit the frame pointer saving at function beginning + CFLAGS += -fomit-frame-pointer + # Generates Position Independant Code depending on your nasm version, + # this could generate shared libraries that segfault because of a nasm + # bug + CFLAGS += -fPIC + + # Debugging and Profiling options + # Writes debugging symbols in object files + # CFLAGS += -g + # Includes profiling code in generated code, don't forget to disable + # -fomit-frame-pointer as these 2 options are exclusive. + # CFLAGS += -pg + # Precise profiling + test coverage (-pg must be activated) + # Build the library twice and execute a program using the lib twice too + # First pass : Will create sourcefile.da files to keep branch statistics + # CFLAGS += -fprofile-arcs + # Second pass : Will create .bb and .bbg files suitable for coverage and + # branch probabilities during compilation + # CFLAGS += -fprofile-arcs -fbranch-probabilities -ftest-coverage + +############################################################################# +# +# Makefile rules +# +############################################################################# %.o: %.s $(AS) $< -o $@ @@ -39,24 +98,19 @@ $(LIB): $(SRC:.c=.o) $(SRC_PPC:.s=.o) ar rcs $@ $^ - $(LIBSO): $(SRC:.c=.o) $(SRC_PPC:.s=.o) $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ clean: $(RM) `find $(SRCDIR) -name "*.o"` - -remove-all: - $(RM) $(DIRS) - $(RM) $(DIRS_PPC) $(RM) $(LIB) $(RM) $(LIBSO) - -install: libxvidcore.so - cp libxvidcore.so $(LIBDIR) # you have to be root for this +install: $(LIBSO) $(LIB) + cp $(LIBSO) $(LIBDIR) # you have to be root for this + cp $(LIB) $(LIBDIR) /sbin/ldconfig -install-test: libxvidcore.so # if you don't want to overwrite previous compile - cp libxvidcore.so $(LIBDIR)/libtestcore.so +install-test: $(LIBSO) # if you don't want to overwrite previous compile + cp $(LIBSO) $(LIBDIR)/libtestcore.so /sbin/ldconfig