[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 509, Sun Sep 22 10:30:04 2002 UTC
# Line 1  Line 1 
1  #/**************************************************************************  #############################################################################
2  # *  #
3  # * cygwin makefile (only static library)  # GNU/Linux 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.4 2002-09-22 10:30:04 edgomez 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    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    # Enable BFrame decoding (still beta)
47    # CFLAGS += -DBRAMES_DEC
48    
 CFLAGS = -DARCH_X86 -DLINUX -UWIN32  
49  LIBDIR = /usr/local/lib  LIBDIR = /usr/local/lib
50    
51  CFLAGS += -O3 -funroll-loops -ffast-math -fstrict-aliasing -fomit-frame-pointer    # Warning level options
52  # CFLAGS += -m486        # 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      # 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    
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  # CFLAGS += -march=pentium -mcpu=pentium
101  CFLAGS += -march=pentiumpro -mcpu=pentiumpro    # CFLAGS += -march=pentiumpro -mcpu=pentiumpro
 # CFLAGS += -march=athlon -mcpu=athlon  
 CFLAGS += -mno-cygwin  
102    
103  AS = nasm    # Architecture options : Valid for every gcc >= 3.1
104  AFLAGS = -f win32 -DPREFIX    # 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  %.o: %.asm  %.o: %.asm
139          $(AS) $(AFLAGS) $< -o $@          $(AS) $(AFLAGS) $< -o $@
140    
141  RM = rm -rf  RM = rm -rf
142    
143  all: $(LIB)  
144    all: $(LIB) $(LIBSO:.so=.dll)
145    
146    
147  $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)  $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
148          ar rcs $@ $^          ar rcs $@ $^
149    
150    $(LIBSO:.so=.dll): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)
151            $(CC) $(CFLAGS) -shared -Wl,--dll,--out-implib,$@.a -o $@ $^ libxvidcore.def
152    
153  clean:  clean:
154          $(RM) `find $(SRCDIR) -name "*.o"`          $(RM) `find $(SRCDIR) -name "*.o"`
   
 remove-all:  
         $(RM) $(DIRS)  
         $(RM) $(DIRS_INTEL)  
155          $(RM) $(LIB)          $(RM) $(LIB)
156            $(RM) $(LIBSO:.so=.dll)
157    
158  install: $(LIB)  install: $(LIBSO:.so=.dll) $(LIBSO:.so=.dll) $(LIB)
159          cp $(LIB) $(LIBDIR)/libxvidcore.a          cp $(LIBSO:.so=.dll) $(LIBDIR)                  # you have to bee root for this
160            cp $(LIBSO:.so=.dll.a) $(LIBDIR)
161  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.509

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