[cvs] / xvidcore / build / generic / Makefile Repository:
ViewVC logotype

Diff of /xvidcore/build/generic/Makefile

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

revision 1.2, Sat May 11 15:41:48 2002 UTC revision 1.10, Thu Mar 6 21:12:03 2003 UTC
# Line 1  Line 1 
1  #/**************************************************************************  ##############################################################################
2  # *  #
3  # * linux makefile  # - Unified Makefile for XviD for *nix environments -
4  # *  #
5  # * nasm args:  # Copyright(C) 2003 Edouard Gomez <ed.gomez@free.fr>
6  # * -f fmt              elf (linux), coff (djgpp)  #
7  # * -DPREFIX    add '_' prefix to symbol names  #
8  # *  # Description:
9  # * libso:  #  This Makefile allows building XviD sources to obtain a shared library
10  # * (-lm not neccessary if using -ffast-math)  #  and a static library. This Makefie uses variables defined in the
11  # *  #  platform.inc file. This platform.inc file is usually created by the
12  # *************************************************************************/  #  ./configure script whenever a unix shell is available.
13    #
14    # Nota Bene for mingw32/djgpp users:
15  include Makefile.inc  #   However if you provide a platform.inc file adapted to your OS, then
16    #   change the include platform.inc to include yourfile.inc and it should
17  CC = gcc  #   work too.
18  #CC=icc  #
19  #CC = /opt/experimental/bin/gcc         # that's where SuSE installs gcc3  #
20    ##############################################################################
 CFLAGS = -DARCH_X86 -DLINUX  
 LIBDIR = /usr/local/lib  
   
 ifeq ($(CC),icc)  
     CFLAGS+= -O3 -ip -tpp6 -xM                  # -tpp7 might be faster (P4 optmization)...  
     CFLAGS+= -I/opt/intel/compiler50/ia32/include -I/opt/intel/compiler50/ia32/substitute_headers/  
   
 else  
   
 # CFLAGS += -funroll-loops -ffast-math -fstrict-aliasing -fomit-frame-pointer  
 # CFLAGS += -fPIC  
 # CFLAGS += -m486  
 # CFLAGS += -march=pentium -mcpu=pentium  
  CFLAGS += -march=pentiumpro -mcpu=pentiumpro  
 # CFLAGS += -march=k6 -mcpu=k6  
   
     CFLAGS += -Wall -O3 -funroll-loops -ffast-math  
     CFLAGS += -fstrict-aliasing -fomit-frame-pointer  
 endif  
21    
22  AS = nasm  include sources.inc
23  AFLAGS = -f elf  include platform.inc
   
 %.o: %.asm  
         $(AS) $(AFLAGS) $< -o $@  
