[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 863, Sun Feb 16 18:31:42 2003 UTC revision 1556, Tue Oct 12 21:08:41 2004 UTC
# Line 2  Line 2 
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)  
 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: $(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  .c.$(OBJECT_EXTENSION):  .c.$(OBJECT_EXTENSION):
102          @echo -n "Compiling $< ... "          @echo "  C: $(@D)/$(<F)"
103          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $@          @$(INSTALL) -d $(BUILD_DIR)/$(@D)
104          @echo "Done"          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
105    
106  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
107  # Static Library  # Static Library
108  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
109    
110  $(STATIC_LIB): $(OBJECTS)  $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
111          @echo          @echo "  L: $(@F)"
112          @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"  
113    
114  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
115  # Shared Library  # Shared Library
116  #-----------------------------------------------------------------------------  #
117    # NB: This rule is used a nasty way by the MacOSX module build process
118  $(SHARED_LIB): $(OBJECTS)  #     In this only case, it uses the SPECIFIC_LDFLAGS to append an additionnal
119          @echo  #     linking step:
120          @echo -n "Linking the shared library... "  #      1/ it links a pre shared lib (libxvidcore.so-temp.4)
121          @$(CC) $(LDFLAGS) $(OBJECTS) -o $(SHARED_LIB) $(SPECIFIC_LDFLAGS)  #      2/ it links that pre shared lib outputing the real shared lib (module)
122          @echo "Done"  #     In all other cases this rule is straight forward and simple.
123    #     PRE_SHARED_LIB == SHARED_LIB and no nasty command appending.
124    #
125    # NB': we copy the def file for the win32 target, the file is unused on other
126    #      platforms
127    #-----------------------------------------------------------------------------
128    
129    $(SHARED_LIB): $(BUILD_DIR) $(OBJECTS)
130            @echo "  L: $(@F)"
131            @$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def
132            @cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS)
133    
134  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
135  # Installation  # Installation
136  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
137    
138  install: all  install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
139          @echo          @echo "  D: $(libdir)"
140          @echo "+---------- Installing XviD libraries in $(libdir) ----------+"          @$(INSTALL) -d $(DESTDIR)$(libdir)
141          @echo          @echo "  I: $(libdir)/$(SHARED_LIB)"
142          $(INSTALL) -m 755 $(SHARED_LIB) $(libdir)/$(SHARED_LIB)          @$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(DESTDIR)$(libdir)/$(SHARED_LIB)
143          $(INSTALL) -m 755 $(STATIC_LIB) $(libdir)/$(STATIC_LIB)          @echo "  I: $(libdir)/$(STATIC_LIB)"
144          @echo          @$(INSTALL) -m 755 $(BUILD_DIR)/$(STATIC_LIB) $(DESTDIR)$(libdir)/$(STATIC_LIB)
145          @echo "+---------- Installing XviD header in $(includedir) ----------+"          @echo "  D: $(includedir)"
146          @echo          @$(INSTALL) -d $(DESTDIR)$(includedir)
147          $(INSTALL) -m 644 $(SRCDIR)/xvid.h $(includedir)/xvid.h          @echo "  I: $(includedir)/xvid.h"
148          @echo          @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(DESTDIR)$(includedir)/xvid.h
149    
150  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
151  # Platorm specific file -- dumb rule for people executing make before  # Platorm specific file -- dumb rules for people executing make before
152  # ./configure  # ./configure or even ./bootstrap.sh
153  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
154    
155  platform.inc: platform.inc.in  platform.inc: configure platform.inc.in
156          ./configure          ./configure
157    
158    configure:
159            ./bootstrap.sh
160    
161  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
162  # .PHONY targets  # .PHONY targets
163  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
164    
165  .PHONY: distclean clean info list-objects list-targets list-install-path list-cflags  .PHONY: mrproper distclean clean info \
166            list-objects list-targets list-install-path list-cflags
167    
168  clean:  clean:
169          @echo -n "Cleaning objects... "          @echo "  Cl: Build directory"
170          @$(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"  
   
171    
172  distclean: clean  distclean: clean
173          @echo -n "Cleaning generated files... "          @echo "  Cl: Generated build files"
         @$(RM) libxvidcore.def  
174          @$(RM) platform.inc          @$(RM) platform.inc
175          @$(RM) config.log          @$(RM) config.log
176            @$(RM) config.status
177          @$(RM) autom4te.cache          @$(RM) autom4te.cache
178          @echo "Done"  
179    mrproper: distclean
180            @echo "  Cl: Bootstrapped build files"
181            @$(RM) configure
182            @$(RM) install-sh
183            @$(RM) missing
184            @$(RM) config.guess
185            @$(RM) mkinstalldirs
186            @$(RM) config.sub
187    
188  list-objects:  list-objects:
189          @echo          @echo
190            @echo "---------------------------------------------------------------"
191          @echo "Object files used for this build"          @echo "Object files used for this build"
192          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
193          @echo          @echo
# Line 154  Line 196 
196    
197  list-targets:  list-targets:
198          @echo          @echo
199            @echo "---------------------------------------------------------------"
200          @echo "Target Libraries"          @echo "Target Libraries"
201          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
202          @echo          @echo
# Line 163  Line 206 
206    
207  list-install-path:  list-install-path:
208          @echo          @echo
209            @echo "---------------------------------------------------------------"
210          @echo "Install Paths"          @echo "Install Paths"
211          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
212          @echo          @echo
213          @echo Include: $(includedir)          @echo Include Directory: $(includedir)
214          @echo Library: $(libdir)          @echo Library Directory: $(libdir)
215          @echo          @echo
216    
217  list-cflags:  list-cflags:
218          @echo          @echo
219            @echo "---------------------------------------------------------------"
220          @echo "Using CFLAGS"          @echo "Using CFLAGS"
221          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
222          @echo          @echo

Legend:
Removed from v.863  
changed lines
  Added in v.1556

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