[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.8.2.4, Thu Sep 11 14:12:16 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+=$(ASSEMBLY_OBJECTS)
36    OBJECTS+=$(DCT_IA64_OBJECTS)
37    
38    #-----------------------------------------------------------------------------
39    # The default rule
40    #-----------------------------------------------------------------------------
41    
42    .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
43    
44    all: platform.inc $(STATIC_LIB) $(SHARED_LIB)
45            @echo
46            @echo "---------------------------------------------------------------"
47            @echo " XviD has been built, you can now run \"# make install\" as root."
48            @echo "---------------------------------------------------------------"
49            @echo
50    
51    #-----------------------------------------------------------------------------
52    # Generic assembly rule
53    #-----------------------------------------------------------------------------
54    
55    .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
56            @echo -n "Assembling $< ... "
57            @$(AS) $(AFLAGS) $< -o $@
58            @echo "Done"
59    
60    #-----------------------------------------------------------------------------
61    # Generic C rule
62    #-----------------------------------------------------------------------------
63    
64    .c.$(OBJECT_EXTENSION):
65            @echo -n "Compiling $< ... "
66            @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $@
67            @echo "Done"
68    
69    #-----------------------------------------------------------------------------
70    # Static Library
71    #-----------------------------------------------------------------------------
72    
73    $(STATIC_LIB): $(OBJECTS)
74            @echo
75            @echo -n "Linking the static library... "
76            @ar rc $(STATIC_LIB) $(OBJECTS)
77            @echo "Done"
78            @echo -n "Generating static library's index... "
79            @$(RANLIB) $(STATIC_LIB)
80            @echo "Done"
81    
82    #-----------------------------------------------------------------------------
83    # Shared Library
84    #-----------------------------------------------------------------------------
85    
86    $(SHARED_LIB): $(OBJECTS)
87            @echo
88            @echo -n "Linking the shared library... "
89            @$(CC) $(LDFLAGS) $(OBJECTS) -o $(SHARED_LIB) $(SPECIFIC_LDFLAGS)
90            @echo "Done"
91    
92    #-----------------------------------------------------------------------------
93    # Installation
94    #-----------------------------------------------------------------------------
95    
96    install: all
97            @echo
98            @echo "+---------- Installing XviD libraries in $(libdir) ----------+"
99            @echo
100            $(INSTALL) -d $(libdir)
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) -d $(includedir)
107            $(INSTALL) -m 644 $(SRCDIR)/xvid.h $(includedir)/xvid.h
108            @echo
109    
110    #-----------------------------------------------------------------------------
111    # Platorm specific file -- dumb rule for people executing make before
112    # ./configure
113    #-----------------------------------------------------------------------------
114    
115    platform.inc: platform.inc.in
116            ./configure
117    
118    #-----------------------------------------------------------------------------
119    # .PHONY targets
120    #-----------------------------------------------------------------------------
121    
122  all: $(LIB) $(LIBSO)  .PHONY: mrproper 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 $@  
   
123    
124  clean:  clean:
125          $(RM) `find $(SRCDIR) -name "*.o"`          @echo -n "Cleaning objects... "
126            @$(RM) $(OBJECTS)
127            @echo "Done"
128            @echo -n "Cleaning static library... "
129            @$(RM) $(STATIC_LIB)
130            @echo "Done"
131            @echo -n "Cleaning shared library... "
132            @$(RM) $(SHARED_LIB)
133            @echo "Done"
134    
135    distclean: clean
136            @echo -n "Cleaning generated files... "
137            @$(RM) platform.inc
138            @$(RM) config.log
139            @$(RM) config.status
140            @$(RM) autom4te.cache
141            @echo "Done"
142    
143    mrproper: distclean
144            @echo -n "Cleaning bootstrapped files... "
145            @$(RM) configure
146            @$(RM) install-sh
147            @$(RM) missing
148            @$(RM) config.guess
149            @$(RM) mkinstalldirs
150            @$(RM) config.sub
151            @echo "Done"
152    
153    list-objects:
154            @echo
155            @echo "Object files used for this build"
156            @echo "---------------------------------------------------------------"
157            @echo
158            @echo $(OBJECTS)
159            @echo
160    
161    list-targets:
162            @echo
163            @echo "Target Libraries"
164            @echo "---------------------------------------------------------------"
165            @echo
166            @echo Shared library: $(SHARED_LIB)
167            @echo Static library: $(STATIC_LIB)
168            @echo
169    
170    list-install-path:
171            @echo
172            @echo "Install Paths"
173            @echo "---------------------------------------------------------------"
174            @echo
175            @echo Include: $(includedir)
176            @echo Library: $(libdir)
177            @echo
178    
179    list-cflags:
180            @echo
181            @echo "Using CFLAGS"
182            @echo "---------------------------------------------------------------"
183            @echo
184            @echo CFLAGS=$(CFLAGS)
185            @echo
186    
187  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.8.2.4

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