[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.1.1, Fri Mar 8 02:44:25 2002 UTC revision 1.21, Fri May 20 08:09:13 2011 UTC
# Line 1  Line 1 
1  #/**************************************************************************  ##############################################################################
2  # *  #
3  # * linux makefile  # - Unified Makefile for Xvid for *nix environments -
4  # *  #
5  # * nasm args:  # Copyright(C) 2003-2004 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 Makefile 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    # Makefile functional dependencies:
15  include Makefile.inc  #  - echo
16    #  - rm (with option -r and -f)
17  CC = gcc  #  - cd
18  #CC=icc  #  - make VPATH support (eg: GNU make, solaris 8 make)
19  #CC = /opt/experimental/bin/gcc         # that's where SuSE installs gcc3  #  - ar
20    #
21  CFLAGS = -DARCH_X86 -DLINUX  # Building output:
22  LIBDIR = /usr/local/lib  #  - C means "_C_ompiling"
23    #  - A means "_A_ssembling"
24  ifeq ($(CC),icc)  #  - I means "_I_nstalling"
25      CFLAGS+= -O3 -ip -tpp6 -xM                  # -tpp7 might be faster (P4 optmization)...  #  - D means "creating _D_irectory"
26      CFLAGS+= -I/opt/intel/compiler50/ia32/include -I/opt/intel/compiler50/ia32/substitute_headers/  #  - Cl means "_Cl_eaning"
27    #
28  else  # NB: (for mingw32/djgpp users)
29    #   These 2 environments do not provide a shell by default. So it's impossible
30  # CFLAGS += -funroll-loops -ffast-math -fstrict-aliasing -fomit-frame-pointer  #   to use the configure script to generate a platform.inc file suitable for
31  # CFLAGS += -fPIC  #   your machine. You have two choices:
32  # CFLAGS += -m486  #    - install minsys from the mingw project or install cygwin and then use
33  # CFLAGS += -march=pentium -mcpu=pentium  #      the configure script as on a unix system.
34  # CFLAGS += -march=pentiumpro -mcpu=pentiumpro  #    - write a platform.inc file by hand.
35    #
36      CFLAGS += -Wall -O3 -funroll-loops -ffast-math -march=pentiumpro -mcpu=pentiumpro  # PS: default build directory is "=build", it fits naming conventions that
37      CFLAGS += -fstrict-aliasing -fomit-frame-pointer  #     make the arch/tla revision control program ignore files contained in
38    #     this directory during commits operations. This choice is completly
39    #     arbitrary, but try not to change it.
40    #
41    ##############################################################################
42    
43    include sources.inc
44    ifeq ($(findstring $(MAKECMDGOALS), clean distclean mrproper),)
45    include platform.inc
46  endif  endif
47    
 AS = nasm  
 AFLAGS = -f elf  
   
 %.o: %.asm  
         $(AS) $(AFLAGS) $< -o $@  
   
48  RM = rm -rf  RM = rm -rf
49    
50    ##############################################################################
51    #
52    # Build rules
53    #
54    ##############################################################################
55    
56    # Their Objects
57    OBJECTS  = $(GENERIC_OBJECTS)
58    OBJECTS += $(ASSEMBLY_OBJECTS)
59    OBJECTS += $(DCT_IA64_OBJECTS)
60    OBJECTS += $(PPC_ALTIVEC_OBJECTS)
61    
62    # The VPATH mechanism could use a "per target" build directory
63    # To keep it simple at the moment, the directory is fixed to "build"
64    BUILD_DIR = =build
65    VPATH     = $(SRC_DIR):$(BUILD_DIR)
66    
67    #-----------------------------------------------------------------------------
68    # The default rule
69    #-----------------------------------------------------------------------------
70    
71    .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
72    
73    all: info $(STATIC_LIB) $(SHARED_LIB)
74            @echo
75            @echo "---------------------------------------------------------------"
76            @echo " Xvid has been successfully built."
77            @echo
78            @echo " * Binaries are currently located in the '$(BUILD_DIR)' directory"
79            @echo " * To install them on your system, you can run '# make install'"
80            @echo "   as root."
81            @echo "---------------------------------------------------------------"
82            @echo
83    
84    $(OBJECTS): platform.inc
85    
86    $(BUILD_DIR):
87            @echo "  D: $(BUILD_DIR)"
88            @$(INSTALL) -d $(BUILD_DIR)
89    
90    #-----------------------------------------------------------------------------
91    # Generic assembly rule
92    #-----------------------------------------------------------------------------
93    
94    .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
95            @echo "  A: $(@D)/$(<F)"
96            @$(INSTALL) -d $(BUILD_DIR)/$(@D)
97            @$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
98    
99    #-----------------------------------------------------------------------------
100    # Generic C rule
101    #-----------------------------------------------------------------------------
102    
103    $(PPC_ALTIVEC_OBJECTS): CFLAGS+= $(ALTIVEC_CFLAGS)
104    
105    .c.$(OBJECT_EXTENSION):
106            @echo "  C: $(@D)/$(<F)"
107            @$(INSTALL) -d $(BUILD_DIR)/$(@D)
108            @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
109    
110    #-----------------------------------------------------------------------------
111    # Static Library
112    #-----------------------------------------------------------------------------
113    
114    $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
115            @echo "  L: $(@F)"
116            @cd $(BUILD_DIR) && $(AR) rc $(@F) $(OBJECTS) && $(RANLIB) $(@F)
117    
118    #-----------------------------------------------------------------------------
119    # Shared Library
120    #
121    # NB: This rule is used a nasty way by the MacOSX module build process
122    #     In this only case, it uses the SPECIFIC_LDFLAGS to append an additionnal
123    #     linking step:
124    #      1/ it links a pre shared lib (libxvidcore.so-temp.4)
125    #      2/ it links that pre shared lib outputing the real shared lib (module)
126    #     In all other cases this rule is straight forward and simple.
127    #     PRE_SHARED_LIB == SHARED_LIB and no nasty command appending.
128    #
129    # NB': we copy the def file for the win32 target, the file is unused on other
130    #      platforms
131    #-----------------------------------------------------------------------------
132    
133    $(SHARED_LIB): $(BUILD_DIR) $(OBJECTS)
134            @echo "  L: $(@F)"
135            @$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def
136            @$(INSTALL) -m 644 libxvidcore.ld $(BUILD_DIR)/libxvidcore.ld
137            @cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS)
138    
139    #-----------------------------------------------------------------------------
140    # Installation
141    #-----------------------------------------------------------------------------
142    
143    install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
144            @echo "  D: $(libdir)"
145            @$(INSTALL) -d $(DESTDIR)$(libdir)
146            @echo "  I: $(libdir)/$(SHARED_LIB)"
147            @$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
148            @echo "  I: $(libdir)/$(STATIC_LIB)"
149            @$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
150            @echo "  D: $(includedir)"
151            @$(INSTALL) -d $(DESTDIR)$(includedir)
152            @echo "  I: $(includedir)/xvid.h"
153            @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h
154    
155    #-----------------------------------------------------------------------------
156    # Platorm specific file -- dumb rules for people executing make before
157    # ./configure or even ./bootstrap.sh
158    #-----------------------------------------------------------------------------
159    
160    platform.inc: configure platform.inc.in
161            ./configure
162    
163    configure:
164            ./bootstrap.sh
165    
166    #-----------------------------------------------------------------------------
167    # .PHONY targets
168    #-----------------------------------------------------------------------------
169    
170  all: $(LIB) $(LIBSO)  .PHONY: mrproper distclean clean info \
171            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 $@  
   
