Parent Directory | Revision Log
Revision 1.2 - (view) (download)
1 : | edgomez | 1.2 | ############################################################################# |
2 : | # | ||
3 : | # GNU/Linux Makefile | ||
4 : | # | ||
5 : | # Edit this file to enable/disable optimizations | ||
6 : | # | ||
7 : | # $Id$ | ||
8 : | # | ||
9 : | ############################################################################# | ||
10 : | Isibaar | 1.1 | |
11 : | edgomez | 1.2 | 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 : | Isibaar | 1.1 | |
31 : | edgomez | 1.2 | # Assembler |
32 : | AS = nasm | ||
33 : | AFLAGS = -f elf | ||
34 : | Isibaar | 1.1 | |
35 : | edgomez | 1.2 | # 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 : | # CFLAGS += -D_DEBUG | ||
42 : | # CFLAGS += -DBFRAMES | ||
43 : | Isibaar | 1.1 | |
44 : | LIBDIR = /usr/local/lib | ||
45 : | |||
46 : | ifeq ($(CC),icc) | ||
47 : | edgomez | 1.2 | |
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 : | Isibaar | 1.1 | |
53 : | else | ||
54 : | |||
55 : | edgomez | 1.2 | # 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 : | # General Optimization options | ||
62 : | # Optimize code for size (implies -O2) | ||
63 : | CFLAGS += -Os | ||
64 : | # Unroll loops code, this might speed up loops | ||
65 : | CFLAGS += -funroll-loops | ||
66 : | # Generates FPU math code | ||
67 : | CFLAGS += -ffast-math | ||
68 : | # ??? (man gcc) | ||
69 : | CFLAGS += -fstrict-aliasing | ||
70 : | # Omit the x86 push ebp; mov ebp, esp function | ||
71 : | # header and its corresponding function tailer | ||
72 : | CFLAGS += -fomit-frame-pointer | ||
73 : | # Generates Position Independant Code depending on your nasm version, | ||
74 : | # this could generate shared libraries that segfault because of a nasm | ||
75 : | # bug | ||
76 : | # CFLAGS += -fPIC | ||
77 : | |||
78 : | |||
79 : | # Architecture options : Valid for every gcc version | ||
80 : | # Uncomment the one which you want to compile for | ||
81 : | |||
82 : | # CFLAGS += -march=i386 -mcpu=i386 | ||
83 : | # CFLAGS += -march=i486 -mcpu=i486 | ||
84 : | # CFLAGS += -march=i586 -mcpu=i586 | ||
85 : | # CFLAGS += -march=i686 -mcpu=i686 | ||
86 : | |||
87 : | # Architecture options : Valid for every gcc >= 3.1 | ||
88 : | # Uncomment the one which you want to compile for | ||
89 : | |||
90 : | # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx | ||
91 : | # CFLAGS += -march=pentium3 -mcpu=pentium3 | ||
92 : | # CFLAGS += -march=pentium4 -mcpu=pentium4 | ||
93 : | # CFLAGS += -march=athlon -mcpu=athlon | ||
94 : | # CFLAGS += -march=k6 -mcpu=k6 | ||
95 : | # CFLAGS += -march=k6-2 -mcpu=k6-2 | ||
96 : | # CFLAGS += -march=k6-3 -mcpu=k6-3 | ||
97 : | # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird | ||
98 : | # CFLAGS += -march=athlon-xp -mcpu=athlon-xp | ||
99 : | # CFLAGS += -march=athlon-mp -mcpu=athlon-mp | ||
100 : | |||
101 : | # Architecture specific optimization for every gcc | ||
102 : | # Aligns the stack to 2^4=16bytes boundaries in each function | ||
103 : | # Local variables should be aligned and make the code faster | ||
104 : | # some gcc versions (3.0.4) have problems with this option | ||
105 : | # we can't really trust gcc output :-( You're warned. | ||
106 : | CFLAGS += -mpreferred-stack-boundary=4 | ||
107 : | |||
108 : | # Architecture specific optimization available in gcc >= 3.1 | ||
109 : | # generates floating point sse code (for >= pentium 3) | ||
110 : | # CFLAGS += -mfpmath=sse | ||
111 : | # generates both floating point sse and 387 code, this double the amount | ||
112 : | # of fp registers and could make the code faster | ||
113 : | # (Still experimental in gcc 3.1.0) | ||
114 : | # CFLAGS += -mfpmath=sse,387 | ||
115 : | Isibaar | 1.1 | |
116 : | endif | ||
117 : | |||
118 : | edgomez | 1.2 | ############################################################################# |
119 : | # | ||
120 : | # Makefile rules | ||
121 : | # | ||
122 : | ############################################################################# | ||
123 : | Isibaar | 1.1 | |
124 : | %.o: %.asm | ||
125 : | $(AS) $(AFLAGS) $< -o $@ | ||
126 : | |||
127 : | RM = rm -rf | ||
128 : | |||
129 : | |||
130 : | all: $(LIB) $(LIBSO) | ||
131 : | |||
132 : | |||
133 : | $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) | ||
134 : | ar rcs $@ $^ | ||
135 : | |||
136 : | |||
137 : | $(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) | ||
138 : | $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@ | ||
139 : | |||
140 : | |||
141 : | clean: | ||
142 : | $(RM) `find $(SRCDIR) -name "*.o"` | ||
143 : | $(RM) $(LIB) | ||
144 : | $(RM) $(LIBSO) | ||
145 : | |||
146 : | install: libxvidcore.so | ||
147 : | cp libxvidcore.so $(LIBDIR) # you have to bee root for this | ||
148 : | /sbin/ldconfig | ||
149 : | |||
150 : | install-test: libxvidcore.so # if you don't want to overwrite previous compile | ||
151 : | cp libxvidcore.so $(LIBDIR)/libtestcore.so | ||
152 : | /sbin/ldconfig |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |