[svn] / branches / dev-api-4 / xvidcore / build / generic / Makefile Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/build/generic/Makefile

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

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

Legend:
Removed from v.1153  
changed lines
  Added in v.1154

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