############################################################################# # # GNU/Linux x86 Makefile # # Edit this file to enable/disable optimizations # # $Id: Makefile.linuxx86,v 1.5 2002-12-14 09:28:56 suxen_drol Exp $ # ############################################################################# include Makefile.inc # 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 # ... # You can choose a specific compiler here removing the sharp symbol # - Default is 'cc' which is a symlink to your default distro gcc # CC = gcc # CC = gcc-3.1 # CC = icc # Assembler AS = nasm AFLAGS = -f elf # Constants which should not be modified CFLAGS += -DARCH_X86 CFLAGS += -DLINUX # Enable some experimental/debugging code # (Use only if you know what you're doing !) # PSNR during encoding # CFLAGS += -D_DEBUG_PSNR LIBDIR = /usr/local/lib ifeq ($(CC),icc) # -tpp7 might be faster (P4 optmization)... CFLAGS += -O3 -ip -tpp6 -xM CFLAGS += -I/opt/intel/compiler50/ia32/include CFLAGS += -I/opt/intel/compiler50/ia32/substitute_headers/ else # 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 # on gcc 2.95 using -Os (which implies -O2) might be faster CFLAGS += -O2 # 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 x86 push ebp; mov ebp, esp function # header and its corresponding function tailer 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 # Architecture options : Valid for every gcc version # Uncomment the one which you want to compile for # CFLAGS += -march=i386 -mcpu=i386 # CFLAGS += -march=i486 -mcpu=i486 # CFLAGS += -march=i586 -mcpu=i586 # CFLAGS += -march=i686 -mcpu=i686 # CFLAGS += -march=pentium -mcpu=pentium # CFLAGS += -march=pentiumpro -mcpu=pentiumpro # Architecture options : Valid for every gcc >= 3.1 # Uncomment the one which you want to compile for # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx # CFLAGS += -march=pentium3 -mcpu=pentium3 # CFLAGS += -march=pentium4 -mcpu=pentium4 # CFLAGS += -march=athlon -mcpu=athlon # CFLAGS += -march=k6 -mcpu=k6 # CFLAGS += -march=k6-2 -mcpu=k6-2 # CFLAGS += -march=k6-3 -mcpu=k6-3 # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird # CFLAGS += -march=athlon-xp -mcpu=athlon-xp # CFLAGS += -march=athlon-mp -mcpu=athlon-mp # x86 specific optimization for every gcc # Aligns the stack to 2^4=16bytes boundaries in each function # Local variables should be aligned and make the code faster # some gcc versions (3.0.4) have problems with this option # we can't really trust gcc output :-( You're warned. CFLAGS += -mpreferred-stack-boundary=4 # Architecture specific optimization available in gcc >= 3.1 # generates floating point sse code (for >= pentium 3) # CFLAGS += -mfpmath=sse # generates both floating point sse and 387 code, this double the amount # of fp registers and could make the code faster # (Still experimental in gcc 3.1.0) # CFLAGS += -mfpmath=sse,387 endif ############################################################################# # # Makefile rules # ############################################################################# %.o: %.asm $(AS) $(AFLAGS) -I$(