[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 907, Thu Mar 6 21:12:03 2003 UTC revision 1412, Mon Apr 5 20:36:37 2004 UTC
# Line 7  Line 7 
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 functionnal 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    #
20    # Building output:
21    #  - C means "_C_ompiling"
22    #  - A means "_A_ssembling"
23    #  - I means "_I_nstalling"
24    #  - D means "creating _D_irectory"
25    #  - Cl means "_Cl_eaning"
26    #
27    # NB: (for mingw32/djgpp users)
28    #   These 2 environments do not provide a shell by default. So it's impossible
29    #   to use the configure script to generate a platform.inc file suitable for
30    #   your machine. You have two choices:
31    #    - install minsys from the mingw project or install cygwin and then use
32    #      the configure script as on a unix system.
33    #    - write a platform.inc file by hand.
34    #
35    # PS: default build directory is "=build", it fits naming conventions that
36    #     make the arch/tla revision control program ignore files contained in
37    #     this directory during commits operations. This choice is completly
38    #     arbitrary, but try not to change it.
39  #  #
40  ##############################################################################  ##############################################################################
41    
# Line 32  Line 52 
52    
53  # Their Objects  # Their Objects
54  OBJECTS=$(GENERIC_OBJECTS)  OBJECTS=$(GENERIC_OBJECTS)
 OBJECTS+=$(DIVX4COMPAT_OBJECTS)  
55  OBJECTS+=$(ASSEMBLY_OBJECTS)  OBJECTS+=$(ASSEMBLY_OBJECTS)
56  OBJECTS+=$(DCT_IA64_OBJECTS)  OBJECTS+=$(DCT_IA64_OBJECTS)
57    OBJECTS += $(PPC_ALTIVEC_OBJECTS)
58    
59    # The VPATH mecanism could use a "per target" build directory
60    # To keep it simple at the moment, the directory is fixed to "build"
61    BUILD_DIR = =build
62    VPATH     = $(SRC_DIR):$(BUILD_DIR)
63    
64  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
65  # The default rule  # The default rule
# Line 42  Line 67 
67    
68  .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c  .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
69    
70  all: platform.inc $(STATIC_LIB) $(SHARED_LIB)  all: $(STATIC_LIB) $(SHARED_LIB)
71          @echo          @echo
72          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
73          @echo " XviD has been built, you can now run \"# make install\" as root."          @echo " XviD has been successfully built."
74            @echo
75            @echo " * Binaries are currently located in the '$(BUILD_DIR)' directory"
76            @echo " * To install them on your system, you can run '# make install'"
77            @echo "   as root."
78          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
79          @echo          @echo
80    
81    $(OBJECTS): platform.inc
82    
83    $(BUILD_DIR):
84            @echo "  D: $(BUILD_DIR)"
85            @$(INSTALL) -d $(BUILD_DIR)
86    
87  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
88  # Generic assembly rule  # Generic assembly rule
89  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
90    
91  .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):  .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
92          @echo -n "Assembling $< ... "          @echo "  A: $(@D)/$(<F)"
93          @$(AS) $(AFLAGS) $< -o $@          @$(INSTALL) -d $(BUILD_DIR)/$(@D)
94          @echo "Done"          @$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
95    
96  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
97  # Generic C rule  # Generic C rule
98  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
99    
100  .c.$(OBJECT_EXTENSION):  .c.$(OBJECT_EXTENSION):
101          @echo -n "Compiling $< ... "          @echo "  C: $(@D)/$(<F)"
102          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $@          @$(INSTALL) -d $(BUILD_DIR)/$(@D)
103          @echo "Done"          @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
104    
105  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
106  # Static Library  # Static Library
107  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
108    
109  $(STATIC_LIB): $(OBJECTS)  $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
110          @echo          @echo "  L: $(@F)"
111          @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"  
112    
113  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
114  # Shared Library  # Shared Library
115  #-----------------------------------------------------------------------------  #
116    # NB: This rule is used a nasty way by the MacOSX module build process
117  $(SHARED_LIB): $(OBJECTS)  #     In this only case, it uses the SPECIFIC_LDFLAGS to append an additionnal
118          @echo  #     linking step:
119          @echo -n "Linking the shared library... "  #      1/ it links a pre shared lib (libxvidcore.so-temp.4)
120          @$(CC) $(LDFLAGS) $(OBJECTS) -o $(SHARED_LIB) $(SPECIFIC_LDFLAGS)  #      2/ it links that pre shared lib outputing the real shared lib (module)
121          @echo "Done"  #     In all other cases this rule is straight forward and simple.
122    #     PRE_SHARED_LIB == SHARED_LIB and no nasty command appending.
123    #
124    # NB': we copy the def file for the win32 target, the file is unused on other
125    #      platforms
126    #-----------------------------------------------------------------------------
127    
128    $(SHARED_LIB): $(BUILD_DIR) $(OBJECTS)
129            @echo "  L: $(@F)"
130            @$(INSTALL) -m 644 libxvidcore.def $(BUILD_DIR)/libxvidcore.def
131            @cd $(BUILD_DIR) && $(CC) $(LDFLAGS) $(OBJECTS) -o $(PRE_SHARED_LIB) $(SPECIFIC_LDFLAGS)
132    
133  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
134  # Installation  # Installation
135  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
136    
137  install: all  install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
138          @echo          @echo "  D: $(libdir)"
139          @echo "+---------- Installing XviD libraries in $(libdir) ----------+"          @$(INSTALL) -d $(libdir)
140          @echo          @echo "  I: $(libdir)/$(SHARED_LIB)"
141          $(INSTALL) -d $(libdir)          @$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(libdir)/$(SHARED_LIB)
142          $(INSTALL) -m 755 $(SHARED_LIB) $(libdir)/$(SHARED_LIB)          @echo "  I: $(libdir)/$(STATIC_LIB)"
143          $(INSTALL) -m 755 $(STATIC_LIB) $(libdir)/$(STATIC_LIB)          @$(INSTALL) -m 755 $(BUILD_DIR)/$(STATIC_LIB) $(libdir)/$(STATIC_LIB)
144          @echo          @echo "  D: $(includedir)"
145          @echo "+---------- Installing XviD header in $(includedir) ----------+"          @$(INSTALL) -d $(includedir)
146          @echo          @echo "  I: $(includedir)/xvid.h"
147          $(INSTALL) -d $(includedir)          @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(includedir)/xvid.h
         $(INSTALL) -m 644 $(SRCDIR)/xvid.h $(includedir)/xvid.h  
         @echo  
