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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 395 - (view) (download)

1 : edgomez 191 #############################################################################
2 :     #
3 :     # GNU/Linux Makefile
4 :     #
5 :     # Edit this file to enable/disable optimizations
6 :     #
7 : edgomez 395 # $Id: Makefile.linux,v 1.7 2002-09-04 20:14:45 edgomez Exp $
8 : edgomez 191 #
9 :     #############################################################################
10 : Isibaar 3
11 :     include Makefile.inc
12 :    
13 : edgomez 191 # 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 : Isibaar 3
23 : edgomez 191 # 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 : chl 266 # Enable multithreaded ME (experimental), other routines to follow
40 :     # CFLAGS += -D_SMP
41 :    
42 : edgomez 191 # Enable some experimental/debugging code
43 :     # (Use only if you know what you're doing !)
44 : edgomez 236 # PSNR during encoding
45 :     # CFLAGS += -D_DEBUG_PSNR
46 : edgomez 191
47 : Isibaar 3 LIBDIR = /usr/local/lib
48 :    
49 :     ifeq ($(CC),icc)
50 :    
51 : edgomez 191 # -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 : Isibaar 3 else
57 :    
58 : edgomez 191 # 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 : Isibaar 3
64 : edgomez 314
65 : edgomez 191 # General Optimization options
66 :     # Optimize code for size (implies -O2)
67 :     CFLAGS += -Os
68 :     # 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 : edgomez 314 CFLAGS += -fPIC
81 : edgomez 191
82 : edgomez 314 # 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 += -p
88 : edgomez 191
89 : edgomez 314
90 : edgomez 191 # Architecture options : Valid for every gcc version
91 :     # Uncomment the one which you want to compile for
92 :    
93 :     # CFLAGS += -march=i386 -mcpu=i386
94 :     # CFLAGS += -march=i486 -mcpu=i486
95 :     # CFLAGS += -march=i586 -mcpu=i586
96 :     # CFLAGS += -march=i686 -mcpu=i686
97 : chl 276 # CFLAGS += -march=pentium -mcpu=pentium
98 :     # CFLAGS += -march=pentiumpro -mcpu=pentiumpro
99 : edgomez 191
100 :     # Architecture options : Valid for every gcc >= 3.1
101 :     # Uncomment the one which you want to compile for
102 :    
103 :     # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx
104 :     # CFLAGS += -march=pentium3 -mcpu=pentium3
105 :     # CFLAGS += -march=pentium4 -mcpu=pentium4
106 :     # CFLAGS += -march=athlon -mcpu=athlon
107 :     # CFLAGS += -march=k6 -mcpu=k6
108 :     # CFLAGS += -march=k6-2 -mcpu=k6-2
109 :     # CFLAGS += -march=k6-3 -mcpu=k6-3
110 :     # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird
111 :     # CFLAGS += -march=athlon-xp -mcpu=athlon-xp
112 :     # CFLAGS += -march=athlon-mp -mcpu=athlon-mp
113 :    
114 : edgomez 314 # x86 specific optimization for every gcc
115 : edgomez 191 # Aligns the stack to 2^4=16bytes boundaries in each function
116 :     # Local variables should be aligned and make the code faster
117 :     # some gcc versions (3.0.4) have problems with this option
118 :     # we can't really trust gcc output :-( You're warned.
119 :     CFLAGS += -mpreferred-stack-boundary=4
120 :    
121 :     # Architecture specific optimization available in gcc >= 3.1
122 :     # generates floating point sse code (for >= pentium 3)
123 :     # CFLAGS += -mfpmath=sse
124 :     # generates both floating point sse and 387 code, this double the amount
125 :     # of fp registers and could make the code faster
126 :     # (Still experimental in gcc 3.1.0)
127 :     # CFLAGS += -mfpmath=sse,387
128 :    
129 : Isibaar 3 endif
130 :    
131 : edgomez 191 #############################################################################
132 :     #
133 :     # Makefile rules
134 :     #
135 :     #############################################################################
136 : Isibaar 3
137 :     %.o: %.asm
138 :     $(AS) $(AFLAGS) $< -o $@
139 :    
140 :     RM = rm -rf
141 :    
142 :    
143 :     all: $(LIB) $(LIBSO)
144 :    
145 :    
146 :     $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
147 :     ar rcs $@ $^
148 :    
149 :    
150 :     $(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
151 :     $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@
152 :    
153 :    
154 :     clean:
155 :     $(RM) `find $(SRCDIR) -name "*.o"`
156 :     $(RM) $(LIB)
157 :     $(RM) $(LIBSO)
158 :    
159 :     install: libxvidcore.so
160 :     cp libxvidcore.so $(LIBDIR) # you have to bee root for this
161 :     /sbin/ldconfig
162 :    
163 :     install-test: libxvidcore.so # if you don't want to overwrite previous compile
164 :     cp libxvidcore.so $(LIBDIR)/libtestcore.so
165 :     /sbin/ldconfig

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