Parent Directory | Revision Log
Revision 1.3 - (view) (download)
1 : | edgomez | 1.2 | ############################################################################# |
2 : | # | ||
3 : | # GNU/Linux Makefile | ||
4 : | # | ||
5 : | # Edit this file to enable/disable optimizations | ||
6 : | # | ||
7 : | edgomez | 1.3 | # $Id: Makefile.cygwin,v 1.2 2002/09/19 19:54:03 edgomez Exp $ |
8 : | edgomez | 1.2 | # |
9 : | ############################################################################# | ||
10 : | Isibaar | 1.1 | |
11 : | include Makefile.inc | ||
12 : | |||
13 : | edgomez | 1.2 | # 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 win32 -DPREFIX | ||
34 : | Isibaar | 1.1 | |
35 : | edgomez | 1.2 | # Constants which should not be modified |
36 : | CFLAGS += -DARCH_X86 | ||
37 : | CFLAGS += -DLINUX | ||
38 : | CFLAGS += -UWIN32 | ||
39 : | Isibaar | 1.1 | CFLAGS += -mno-cygwin |
40 : | |||
41 : | edgomez | 1.2 | # Enable some experimental/debugging code |
42 : | # (Use only if you know what you're doing !) | ||
43 : | # PSNR during encoding | ||
44 : | # CFLAGS += -D_DEBUG_PSNR | ||
45 : | |||
46 : | LIBDIR = /usr/local/lib | ||
47 : | |||
48 : | # Warning level options | ||
49 : | # Shows all warnings | ||
50 : | CFLAGS += -Wall | ||
51 : | # To detect non ANSI C code (xvid is not ANSI C (yet?)) | ||
52 : | # CFLAGS += -pedantic | ||
53 : | |||
54 : | |||
55 : | # General Optimization options | ||
56 : | # Optimize code for size (implies -O2) | ||
57 : | CFLAGS += -Os | ||
58 : | # Unroll loops code, this might speed up loops | ||
59 : | CFLAGS += -funroll-loops | ||
60 : | # Generates FPU math code | ||
61 : | CFLAGS += -ffast-math | ||
62 : | # ??? (man gcc) | ||
63 : | CFLAGS += -fstrict-aliasing | ||
64 : | # Omit the x86 push ebp; mov ebp, esp function | ||
65 : | # header and its corresponding function tailer | ||
66 : | CFLAGS += -fomit-frame-pointer | ||
67 : | # Generates Position Independant Code depending on your nasm version, | ||
68 : | # this could generate shared libraries that segfault because of a nasm | ||
69 : | # bug (win32 produces PIC all the time) | ||
70 : | # CFLAGS += -fPIC | ||
71 : | |||
72 : | # Debugging and Profiling options | ||
73 : | # Writes debugging symbols in object files | ||
74 : | # CFLAGS += -g | ||
75 : | # Includes profiling code in generated code, don't forget to disable | ||
76 : | # -fomit-frame-pointer as these 2 options are exclusive. | ||
77 : | # Try a first run with -fprofile-arcs only then build the lib again | ||
78 : | # with add branch and coverage... this will allow you to profile | ||
79 : | # the lib line a line. | ||
80 : | # CFLAGS += -pg -fprofile-arcs -fbranch-probabilities -ftest-coverage | ||
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 : | # CFLAGS += -march=pentium -mcpu=pentium | ||
91 : | # CFLAGS += -march=pentiumpro -mcpu=pentiumpro | ||
92 : | |||
93 : | # Architecture options : Valid for every gcc >= 3.1 | ||
94 : | # Uncomment the one which you want to compile for | ||
95 : | |||
96 : | # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx | ||
97 : | # CFLAGS += -march=pentium3 -mcpu=pentium3 | ||
98 : | # CFLAGS += -march=pentium4 -mcpu=pentium4 | ||
99 : | # CFLAGS += -march=athlon -mcpu=athlon | ||
100 : | # CFLAGS += -march=k6 -mcpu=k6 | ||
101 : | # CFLAGS += -march=k6-2 -mcpu=k6-2 | ||
102 : | # CFLAGS += -march=k6-3 -mcpu=k6-3 | ||
103 : | # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird | ||
104 : | # CFLAGS += -march=athlon-xp -mcpu=athlon-xp | ||
105 : | # CFLAGS += -march=athlon-mp -mcpu=athlon-mp | ||
106 : | |||
107 : | # x86 specific optimization for every gcc | ||
108 : | # Aligns the stack to 2^4=16bytes boundaries in each function | ||
109 : | # Local variables should be aligned and make the code faster | ||
110 : | # some gcc versions (3.0.4) have problems with this option | ||
111 : | # we can't really trust gcc output :-( You're warned. | ||
112 : | CFLAGS += -mpreferred-stack-boundary=4 | ||
113 : | |||
114 : | # Architecture specific optimization available in gcc >= 3.1 | ||
115 : | # generates floating point sse code (for >= pentium 3) | ||
116 : | # CFLAGS += -mfpmath=sse | ||
117 : | # generates both floating point sse and 387 code, this double the amount | ||
118 : | # of fp registers and could make the code faster | ||
119 : | # (Still experimental in gcc 3.1.0) | ||
120 : | # CFLAGS += -mfpmath=sse,387 | ||
121 : | |||
122 : | ############################################################################# | ||
123 : | # | ||
124 : | # Makefile rules | ||
125 : | # | ||
126 : | ############################################################################# | ||
127 : | Isibaar | 1.1 | |
128 : | %.o: %.asm | ||
129 : | $(AS) $(AFLAGS) $< -o $@ | ||
130 : | |||
131 : | RM = rm -rf | ||
132 : | |||
133 : | edgomez | 1.2 | |
134 : | all: $(LIB) $(LIBSO:.so=.dll) | ||
135 : | |||
136 : | Isibaar | 1.1 | |
137 : | $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) | ||
138 : | ar rcs $@ $^ | ||
139 : | |||
140 : | edgomez | 1.2 | $(LIBSO:.so=.dll): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o) |
141 : | $(CC) $(CFLAGS) -shared -Wl,--dll,--out-implib,$@.a -o $@ $^ libxvidcore.def | ||
142 : | |||
143 : | Isibaar | 1.1 | clean: |
144 : | $(RM) `find $(SRCDIR) -name "*.o"` | ||
145 : | $(RM) $(LIB) | ||
146 : | edgomez | 1.2 | $(RM) $(LIBSO:.so=.dll) |
147 : | Isibaar | 1.1 | |
148 : | edgomez | 1.2 | install: $(LIBSO:.so=.dll) $(LIBSO:.so=.dll) $(LIB) |
149 : | cp $(LIBSO:.so=.dll) $(LIBDIR) # you have to bee root for this | ||
150 : | cp $(LIBSO:.so=.dll.a) $(LIBDIR) | ||
151 : | cp $(LIB) $(LIBDIR) |
No admin address has been configured | ViewVC Help |
Powered by ViewVC 1.0.4 |