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

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