[svn] / branches / dev-api-3 / xvidcore / build / generic / Makefile.linux Repository:
ViewVC logotype

Annotation of /branches/dev-api-3/xvidcore/build/generic/Makefile.linux

Parent Directory Parent Directory | Revision Log Revision Log


Revision 236 - (view) (download)
Original Path: trunk/xvidcore/build/generic/Makefile.linux

1 : edgomez 191 #############################################################################
2 :     #
3 :     # GNU/Linux Makefile
4 :     #
5 :     # Edit this file to enable/disable optimizations
6 :     #
7 : edgomez 236 # $Id: Makefile.linux,v 1.3 2002-06-23 19:48:06 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 :     # Enable some experimental/debugging code
40 :     # (Use only if you know what you're doing !)
41 : edgomez 236 # PSNR during encoding
42 :     # CFLAGS += -D_DEBUG_PSNR
43 :     # BFRAMES encoding
44 : edgomez 191 # CFLAGS += -DBFRAMES
45 : edgomez 236 # BFRAMES decoding
46 :     # CFLAGS += -DBFRAMES_DEC
47 : edgomez 191
48 : Isibaar 3 LIBDIR = /usr/local/lib
49 :    
50 :     ifeq ($(CC),icc)
51 :    
52 : edgomez 191 # -tpp7 might be faster (P4 optmization)...
53 :     CFLAGS += -O3 -ip -tpp6 -xM
54 :     CFLAGS += -I/opt/intel/compiler50/ia32/include
55 :     CFLAGS += -I/opt/intel/compiler50/ia32/substitute_headers/
56 :    
57 : Isibaar 3 else
58 :    
59 : edgomez 191 # Warning level options
60 :     # Shows all warnings
61 :     CFLAGS += -Wall
62 :     # To detect non ANSI C code (xvid is not ANSI C (yet?))
63 :     # CFLAGS += -pedantic
64 : Isibaar 3
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 :     # CFLAGS += -fPIC
81 :    
82 :    
83 :     # Architecture options : Valid for every gcc version
84 :     # Uncomment the one which you want to compile for
85 :    
86 :     # CFLAGS += -march=i386 -mcpu=i386
87 :     # CFLAGS += -march=i486 -mcpu=i486
88 :     # CFLAGS += -march=i586 -mcpu=i586
89 :     # CFLAGS += -march=i686 -mcpu=i686
90 :    
91 :     # Architecture options : Valid for every gcc >= 3.1
92 :     # Uncomment the one which you want to compile for
93 :    
94 :     # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx
95 :     # CFLAGS += -march=pentium3 -mcpu=pentium3
96 :     # CFLAGS += -march=pentium4 -mcpu=pentium4
97 :     # CFLAGS += -march=athlon -mcpu=athlon
98 :     # CFLAGS += -march=k6 -mcpu=k6
99 :     # CFLAGS += -march=k6-2 -mcpu=k6-2
100 :     # CFLAGS += -march=k6-3 -mcpu=k6-3
101 :     # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird
102 :     # CFLAGS += -march=athlon-xp -mcpu=athlon-xp
103 :     # CFLAGS += -march=athlon-mp -mcpu=athlon-mp
104 :    
105 :     # Architecture specific optimization for every gcc
106 :     # Aligns the stack to 2^4=16bytes boundaries in each function
107 :     # Local variables should be aligned and make the code faster
108 :     # some gcc versions (3.0.4) have problems with this option
109 :     # we can't really trust gcc output :-( You're warned.
110 :     CFLAGS += -mpreferred-stack-boundary=4
111 :    
112 :     # Architecture specific optimization available in gcc >= 3.1
113 :     # generates floating point sse code (for >= pentium 3)
114 :     # CFLAGS += -mfpmath=sse
115 :     # generates both floating point sse and 387 code, this double the amount
116 :     # of fp registers and could make the code faster
117 :     # (Still experimental in gcc 3.1.0)
118 :     # CFLAGS += -mfpmath=sse,387
119 :    
120 : Isibaar 3 endif
121 :    
122 : edgomez 191 #############################################################################
123 :     #
124 :     # Makefile rules
125 :     #
126 :     #############################################################################
127 : Isibaar 3
128 :     %.o: %.asm
129 :     $(AS) $(AFLAGS) $< -o $@
130 :    
131 :     RM = rm -rf
132 :    
133 :    
134 :     all: $(LIB) $(LIBSO)
135 :    
136 :    
137 :     $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
138 :     ar rcs $@ $^
139 :    
140 :    
141 :     $(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
142 :     $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@
143 :    
144 :    
145 :     clean:
146 :     $(RM) `find $(SRCDIR) -name "*.o"`
147 :     $(RM) $(LIB)
148 :     $(RM) $(LIBSO)
149 :    
150 :     install: libxvidcore.so
151 :     cp libxvidcore.so $(LIBDIR) # you have to bee root for this
152 :     /sbin/ldconfig
153 :    
154 :     install-test: libxvidcore.so # if you don't want to overwrite previous compile
155 :     cp libxvidcore.so $(LIBDIR)/libtestcore.so
156 :     /sbin/ldconfig

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