148    
149  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
150  # Platorm specific file -- dumb rule for people executing make before  # Platorm specific file -- dumb rules for people executing make before
151  # ./configure  # ./configure or even ./bootstrap.sh
152  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
153    
154  platform.inc: platform.inc.in  platform.inc: configure platform.inc.in
155          ./configure          ./configure
156    
157    configure:
158            ./bootstrap.sh
159    
160  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
161  # .PHONY targets  # .PHONY targets
162  #-----------------------------------------------------------------------------  #-----------------------------------------------------------------------------
163    
164  .PHONY: distclean clean info list-objects list-targets list-install-path list-cflags  .PHONY: mrproper distclean clean info \
165            list-objects list-targets list-install-path list-cflags
166    
167  clean:  clean:
168          @echo -n "Cleaning objects... "          @echo "  Cl: Build directory"
169          @$(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"  
   
170    
171  distclean: clean  distclean: clean
172          @echo -n "Cleaning generated files... "          @echo "  Cl: Generated build files"
         @$(RM) libxvidcore.def  
173          @$(RM) platform.inc          @$(RM) platform.inc
174          @$(RM) config.log          @$(RM) config.log
175            @$(RM) config.status
176          @$(RM) autom4te.cache          @$(RM) autom4te.cache
177          @echo "Done"  
178    mrproper: distclean
179            @echo "  Cl: Boostrapped build files"
180            @$(RM) configure
181            @$(RM) install-sh
182            @$(RM) missing
183            @$(RM) config.guess
184            @$(RM) mkinstalldirs
185            @$(RM) config.sub
186    
187  list-objects:  list-objects:
188          @echo          @echo
189            @echo "---------------------------------------------------------------"
190          @echo "Object files used for this build"          @echo "Object files used for this build"
191          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
192          @echo          @echo
# Line 152  Line 195 
195    
196  list-targets:  list-targets:
197          @echo          @echo
198            @echo "---------------------------------------------------------------"
199          @echo "Target Libraries"          @echo "Target Libraries"
200          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
201          @echo          @echo
# Line 161  Line 205 
205    
206  list-install-path:  list-install-path:
207          @echo          @echo
208            @echo "---------------------------------------------------------------"
209          @echo "Install Paths"          @echo "Install Paths"
210          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
211          @echo          @echo
212          @echo Include: $(includedir)          @echo Include Directory: $(includedir)
213          @echo Library: $(libdir)          @echo Library Directory: $(libdir)
214          @echo          @echo
215    
216  list-cflags:  list-cflags:
217          @echo          @echo
218            @echo "---------------------------------------------------------------"
219          @echo "Using CFLAGS"          @echo "Using CFLAGS"
220          @echo "---------------------------------------------------------------"          @echo "---------------------------------------------------------------"
221          @echo          @echo

Legend:
Removed from v.907  
changed lines
  Added in v.1412

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