[svn] / trunk / xvidcore / build / generic / Makefile Repository:
ViewVC logotype

Diff of /trunk/xvidcore/build/generic/Makefile

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

revision 851, Sat Feb 15 15:22:19 2003 UTC revision 1997, Thu May 19 08:28:51 2011 UTC
# Line 1  Line 1 
1  ##############################################################################  ##############################################################################
2  #  #
3  # - Unified Makefile for XviD for *nix environments -  # - Unified Makefile for Xvid for *nix environments -
4  #  #
5  # Copyright(C) 2003 Edouard Gomez <ed.gomez@free.fr>  # Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>
6  #  #
7  #  #
8  # Description:  # Description:
9  #  This Makefile allows building XviD sources to obtain a shared library  #  This Makefile allows building Xvid sources to obtain a shared library
10  #  and a static library. This Makefie uses variables defined in the  #  and a static library. This Makefile uses variables defined in the
11  #  platform.inc file. This platform.inc file is usually created by the  #  platform.inc file. This platform.inc file is usually created by the
12  #  ./configure script whenever a unix shell is available.  #  ./configure script whenever a unix shell is available.
13  #  #
14  # Nota Bene for mingw32/djgpp users:  # Makefile functional dependencies:
15  #   However if you provide a platform.inc file adapted to your OS, then  #  - echo
16  #   change the include platform.inc to include yourfile.inc and it should  #  - rm (with option -r and -f)
17  #   work too.  #  - cd
18  #  #  - make VPATH support (eg: GNU make, solaris 8 make)
19    #  - ar
20    #
21    # Building output:
22    #  - C means "_C_ompiling"
23    #  - A means "_A_ssembling"
24    #  - I means "_I_nstalling"
25    #  - D means "creating _D_irectory"
26    #  - Cl means "_Cl_eaning"
27    #
28    # NB: (for mingw32/djgpp users)
29    #   These 2 environments do not provide a shell by default. So it's impossible
30    #   to use the configure script to generate a platform.inc file suitable for
31    #   your machine. You have two choices:
32    #    - install minsys from the mingw project or install cygwin and then use
33    #      the configure script as on a unix system.
34    #    - write a platform.inc file by hand.
35    #
36    # PS: default build directory is "=build", it fits naming conventions that
37    #     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  include sources.inc
44    ifeq ($(findstring $(MAKECMDGOALS), clean distclean mrproper),)
45  include platform.inc  include platform.inc
46    endif
47    
48  RM = rm -rf  RM = rm -rf
49    
# Line 30  Line 53 
53  #  #
54  ##############################################################################  ##############################################################################
55    
 # Our main targets  
 STATIC_LIB=libxvidcore.$(STATIC_EXTENSION).3.0  
 SHARED_LIB=libxvidcore.$(SHARED_EXTENSION).3.0  
   
56  # Their Objects  # Their Objects
57  OBJECTS=$(GENERIC_OBJECTS)  OBJECTS=$(GENERIC_OBJECTS)
 OBJECTS+=$(DIVX4COMPAT_OBJECTS)  
58  OBJECTS+=$(ASSEMBLY_OBJECTS)  OBJECTS+=$(ASSEMBLY_OBJECTS)
59  OBJECTS+=$(DCT_IA64_OBJECTS)  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  # The default rule
# Line 46  Line 70 
70    
71  .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c  .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
72    
73  all: platform.inc $(STATIC_LIB) $(SHARED_LIB)  all: info $(STATIC_LIB) $(SHARED_LIB)
74          @echo          @echo
75          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
76          @echo " XviD has been built, you can now run \"# make install\" as root."          @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 "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
82          @echo          @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  # Generic assembly rule
92  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
93    
94  .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):  .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
95          @echo -n "Assembling $< ... "          @echo "  A: $(@D)/$(<F)"
96          @$(AS) $(AFLAGS) $< -o $@          @$(INSTALL) -d $(BUILD_DIR)/$(@D)
97          @echo "Done"          @$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
98    
99  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
100  # Generic C rule  # Generic C rule
101  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
102    
103    $(PPC_ALTIVEC_OBJECTS): CFLAGS+= $(ALTIVEC_CFLAGS)
104    
105  .c.$(OBJECT_EXTENSION):  .c.$(OBJECT_EXTENSION):
106          @echo -n "Compiling $< ... "          @echo "  C: $(@D)/$(<F)"
107          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $@          @$(INSTALL) -d $(BUILD_DIR)/$(@D)
108          @echo "Done"          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
109    
110  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
111  # Static Library  # Static Library
112  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
113    
114  $(STATIC_LIB): $(OBJECTS)  $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
115          @echo          @echo "  L: $(@F)"
116          @echo -n "Linking the static library... "          @cd $(BUILD_DIR) && $(AR) rc $(@F) $(OBJECTS) && $(RANLIB) $(@F)
         @ar rc $(STATIC_LIB) $(OBJECTS)  
         @echo "Done"  
         @echo -n "Generating static library's index... "  
         @$(RANLIB) $(STATIC_LIB)  
         @echo "Done"  
