[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.1, Fri Mar 8 02:44:25 2002 UTC revision 1.9, Wed Feb 26 23:28:38 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 += -Wall -O3 -funroll-loops -ffast-math -march=pentiumpro -mcpu=pentiumpro  
     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) -m 755 $(SHARED_LIB) $(libdir)/$(SHARED_LIB)
102            $(INSTALL) -m 755 $(STATIC_LIB) $(libdir)/$(STATIC_LIB)
103            @echo
104            @echo "+---------- Installing XviD header in $(includedir) ----------+"
105            @echo
106            $(INSTALL) -m 644 $(SRCDIR)/xvid.h $(includedir)/xvid.h
107            @echo
108    
109    #-----------------------------------------------------------------------------
110    # Platorm specific file -- dumb rule for people executing make before
111    # ./configure
112    #-----------------------------------------------------------------------------
113    
114    platform.inc: platform.inc.in
115            ./configure
116    
117    #-----------------------------------------------------------------------------
118    # .PHONY targets
119    #-----------------------------------------------------------------------------
120    
121  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 $@  
   
122    
123  clean:  clean:
124          $(RM) `find $(SRCDIR) -name "*.o"`          @echo -n "Cleaning objects... "
125            @$(RM) $(OBJECTS)
126            @echo "Done"
127            @echo -n "Cleaning static library... "
128            @$(RM) $(STATIC_LIB)
129            @echo "Done"
130            @echo -n "Cleaning shared library... "
131            @$(RM) $(SHARED_LIB)
132            @echo "Done"
133    
134    
135    distclean: clean
136            @echo -n "Cleaning generated files... "
137            @$(RM) libxvidcore.def
138            @$(RM) platform.inc
139            @$(RM) config.log
140            @$(RM) autom4te.cache
141            @echo "Done"
142    
143    list-objects:
144            @echo
145            @echo "Object files used for this build"
146            @echo "---------------------------------------------------------------"
147            @echo
148            @echo $(OBJECTS)
149            @echo
150    
151    list-targets:
152            @echo
153            @echo "Target Libraries"
154            @echo "---------------------------------------------------------------"
155            @echo
156            @echo Shared library: $(SHARED_LIB)
157            @echo Static library: $(STATIC_LIB)
158            @echo
159    
160    list-install-path:
161            @echo
162            @echo "Install Paths"
163            @echo "---------------------------------------------------------------"
164            @echo
165            @echo Include: $(includedir)
166            @echo Library: $(libdir)
167            @echo
168    
169    list-cflags:
170            @echo
171            @echo "Using CFLAGS"
172            @echo "---------------------------------------------------------------"
173            @echo
174            @echo CFLAGS=$(CFLAGS)
175            @echo
176    
177  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.1  
changed lines
  Added in v.1.9

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