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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 510 - (view) (download)

1 : edgomez 488 #############################################################################
2 :     #
3 : edgomez 510 # Cygwin/Win32 x86 Makefile
4 : edgomez 488 #
5 :     # Edit this file to enable/disable optimizations
6 :     #
7 : edgomez 510 # $Id: Makefile.cygwin,v 1.5 2002-09-22 10:31:18 edgomez Exp $
8 : edgomez 488 #
9 :     #############################################################################
10 : Isibaar 91
11 :     include Makefile.inc
12 :    
13 : edgomez 488 # 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 91
23 : edgomez 488 # 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 : Isibaar 91
26 :    
27 : edgomez 488 # CC = gcc
28 :     # CC = gcc-3.1
29 :     # CC = icc
30 :    
31 :     # Assembler
32 : Isibaar 91 AS = nasm
33 :     AFLAGS = -f win32 -DPREFIX
34 :    
35 : edgomez 488 # Constants which should not be modified
36 :     CFLAGS += -DARCH_X86
37 :     CFLAGS += -DLINUX
38 :     CFLAGS += -UWIN32
39 :     CFLAGS += -mno-cygwin
40 :    
41 :     # 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 : edgomez 509 # Enable BFrame decoding (still beta)
47 :     # CFLAGS += -DBRAMES_DEC
48 :    
49 : edgomez 488 LIBDIR = /usr/local/lib
50 :    
51 :     # Warning level options
52 :     # Shows all warnings
53 :     CFLAGS += -Wall
54 :     # To detect non ANSI C code (xvid is not ANSI C (yet?))
55 :     # CFLAGS += -pedantic
56 :    
57 :    
58 :     # General Optimization options
59 :     # Optimize code for size (implies -O2)
60 :     CFLAGS += -Os
61 :     # Unroll loops code, this might speed up loops
62 :     CFLAGS += -funroll-loops
63 :     # Generates FPU math code
64 :     CFLAGS += -ffast-math
65 :     # ??? (man gcc)
66 :     CFLAGS += -fstrict-aliasing
67 :     # Omit the x86 push ebp; mov ebp, esp function
68 :     # header and its corresponding function tailer
69 :     CFLAGS += -fomit-frame-pointer
70 :     # Generates Position Independant Code depending on your nasm version,
71 :     # this could generate shared libraries that segfault because of a nasm
72 :     # bug (win32 produces PIC all the time)
73 :     # CFLAGS += -fPIC
74 :    
75 :     # Debugging and Profiling options
76 :     # Writes debugging symbols in object files
77 :     # CFLAGS += -g
78 :     # Includes profiling code in generated code, don't forget to disable
79 :     # -fomit-frame-pointer as these 2 options are exclusive.
80 :     # Try a first run with -fprofile-arcs only then build the lib again
81 :     # with add branch and coverage... this will allow you to profile
82 :     # the lib line a line.
83 : edgomez 509 # CFLAGS += -pg
84 :     # Precise profiling + test coverage (-pg must be activated)
85 :     # Build the library twice and execute a program using the lib twice too
86 :     # First pass : Will create sourcefile.da files to keep branch statistics
87 :     # CFLAGS += -fprofile-arcs
88 :     # Second pass : Will create .bb and .bbg files suitable for coverage and
89 :     # branch probabilities during compilation
90 :     # CFLAGS += -fprofile-arcs -fbranch-probabilities -ftest-coverage
91 : edgomez 488
92 :    
93 :     # Architecture options : Valid for every gcc version
94 :     # Uncomment the one which you want to compile for
95 :    
96 :     # CFLAGS += -march=i386 -mcpu=i386
97 :     # CFLAGS += -march=i486 -mcpu=i486
98 :     # CFLAGS += -march=i586 -mcpu=i586
99 :     # CFLAGS += -march=i686 -mcpu=i686
100 :     # CFLAGS += -march=pentium -mcpu=pentium
101 :     # CFLAGS += -march=pentiumpro -mcpu=pentiumpro
102 :    
103 :     # Architecture options : Valid for every gcc >= 3.1
104 :     # Uncomment the one which you want to compile for
105 :    
106 :     # CFLAGS += -march=pentium-mmx -mcpu=pentium-mmx
107 :     # CFLAGS += -march=pentium3 -mcpu=pentium3
108 :     # CFLAGS += -march=pentium4 -mcpu=pentium4
109 :     # CFLAGS += -march=athlon -mcpu=athlon
110 :     # CFLAGS += -march=k6 -mcpu=k6
111 :     # CFLAGS += -march=k6-2 -mcpu=k6-2
112 :     # CFLAGS += -march=k6-3 -mcpu=k6-3
113 :     # CFLAGS += -march=athlon-tbird -mcpu=athlon-tbird
114 :     # CFLAGS += -march=athlon-xp -mcpu=athlon-xp
115 :     # CFLAGS += -march=athlon-mp -mcpu=athlon-mp
116 :    
117 :     # x86 specific optimization for every gcc
118 :     # Aligns the stack to 2^4=16bytes boundaries in each function
119 :     # Local variables should be aligned and make the code faster
120 :     # some gcc versions (3.0.4) have problems with this option
121 :     # we can't really trust gcc output :-( You're warned.
122 :     CFLAGS += -mpreferred-stack-boundary=4
123 :    
124 :     # Architecture specific optimization available in gcc >= 3.1
125 :     # generates floating point sse code (for >= pentium 3)
126 :     # CFLAGS += -mfpmath=sse
127 :     # generates both floating point sse and 387 code, this double the amount
128 :     # of fp registers and could make the code faster
129 :     # (Still experimental in gcc 3.1.0)
130 :     # CFLAGS += -mfpmath=sse,387
131 :    
132 :     #############################################################################
133 :     #
134 :     # Makefile rules
135 :     #
136 :     #############################################################################
137 :    
138 : Isibaar 91 %.o: %.asm
139 :     $(AS) $(AFLAGS) $< -o $@
140 :    
141 :     RM = rm -rf
142 :    
143 :    
144 : edgomez 488 all: $(LIB) $(LIBSO:.so=.dll)
145 :    
146 :    
147 : Isibaar 91 $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
148 :     ar rcs $@ $^
149 :    
150 : edgomez 488 $(LIBSO:.so=.dll): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
151 :     $(CC) $(CFLAGS) -shared -Wl,--dll,--out-implib,$@.a -o $@ $^ libxvidcore.def
152 :    
153 : Isibaar 91 clean:
154 :     $(RM) `find $(SRCDIR) -name "*.o"`
155 :     $(RM) $(LIB)
156 : edgomez 488 $(RM) $(LIBSO:.so=.dll)
157 : Isibaar 91
158 : edgomez 488 install: $(LIBSO:.so=.dll) $(LIBSO:.so=.dll) $(LIB)
159 :     cp $(LIBSO:.so=.dll) $(LIBDIR) # you have to bee root for this
160 :     cp $(LIBSO:.so=.dll.a) $(LIBDIR)
161 :     cp $(LIB) $(LIBDIR)

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