[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 1973, Thu Apr 28 14:06:07 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    
# Line 30  Line 51 
51  #  #
52  ##############################################################################  ##############################################################################
53    
 # Our main targets  
 STATIC_LIB=libxvidcore.$(STATIC_EXTENSION).3.0  
 SHARED_LIB=libxvidcore.$(SHARED_EXTENSION).3.0  
   
54  # Their Objects  # Their Objects
55  OBJECTS=$(GENERIC_OBJECTS)  OBJECTS=$(GENERIC_OBJECTS)
 OBJECTS+=$(DIVX4COMPAT_OBJECTS)  
56  OBJECTS+=$(ASSEMBLY_OBJECTS)  OBJECTS+=$(ASSEMBLY_OBJECTS)
57  OBJECTS+=$(DCT_IA64_OBJECTS)  OBJECTS+=$(DCT_IA64_OBJECTS)
58    OBJECTS += $(PPC_ALTIVEC_OBJECTS)
59    
60    # The VPATH mechanism could use a "per target" build directory
61    # To keep it simple at the moment, the directory is fixed to "build"
62    BUILD_DIR = =build
63    VPATH     = $(SRC_DIR):$(BUILD_DIR)
64    
65  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
66  # The default rule  # The default rule
# Line 46  Line 68 
68    
69  .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c  .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
70    
71  all: platform.inc $(STATIC_LIB) $(SHARED_LIB)  all: info $(STATIC_LIB) $(SHARED_LIB)
72          @echo          @echo
73          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
74          @echo " XviD has been built, you can now run \"# make install\" as root."          @echo " Xvid has been successfully built."
75            @echo
76            @echo " * Binaries are currently located in the '$(BUILD_DIR)' directory"
77            @echo " * To install them on your system, you can run '# make install'"
78            @echo "   as root."
79          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
80          @echo          @echo
81    
82    $(OBJECTS): platform.inc
83    
84    $(BUILD_DIR):
85            @echo "  D: $(BUILD_DIR)"
86            @$(INSTALL) -d $(BUILD_DIR)
87    
88  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
89  # Generic assembly rule  # Generic assembly rule
90  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
91    
92  .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):  .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
93          @echo -n "Assembling $< ... "          @echo "  A: $(@D)/$(<F)"
94          @$(AS) $(AFLAGS) $< -o $@          @$(INSTALL) -d $(BUILD_DIR)/$(@D)
95          @echo "Done"          @$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
96    
97  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
98  # Generic C rule  # Generic C rule
99  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
100    
101    $(PPC_ALTIVEC_OBJECTS): CFLAGS+= $(ALTIVEC_CFLAGS)
102    
103  .c.$(OBJECT_EXTENSION):  .c.$(OBJECT_EXTENSION):
104          @echo -n "Compiling $< ... "          @echo "  C: $(@D)/$(<F)"
105          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $@          @$(INSTALL) -d $(BUILD_DIR)/$(@D)
106          @echo "Done"          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
107    
108  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
109  # Static Library  # Static Library
110  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
111    
112  $(STATIC_LIB): $(OBJECTS)  $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
113          @echo          @echo "  L: $(@F)"
114          @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"  
115    
116  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
117  # Shared Library  # Shared Library
118  #-----------------------------------------------------------------------------  #
119    # NB: This rule is used a nasty way by the MacOSX module build process
120  $(SHARED_LIB): $(OBJECTS)  #     In this only case, it uses the SPECIFIC_LDFLAGS to append an additionnal
121          @echo  #     linking step:
122          @echo -n "Linking the shared library... "  #      1/ it links a pre shared lib (libxvidcore.so-temp.4)
123          @$(CC) $(LDFLAGS) $(OBJECTS) -o $(SHARED_LIB) $(SPECIFIC_LDFLAGS)  #      2/ it links that pre shared lib outputing the real shared lib (module)
124          @echo "Done"  #     In all other cases this rule is straight forward and simple.
125    #     PRE_SHARED_LIB == SHARED_LIB and no nasty command appending.
126    #
127    # NB': we copy the def file for the win32 target, the file is unused on other
128    #      platforms
129    #-----------------------------------------------------------------------------
130    
131    $(SHARED_LIB): $(BUILD_DIR) $(OBJECTS)
132            @echo "  L: $(@F)"
133            @$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def
134            @$(INSTALL) -m 644 libxvidcore.ld $(BUILD_DIR)/libxvidcore.ld
135            @cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS)
136    
137  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
138  # Installation  # Installation
139  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
140    
141  install: all  install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
142          @echo          @echo "  D: $(libdir)"
143          @echo "+---------- Installing XviD libraries in $(libdir) ----------+"          @$(INSTALL) -d $(DESTDIR)$(libdir)
144          @echo          @echo "  I: $(libdir)/$(SHARED_LIB)"
145          $(INSTALL) -m 755 $(SHARED_LIB) $(libdir)/$(SHARED_LIB)          @$(INSTALL) -m 644 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
146          $(INSTALL) -m 755 $(STATIC_LIB) $(libdir)/$(STATIC_LIB)          @echo "  I: $(libdir)/$(STATIC_LIB)"
147          @echo          @$(INSTALL) -m 644 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
148          @echo "+---------- Installing XviD header in $(includedir) ----------+"          @echo "  D: $(includedir)"
149          @echo          @$(INSTALL) -d $(DESTDIR)$(includedir)
150          $(INSTALL) -m 644 $(SRCDIR)/xvid.h $(includedir)/xvid.h          @echo "  I: $(includedir)/xvid.h"
151          @echo          @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h
152    
153  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
154  # Platorm specific file -- dumb rule for people executing make before  # Platorm specific file -- dumb rules for people executing make before
155  # ./configure  # ./configure or even ./bootstrap.sh
156  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
157    
158  platform.inc: platform.inc.in  platform.inc: configure platform.inc.in
159          ./configure          ./configure
160    
161    configure:
162            ./bootstrap.sh
163    
164  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
165  # .PHONY targets  # .PHONY targets
166  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
167    
168  .PHONY: distclean clean info list-objects list-targets list-install-path list-cflags  .PHONY: mrproper distclean clean info \
169            list-objects list-targets list-install-path list-cflags
170    
171  clean:  clean:
172          @echo -n "Cleaning objects... "          @echo "  Cl: Build directory"
173          @$(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"  
   
174    
175  distclean: clean  distclean: clean
176          @echo -n "Cleaning generated files... "          @echo "  Cl: Generated build files"
         @$(RM) libxvidcore.def  
177          @$(RM) platform.inc          @$(RM) platform.inc
178          @$(RM) config.log          @$(RM) config.log
179            @$(RM) config.status
180          @$(RM) autom4te.cache          @$(RM) autom4te.cache
181          @echo "Done"  
182    mrproper: distclean
183            @echo "  Cl: Bootstrapped build files"
184            @$(RM) configure
185            @$(RM) install-sh
186            @$(RM) missing
187            @$(RM) config.guess
188            @$(RM) mkinstalldirs
189            @$(RM) config.sub
190    
191  list-objects:  list-objects:
192          @echo          @echo
193            @echo "---------------------------------------------------------------"
194          @echo "Object files used for this build"          @echo "Object files used for this build"
195          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
196          @echo          @echo
# Line 154  Line 199 
199    
200  list-targets:  list-targets:
201          @echo          @echo
202            @echo "---------------------------------------------------------------"
203          @echo "Target Libraries"          @echo "Target Libraries"
204          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
205          @echo          @echo
# Line 163  Line 209 
209    
210  list-install-path:  list-install-path:
211          @echo          @echo
212            @echo "---------------------------------------------------------------"
213          @echo "Install Paths"          @echo "Install Paths"
214          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
215          @echo          @echo
216          @echo Include: $(includedir)          @echo Include Directory: $(includedir)
217          @echo Library: $(libdir)          @echo Library Directory: $(libdir)
218          @echo          @echo
219    
220  list-cflags:  list-cflags:
221          @echo          @echo
222            @echo "---------------------------------------------------------------"
223          @echo "Using CFLAGS"          @echo "Using CFLAGS"
224          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
225          @echo          @echo

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

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