[svn] / trunk / xvidcore / build / generic / Makefile.linuxx86 Repository:
ViewVC logotype

Annotation of /trunk/xvidcore/build/generic/Makefile.linuxx86

Parent Directory Parent Directory | Revision Log Revision Log


Revision 647 - (view) (download)

1 : edgomez 511 #############################################################################
2 :     #
3 :     # GNU/Linux x86 Makefile
4 :     #
5 :     # Edit this file to enable/disable optimizations
6 :     #
7 : chl 647 # $Id: Makefile.linuxx86,v 1.4 2002-11-16 11:16:09 chl Exp $
8 : edgomez 511 #
9 :     #############################################################################
10 :    
11 :     include Makefile.inc
12 :    
13 :     # You can set/add options to CC and CFLAGS without editing this Makefile
14 :     # You have just to export an environment CC/CFLAGS variable before running
15 :     # make.
16 :     #
17 :     # Examples :
18 :     # $ export CC='gcc-3.1'
19 :     # $ export CFLAGS='-maccumulate-outgoing-args'
20 :     # $ make
21 :     # ...
22 :    
23 :     # You can choose a specific compiler here removing the sharp symbol
24 :     # - Default is 'cc' which is a symlink to your default distro gcc
25 :    
26 :    
27 :     # CC = gcc
28 :     # CC = gcc-3.1
29 :     # CC = icc
30 :    
31 :     # Assembler
32 :     AS = nasm
33 :     AFLAGS = -f elf
34 :    
35 :     # Constants which should not be modified
36 :     CFLAGS += -DARCH_X86
37 :     CFLAGS += -DLINUX
38 :    
39 :     # Enable some experimental/debugging code
40 :     # (Use only if you know what you're doing !)
41 :     # PSNR during encoding
42 :     # CFLAGS += -D_DEBUG_PSNR
43 :    
44 :     # Enable BFrame decoding (still beta)
45 : edgomez 536 # CFLAGS += -DBFRAMES_DEC
46 : edgomez 511
47 :     LIBDIR = /usr/local/lib
48 :    
49 :     ifeq ($(CC),icc)
50 :    
51 :     # -tpp7 might be faster (P4 optmization)...
52 :     CFLAGS += -O3 -ip -tpp6 -xM
53 :     CFLAGS += -I/opt/intel/compiler50/ia32/include
54 :     CFLAGS += -I/opt/intel/compiler50/ia32/substitute_headers/
55 :    
56 :     else
57 :    
58 :     # Warning level options
59 :     # Shows all warnings
60 :     CFLAGS += -Wall
61 :     # To detect non ANSI C code (xvid is not ANSI C (yet?))
62 :     # CFLAGS += -pedantic
63 :    
64 :    
65 :     # General Optimization options
66 : chl 612 # on gcc 2.95 using -Os (which implies -O2) might be faster
67 :     CFLAGS += -O2
68 : edgomez 511 # Unroll loops code, this might speed up loops
69 :     CFLAGS += -funroll-loops
70 :     # Generates FPU math code
71 :     CFLAGS += -ffast-math
72 :     # ??? (man gcc)
73 :     CFLAGS += -fstrict-aliasing
74 :     # Omit the x86 push ebp; mov ebp, esp function
75 :     # header and its corresponding function tailer
76 :     CFLAGS += -fomit-frame-pointer
77 :     # Generates Position Independant Code depending on your nasm version,
78 :     # this could generate shared libraries that segfault because of a nasm
79 :     # bug
80 :     CFLAGS += -fPIC
81 :    
82 :     # Debugging and Profiling options
83 :     # Writes debugging symbols in object files
84 :     # CFLAGS += -g
85 :     # Includes profiling code in generated code, don't forget to disable
86 :     # -fomit-frame-pointer as these 2 options are exclusive.
87 :     # CFLAGS += -pg
88 :     # Precise profiling + test coverage (-pg must be activated)
89 :     # Build the library twice and execute a program using the lib twice too
90 :     # First pass : Will create sourcefile.da files to keep branch statistics
91 :     # CFLAGS += -fprofile-arcs
92 :     # Second pass : Will create .bb and .bbg files suitable for coverage and
93 :     # branch probabilities during compilation
94 :     # CFLAGS += -fprofile-arcs -fbranch-probabilities -ftest-coverage
95 :    
96 :    
97 :     # Architecture options : Valid for every gcc version
98 :     # Uncomment the one which you want to compile for
99 :    
100 :     # CFLAGS += -march=i386 -mcpu=i386
101 :     # CFLAGS += -march=i486 -mcpu=i486
102 :     # CFLAGS += -march=i586 -mcpu=i586
103 :     # CFLAGS += -march=i686 -mcpu=i686
104 :     # CFLAGS += -march=pentium -mcpu=pentium
105 :     # CFLAGS += -march=pentiumpro -mcpu=pentiumpro
106 :    
107 :     # Architecture options : Valid for every gcc >= 3.1
108 :     # Uncomment the one which you want to compile for
109 :    
110 :     # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx
111 :     # CFLAGS += -march=pentium3 -mcpu=pentium3
112 :     # CFLAGS += -march=pentium4 -mcpu=pentium4
113 :     # CFLAGS += -march=athlon -mcpu=athlon
114 :     # CFLAGS += -march=k6 -mcpu=k6
115 :     # CFLAGS += -march=k6-2 -mcpu=k6-2
116 :     # CFLAGS += -march=k6-3 -mcpu=k6-3
117 :     # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird
118 :     # CFLAGS += -march=athlon-xp -mcpu=athlon-xp
119 :     # CFLAGS += -march=athlon-mp -mcpu=athlon-mp
120 :    
121 :     # x86 specific optimization for every gcc
122 :     # Aligns the stack to 2^4=16bytes boundaries in each function
123 :     # Local variables should be aligned and make the code faster
124 :     # some gcc versions (3.0.4) have problems with this option
125 :     # we can't really trust gcc output :-( You're warned.
126 :     CFLAGS += -mpreferred-stack-boundary=4
127 :    
128 :     # Architecture specific optimization available in gcc >= 3.1
129 :     # generates floating point sse code (for >= pentium 3)
130 :     # CFLAGS += -mfpmath=sse
131 :     # generates both floating point sse and 387 code, this double the amount
132 :     # of fp registers and could make the code faster
133 :     # (Still experimental in gcc 3.1.0)
134 :     # CFLAGS += -mfpmath=sse,387
135 :    
136 :     endif
137 :    
138 :     #############################################################################
139 :     #
140 :     # Makefile rules
141 :     #
142 :     #############################################################################
143 :    
144 :     %.o: %.asm
145 : chl 647 $(AS) $(AFLAGS) -I$(<D) $< -o $@
146 : edgomez 511
147 :     RM = rm -rf
148 :    
149 :    
150 :     all: $(LIB) $(LIBSO)
151 :    
152 :    
153 :     $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
154 :     ar rcs $@ $^
155 :    
156 :    
157 :     $(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
158 :     $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@
159 :    
160 :    
161 :     clean:
162 :     $(RM) `find $(SRCDIR) -name "*.o"`
163 :     $(RM) $(LIB)
164 :     $(RM) $(LIBSO)
165 :    
166 :     install: $(LIBSO) $(LIB)
167 :     cp $(LIBSO) $(LIBDIR) # you have to bee root for this
168 :     cp $(LIB) $(LIBDIR)
169 :     /sbin/ldconfig
170 :    
171 :     # if you don't want to overwrite previous compile
172 :     install-test: $(LIBSO)
173 :     cp $(LIBSO) $(LIBDIR)/libtestcore.so
174 :     /sbin/ldconfig

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4