117    
118  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
119  # Shared Library  # Shared Library
120  #-----------------------------------------------------------------------------  #
121    # NB: This rule is used a nasty way by the MacOSX module build process
122  $(SHARED_LIB): $(OBJECTS)  #     In this only case, it uses the SPECIFIC_LDFLAGS to append an additionnal
123          @echo  #     linking step:
124          @echo -n "Linking the shared library... "  #      1/ it links a pre shared lib (libxvidcore.so-temp.4)
125          @$(CC) $(LDFLAGS) $(OBJECTS) -o $(SHARED_LIB) $(SPECIFIC_LDFLAGS)  #      2/ it links that pre shared lib outputing the real shared lib (module)
126          @echo "Done"  #     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  # Installation
141  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
142    
143  install: all  install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
144          @echo          @echo "  D: $(libdir)"
145          @echo "+---------- Installing XviD libraries in $(libdir) ----------+"          @$(INSTALL) -d $(DESTDIR)$(libdir)
146          @echo          @echo "  I: $(libdir)/$(SHARED_LIB)"
147          $(INSTALL) -m 755 $(SHARED_LIB) $(libdir)/$(SHARED_LIB)          @$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
148          $(INSTALL) -m 755 $(STATIC_LIB) $(libdir)/$(STATIC_LIB)          @echo "  I: $(libdir)/$(STATIC_LIB)"
149          @echo          @$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
150          @echo "+---------- Installing XviD header in $(includedir) ----------+"          @echo "  D: $(includedir)"
151          @echo          @$(INSTALL) -d $(DESTDIR)$(includedir)
152          $(INSTALL) -m 644 $(SRCDIR)/xvid.h $(includedir)/xvid.h          @echo "  I: $(includedir)/xvid.h"
153          @echo          @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h
154    
155  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
156  # Platorm specific file -- dumb rule for people executing make before  # Platorm specific file -- dumb rules for people executing make before
157  # ./configure  # ./configure or even ./bootstrap.sh
158  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
159    
160  platform.inc: platform.inc.in  platform.inc: configure platform.inc.in
161          ./configure          ./configure
162    
163    configure:
164            ./bootstrap.sh
165    
166  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
167  # .PHONY targets  # .PHONY targets
168  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
169    
170  .PHONY: distclean clean info list-objects list-targets list-install-path list-cflags  .PHONY: mrproper distclean clean info \
171            list-objects list-targets list-install-path list-cflags
172    
173  clean:  clean:
174          @echo -n "Cleaning objects... "          @echo "  Cl: Build directory"
175          @$(RM) $(OBJECTS)          @$(RM) $(BUILD_DIR)
         @echo "Done"  
         @echo -n "Cleaning static library... "  
         @$(RM) $(STATIC_LIB)  
         @echo "Done"  
         @echo -n "Cleaning shared library... "  
         @$(RM) $(SHARED_LIB)  
         @echo "Done"  
   
176    
177  distclean: clean  distclean: clean
178          @echo -n "Cleaning generated files... "          @echo "  Cl: Generated build files"
         @$(RM) libxvidcore.def  
179          @$(RM) platform.inc          @$(RM) platform.inc
180          @$(RM) config.log          @$(RM) config.log
181            @$(RM) config.status
182          @$(RM) autom4te.cache          @$(RM) autom4te.cache
183          @echo "Done"  
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:  list-objects:
194          @echo          @echo
195            @echo "---------------------------------------------------------------"
196          @echo "Object files used for this build"          @echo "Object files used for this build"
197          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
198          @echo          @echo
# Line 154  Line 201 
201    
202  list-targets:  list-targets:
203          @echo          @echo
204            @echo "---------------------------------------------------------------"
205          @echo "Target Libraries"          @echo "Target Libraries"
206          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
207          @echo          @echo
# Line 163  Line 211 
211    
212  list-install-path:  list-install-path:
213          @echo          @echo
214            @echo "---------------------------------------------------------------"
215          @echo "Install Paths"          @echo "Install Paths"
216          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
217          @echo          @echo
218          @echo Include: $(includedir)          @echo Include Directory: $(includedir)
219          @echo Library: $(libdir)          @echo Library Directory: $(libdir)
220          @echo          @echo
221    
222  list-cflags:  list-cflags:
223          @echo          @echo
224            @echo "---------------------------------------------------------------"
225          @echo "Using CFLAGS"          @echo "Using CFLAGS"
226          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
227          @echo          @echo

Legend:
Removed from v.851  
changed lines
  Added in v.1997

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