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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 91, Sat Mar 30 11:22:02 2002 UTC revision 554, Sat Sep 28 03:00:03 2002 UTC
# Line 1  Line 1 
1  #/**************************************************************************  #############################################################################
2  # *  #
3  # * cygwin makefile (only static library)  # Cygwin/Win32 x86 Makefile
4  # *  #
5  # * nasm args:  # Edit this file to enable/disable optimizations
6  # * -f fmt              elf (linux), coff (djgpp), win32 (cygwin)  #
7  # * -DPREFIX    add '_' prefix to symbol names  # $Id: Makefile.cygwin,v 1.7 2002-09-28 03:00:03 suxen_drol Exp $
8  # *  #
9  # *  #############################################################################
 # *************************************************************************/  
   
10    
11  include Makefile.inc  include Makefile.inc
12    
13  CC = gcc  # You can set/add options to CC and CFLAGS without editing this Makefile
14  #CC = /usr/local/gcc-3.0.4/bin/gcc  # 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    
31    # Assembler
32    AS = nasm
33    AFLAGS = -f win32 -DPREFIX
34    
35    # Constants which should not be modified
36    # Note: the `mingw-runtime` package is required when building with
37    # -DLINUX and -mno-cygwin.
38    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    # Enable BFrame decoding (still beta)
49    # CFLAGS += -DBFRAMES_DEC
50    
 CFLAGS = -DARCH_X86 -DLINUX -UWIN32  
51  LIBDIR = /usr/local/lib  LIBDIR = /usr/local/lib
52    
53  CFLAGS += -O3 -funroll-loops -ffast-math -fstrict-aliasing -fomit-frame-pointer    # Warning level options
54  # CFLAGS += -m486        # 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      # 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    
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  # CFLAGS += -march=pentium -mcpu=pentium
103  CFLAGS += -march=pentiumpro -mcpu=pentiumpro    # CFLAGS += -march=pentiumpro -mcpu=pentiumpro
 # CFLAGS += -march=athlon -mcpu=athlon  
 CFLAGS += -mno-cygwin  
104    
105  AS = nasm    # Architecture options : Valid for every gcc >= 3.1
106  AFLAGS = -f win32 -DPREFIX    # 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  %.o: %.asm  %.o: %.asm
141          $(AS) $(AFLAGS) $< -o $@          $(AS) $(AFLAGS) $< -o $@
142    
143  RM = rm -rf  RM = rm -rf
144    
145  all: $(LIB)  
146    all: $(LIB) $(LIBSO:.so=.dll)
147    
148    
149  $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)  $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
150          ar rcs $@ $^          ar rcs $@ $^
151    
152    $(LIBSO:.so=.dll): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
153            $(CC) $(CFLAGS) -shared -Wl,--dll,--out-implib,$@.a -o $@ $^ libxvidcore.def
154    
155  clean:  clean:
156          $(RM) `find $(SRCDIR) -name "*.o"`          $(RM) `find $(SRCDIR) -name "*.o"`
   
 remove-all:  
         $(RM) $(DIRS)  
         $(RM) $(DIRS_INTEL)  
157          $(RM) $(LIB)          $(RM) $(LIB)
158            $(RM) $(LIBSO:.so=.dll)
159    
160  install: $(LIB)  install: $(LIBSO:.so=.dll) $(LIBSO:.so=.dll) $(LIB)
161          cp $(LIB) $(LIBDIR)/libxvidcore.a          cp $(LIBSO:.so=.dll) $(LIBDIR)                  # you have to bee root for this
162            cp $(LIBSO:.so=.dll.a) $(LIBDIR)
163  install-test: $(LIB)                            # if you don't want to overwrite previous compile          cp $(LIB) $(LIBDIR)
         cp $(LIB) $(LIBDIR)/libtestcore.a  

Legend:
Removed from v.91  
changed lines
  Added in v.554

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