172    
173  clean:  clean:
174          $(RM) `find $(SRCDIR) -name "*.o"`          @echo "  Cl: Build directory"
175            @$(RM) $(BUILD_DIR)
176    
177    distclean: clean
178            @echo "  Cl: Generated build files"
179            @$(RM) platform.inc
180            @$(RM) config.log
181            @$(RM) config.status
182            @$(RM) autom4te.cache
183    
184    mrproper: distclean
185            @echo "  Cl: Bootstrapped build files"
186            @$(RM) configure
187            @$(RM) install-sh
188            @$(RM) missing
189            @$(RM) config.guess
190            @$(RM) mkinstalldirs
191            @$(RM) config.sub
192    
193    list-objects:
194            @echo
195            @echo "---------------------------------------------------------------"
196            @echo "Object files used for this build"
197            @echo "---------------------------------------------------------------"
198            @echo
199            @echo $(OBJECTS)
200            @echo
201    
202    list-targets:
203            @echo
204            @echo "---------------------------------------------------------------"
205            @echo "Target Libraries"
206            @echo "---------------------------------------------------------------"
207            @echo
208            @echo Shared library: $(SHARED_LIB)
209            @echo Static library: $(STATIC_LIB)
210            @echo
211    
212    list-install-path:
213            @echo
214            @echo "---------------------------------------------------------------"
215            @echo "Install Paths"
216            @echo "---------------------------------------------------------------"
217            @echo
218            @echo Include Directory: $(includedir)
219            @echo Library Directory: $(libdir)
220            @echo
221    
222    list-cflags:
223            @echo
224            @echo "---------------------------------------------------------------"
225            @echo "Using CFLAGS"
226            @echo "---------------------------------------------------------------"
227            @echo
228            @echo CFLAGS=$(CFLAGS)
229            @echo
230    
231  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.1.1  
changed lines
  Added in v.1.21

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