[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 276 - (view) (download)

1 : edgomez 191 #############################################################################
2 :     #
3 :     # GNU/Linux Makefile
4 :     #
5 :     # Edit this file to enable/disable optimizations
6 :     #
7 : chl 276 # $Id: Makefile.linux,v 1.5 2002-07-09 21:39:19 chl 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 :     # BFRAMES encoding
47 : edgomez 191 # CFLAGS += -DBFRAMES
48 : edgomez 236 # BFRAMES decoding
49 :     # CFLAGS += -DBFRAMES_DEC
50 : edgomez 191
51 : Isibaar 3 LIBDIR = /usr/local/lib
52 :    
53 :     ifeq ($(CC),icc)
54 :    
55 : edgomez 191 # -tpp7 might be faster (P4 optmization)...
56 :     CFLAGS += -O3 -ip -tpp6 -xM
57 :     CFLAGS += -I/opt/intel/compiler50/ia32/include
58 :     CFLAGS += -I/opt/intel/compiler50/ia32/substitute_headers/
59 :    
60 : Isibaar 3 else
61 :    
62 : edgomez 191 # Warning level options
63 :     # Shows all warnings
64 :     CFLAGS += -Wall
65 :     # To detect non ANSI C code (xvid is not ANSI C (yet?))
66 :     # CFLAGS += -pedantic
67 : Isibaar 3
68 : edgomez 191 # General Optimization options
69 :     # Optimize code for size (implies -O2)
70 :     CFLAGS += -Os
71 :     # Unroll loops code, this might speed up loops
72 :     CFLAGS += -funroll-loops
73 :     # Generates FPU math code
74 :     CFLAGS += -ffast-math
75 :     # ??? (man gcc)
76 :     CFLAGS += -fstrict-aliasing
77 :     # Omit the x86 push ebp; mov ebp, esp function
78 :     # header and its corresponding function tailer
79 :     CFLAGS += -fomit-frame-pointer
80 :     # Generates Position Independant Code depending on your nasm version,
81 :     # this could generate shared libraries that segfault because of a nasm
82 :     # bug
83 :     # CFLAGS += -fPIC
84 :    
85 :    
86 :     # Architecture options : Valid for every gcc version
87 :     # Uncomment the one which you want to compile for
88 :    
89 :     # CFLAGS += -march=i386 -mcpu=i386
90 :     # CFLAGS += -march=i486 -mcpu=i486
91 :     # CFLAGS += -march=i586 -mcpu=i586
92 :     # CFLAGS += -march=i686 -mcpu=i686
93 : chl 276 # CFLAGS += -march=pentium -mcpu=pentium
94 :     # CFLAGS += -march=pentiumpro -mcpu=pentiumpro
95 : edgomez 191
96 :     # Architecture options : Valid for every gcc >= 3.1
97 :     # Uncomment the one which you want to compile for
98 :    
99 :     # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx
100 :     # CFLAGS += -march=pentium3 -mcpu=pentium3
101 :     # CFLAGS += -march=pentium4 -mcpu=pentium4
102 :     # CFLAGS += -march=athlon -mcpu=athlon
103 :     # CFLAGS += -march=k6 -mcpu=k6
104 :     # CFLAGS += -march=k6-2 -mcpu=k6-2
105 :     # CFLAGS += -march=k6-3 -mcpu=k6-3
106 :     # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird
107 :     # CFLAGS += -march=athlon-xp -mcpu=athlon-xp
108 :     # CFLAGS += -march=athlon-mp -mcpu=athlon-mp
109 :    
110 :     # Architecture specific optimization for every gcc
111 :     # Aligns the stack to 2^4=16bytes boundaries in each function
112 :     # Local variables should be aligned and make the code faster
113 :     # some gcc versions (3.0.4) have problems with this option
114 :     # we can't really trust gcc output :-( You're warned.
115 :     CFLAGS += -mpreferred-stack-boundary=4
116 :    
117 :     # Architecture specific optimization available in gcc >= 3.1
118 :     # generates floating point sse code (for >= pentium 3)
119 :     # CFLAGS += -mfpmath=sse
120 :     # generates both floating point sse and 387 code, this double the amount
121 :     # of fp registers and could make the code faster
122 :     # (Still experimental in gcc 3.1.0)
123 :     # CFLAGS += -mfpmath=sse,387
124 :    
125 : Isibaar 3 endif
126 :    
127 : edgomez 191 #############################################################################
128 :     #
129 :     # Makefile rules
130 :     #
131 :     #############################################################################
132 : Isibaar 3
133 :     %.o: %.asm
134 :     $(AS) $(AFLAGS) $< -o $@
135 :    
136 :     RM = rm -rf
137 :    
138 :    
139 :     all: $(LIB) $(LIBSO)
140 :    
141 :    
142 :     $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
143 :     ar rcs $@ $^
144 :    
145 :    
146 :     $(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
147 :     $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@
148 :    
149 :    
150 :     clean:
151 :     $(RM) `find $(SRCDIR) -name "*.o"`
152 :     $(RM) $(LIB)
153 :     $(RM) $(LIBSO)
154 :    
155 :     install: libxvidcore.so
156 :     cp libxvidcore.so $(LIBDIR) # you have to bee root for this
157 :     /sbin/ldconfig
158 :    
159 :     install-test: libxvidcore.so # if you don't want to overwrite previous compile
160 :     cp libxvidcore.so $(LIBDIR)/libtestcore.so
161 :     /sbin/ldconfig

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