24    
25  RM = rm -rf  RM = rm -rf
26    
27    ##############################################################################
28    #
29    # Build rules
30    #
31    ##############################################################################
32    
33    # Their Objects
34    OBJECTS=$(GENERIC_OBJECTS)
35    OBJECTS+=$(DIVX4COMPAT_OBJECTS)
36    OBJECTS+=$(ASSEMBLY_OBJECTS)
37    OBJECTS+=$(DCT_IA64_OBJECTS)
38    
39    #-----------------------------------------------------------------------------
40    # The default rule
41    #-----------------------------------------------------------------------------
42    
43    .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
44    
45    all: platform.inc $(STATIC_LIB) $(SHARED_LIB)
46            @echo
47            @echo "---------------------------------------------------------------"
48            @echo " XviD has been built, you can now run \"# make install\" as root."
49            @echo "---------------------------------------------------------------"
50            @echo
51    
52    #-----------------------------------------------------------------------------
53    # Generic assembly rule
54    #-----------------------------------------------------------------------------
55    
56    .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
57            @echo -n "Assembling $< ... "
58            @$(AS) $(AFLAGS) $< -o $@
59            @echo "Done"
60    
61    #-----------------------------------------------------------------------------
62    # Generic C rule
63    #-----------------------------------------------------------------------------
64    
65    .c.$(OBJECT_EXTENSION):
66            @echo -n "Compiling $< ... "
67            @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $@
68            @echo "Done"
69    
70    #-----------------------------------------------------------------------------
71    # Static Library
72    #-----------------------------------------------------------------------------
73    
74    $(STATIC_LIB): $(OBJECTS)
75            @echo
76            @echo -n "Linking the static library... "
77            @ar rc $(STATIC_LIB) $(OBJECTS)
78            @echo "Done"
79            @echo -n "Generating static library's index... "
80            @$(RANLIB) $(STATIC_LIB)
81            @echo "Done"
82    
83    #-----------------------------------------------------------------------------
84    # Shared Library
85    #-----------------------------------------------------------------------------
86    
87    $(SHARED_LIB): $(OBJECTS)
88            @echo
89            @echo -n "Linking the shared library... "
90            @$(CC) $(LDFLAGS) $(OBJECTS) -o $(SHARED_LIB) $(SPECIFIC_LDFLAGS)
91            @echo "Done"
92    
93    #-----------------------------------------------------------------------------
94    # Installation
95    #-----------------------------------------------------------------------------
96    
97    install: all
98            @echo
99            @echo "+---------- Installing XviD libraries in $(libdir) ----------+"
100            @echo
101            $(INSTALL) -d $(libdir)
102            $(INSTALL) -m 755 $(SHARED_LIB) $(libdir)/$(SHARED_LIB)
103            $(INSTALL) -m 755 $(STATIC_LIB) $(libdir)/$(STATIC_LIB)
104            @echo
105            @echo "+---------- Installing XviD header in $(includedir) ----------+"
106            @echo
107            $(INSTALL) -d $(includedir)
108            $(INSTALL) -m 644 $(SRCDIR)/xvid.h $(includedir)/xvid.h
109            @echo
110    
111    #-----------------------------------------------------------------------------
112    # Platorm specific file -- dumb rule for people executing make before
113    # ./configure
114    #-----------------------------------------------------------------------------
115    
116    platform.inc: platform.inc.in
117            ./configure
118    
119    #-----------------------------------------------------------------------------
120    # .PHONY targets
121    #-----------------------------------------------------------------------------
122    
123  all: $(LIB) $(LIBSO)  .PHONY: distclean clean info list-objects list-targets list-install-path list-cflags
   
   
 $(LIB): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)  
         ar rcs $@ $^  
   
   
 $(LIBSO): $(SRC:.c=.o) $(SRC_INTEL:.asm=.o)  
         $(CC) $(CFLAGS) $^ -shared -lc -lm -o $@  
   
124    
125  clean:  clean:
126          $(RM) `find $(SRCDIR) -name "*.o"`          @echo -n "Cleaning objects... "
127            @$(RM) $(OBJECTS)
128            @echo "Done"
129            @echo -n "Cleaning static library... "
130            @$(RM) $(STATIC_LIB)
131            @echo "Done"
132            @echo -n "Cleaning shared library... "
133            @$(RM) $(SHARED_LIB)
134            @echo "Done"
135    
136    
137    distclean: clean
138            @echo -n "Cleaning generated files... "
139            @$(RM) libxvidcore.def
140            @$(RM) platform.inc
141            @$(RM) config.log
142            @$(RM) autom4te.cache
143            @echo "Done"
144    
145    list-objects:
146            @echo
147            @echo "Object files used for this build"
148            @echo "---------------------------------------------------------------"
149            @echo
150            @echo $(OBJECTS)
151            @echo
152    
153    list-targets:
154            @echo
155            @echo "Target Libraries"
156            @echo "---------------------------------------------------------------"
157            @echo
158            @echo Shared library: $(SHARED_LIB)
159            @echo Static library: $(STATIC_LIB)
160            @echo
161    
162    list-install-path:
163            @echo
164            @echo "Install Paths"
165            @echo "---------------------------------------------------------------"
166            @echo
167            @echo Include: $(includedir)
168            @echo Library: $(libdir)
169            @echo
170    
171    list-cflags:
172            @echo
173            @echo "Using CFLAGS"
174            @echo "---------------------------------------------------------------"
175            @echo
176            @echo CFLAGS=$(CFLAGS)
177            @echo
178    
179  remove-all:  info: list-objects list-cflags list-targets list-install-path
         $(RM) $(DIRS)  
         $(RM) $(DIRS_INTEL)  
         $(RM) $(LIB)  
         $(RM) $(LIBSO)  
   
   
 install: libxvidcore.so  
         cp libxvidcore.so $(LIBDIR)                     # you have to bee root for this  
         /sbin/ldconfig  
   
 install-test: libxvidcore.so                            # if you don't want to overwrite previous compile  
         cp libxvidcore.so $(LIBDIR)/libtestcore.so  
         /sbin/ldconfig  

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.10

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