Parent Directory
|
Revision Log
Revision 785 - (view) (download)
1 : | edgomez | 511 | ############################################################################# |
2 : | # | ||
3 : | # GNU/Linux x86 Makefile | ||
4 : | # | ||
5 : | # Edit this file to enable/disable optimizations | ||
6 : | # | ||
7 : | chl | 785 | # $Id: Makefile.linuxx86,v 1.5.2.2 2003-01-13 18:20:20 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 : | LIBDIR = /usr/local/lib | ||
45 : | |||
46 : | ifeq ($(CC),icc) | ||
47 : | |||
48 : | # -tpp7 might be faster (P4 optmization)... | ||
49 : | CFLAGS += -O3 -ip -tpp6 -xM | ||
50 : | CFLAGS += -I/opt/intel/compiler50/ia32/include | ||
51 : | CFLAGS += -I/opt/intel/compiler50/ia32/substitute_headers/ | ||
52 : | |||
53 : | else | ||
54 : | |||
55 : | # Warning level options | ||
56 : | # Shows all warnings | ||
57 : | CFLAGS += -Wall | ||
58 : | # To detect non ANSI C code (xvid is not ANSI C (yet?)) | ||
59 : | # CFLAGS += -pedantic | ||
60 : | |||
61 : | |||
62 : | # General Optimization options | ||
63 : | suxen_drol | 720 | # Optimize code for size (implies -O2) |
64 : | CFLAGS += -Os | ||
65 : | edgomez | 511 | # Unroll loops code, this might speed up loops |
66 : | CFLAGS += -funroll-loops | ||
67 : | # Generates FPU math code | ||
68 : | CFLAGS += -ffast-math | ||
69 : | # ??? (man gcc) | ||
70 : | CFLAGS += -fstrict-aliasing | ||
71 : | # Omit the x86 push ebp; mov ebp, esp function | ||
72 : | # header and its corresponding function tailer | ||
73 : | CFLAGS += -fomit-frame-pointer | ||
74 : | # Generates Position Independant Code depending on your nasm version, | ||
75 : | # this could generate shared libraries that segfault because of a nasm | ||
76 : | # bug | ||
77 : | CFLAGS += -fPIC | ||
78 : | |||
79 : | # Debugging and Profiling options | ||
80 : | # Writes debugging symbols in object files | ||
81 : | # CFLAGS += -g | ||
82 : | # Includes profiling code in generated code, don't forget to disable | ||
83 : | # -fomit-frame-pointer as these 2 options are exclusive. | ||
84 : | # CFLAGS += -pg | ||
85 : | # Precise profiling + test coverage (-pg must be activated) | ||
86 : | # Build the library twice and execute a program using the lib twice too | ||
87 : | # First pass : Will create sourcefile.da files to keep branch statistics | ||
88 : | # CFLAGS += -fprofile-arcs | ||
89 : | # Second pass : Will create .bb and .bbg files suitable for coverage and | ||
90 : | # branch probabilities during compilation | ||
91 : | # CFLAGS += -fprofile-arcs -fbranch-probabilities -ftest-coverage | ||
92 : | |||
93 : | |||
94 : | # Architecture options : Valid for every gcc version | ||
95 : | # Uncomment the one which you want to compile for | ||
96 : | |||
97 : | # CFLAGS += -march=i386 -mcpu=i386 | ||
98 : | # CFLAGS += -march=i486 -mcpu=i486 | ||
99 : | # CFLAGS += -march=i586 -mcpu=i586 | ||
100 : | # CFLAGS += -march=i686 -mcpu=i686 | ||
101 : | # CFLAGS += -march=pentium -mcpu=pentium | ||
102 : | # CFLAGS += -march=pentiumpro -mcpu=pentiumpro | ||
103 : | |||
104 : | # Architecture options : Valid for every gcc >= 3.1 | ||
105 : | # Uncomment the one which you want to compile for | ||
106 : | |||
107 : | # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx | ||
108 : | # CFLAGS += -march=pentium3 -mcpu=pentium3 | ||
109 : | # CFLAGS += -march=pentium4 -mcpu=pentium4 | ||
110 : | # CFLAGS += -march=athlon -mcpu=athlon | ||
111 : | # CFLAGS += -march=k6 -mcpu=k6 | ||
112 : | # CFLAGS += -march=k6-2 -mcpu=k6-2 | ||
113 : | # CFLAGS += -march=k6-3 -mcpu=k6-3 | ||
114 : | # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird | ||
115 : | # CFLAGS += -march=athlon-xp -mcpu=athlon-xp | ||
116 : | # CFLAGS += -march=athlon-mp -mcpu=athlon-mp | ||
117 : | |||
118 : | # x86 specific optimization for every gcc | ||
119 : | # Aligns the stack to 2^4=16bytes boundaries in each function | ||
120 : | # Local variables should be aligned and make the code faster | ||
121 : | # some gcc versions (3.0.4) have problems with this option | ||
122 : | # we can't really trust gcc output :-( You're warned. | ||
123 : | CFLAGS += -mpreferred-stack-boundary=4 | ||
124 : | |||
125 : | # Architecture specific optimization available in gcc >= 3.1 | ||
126 : | # generates floating point sse code (for >= pentium 3) | ||
127 : | # CFLAGS += -mfpmath=sse | ||
128 : | # generates both floating point sse and 387 code, this double the amount | ||
129 : | # of fp registers and could make the code faster | ||
130 : | # (Still experimental in gcc 3.1.0) | ||
131 : | # CFLAGS += -mfpmath=sse,387 | ||
132 : | |||
133 : | endif | ||
134 : | |||
135 : | ############################################################################# | ||
136 : | # | ||
137 : | # Makefile rules | ||
138 : | # | ||
139 : | ############################################################################# | ||
140 : | |||
141 : | %.o: %.asm | ||
142 : | chl | 647 | $(AS) $(AFLAGS) -I$(<D) $< -o $@ |
143 : | edgomez | 511 | |
144 : | suxen_drol | 720 | |
145 : | edgomez | 511 | RM = rm -rf |
146 : | |||
147 : | |||
148 : | all: $(LIB) $(LIBSO) | ||
149 : | |||
150 : | |||
151 : | $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) | ||
152 : | ar rcs $@ $^ | ||
153 : | |||
154 : | |||
155 : | $(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) | ||
156 : | $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ | ||
157 : | |||
158 : | |||
159 : | clean: | ||
160 : | $(RM) `find $(SRCDIR) -name "*.o"` | ||
161 : | $(RM) $(LIB) | ||
162 : | $(RM) $(LIBSO) | ||
163 : | |||
164 : | install: $(LIBSO) $(LIB) | ||
165 : | cp $(LIBSO) $(LIBDIR) # you have to bee root for this | ||
166 : | cp $(LIB) $(LIBDIR) | ||
167 : | /sbin/ldconfig | ||
168 : | |||
169 : | # if you don't want to overwrite previous compile | ||
170 : | install-test: $(LIBSO) | ||
171 : | cp $(LIBSO) $(LIBDIR)/libtestcore.so | ||
172 : | /sbin/ldconfig | ||
173 : | chl | 785 | |
174 : | install-branch: $(LIBSO) | ||
175 : | cp $(LIBSO) $(LIBDIR)/libxvidbranch.so | ||
176 : | /sbin/ldconfig | ||
177 : |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |