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

Annotation of /trunk/xvidcore/build/generic/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1451 - (view) (download)

1 : edgomez 824 ##############################################################################
2 :     #
3 :     # - Unified Makefile for XviD for *nix environments -
4 :     #
5 : edgomez 1451 # Copyright(C) 2003-2004 Edouard Gomez <ed.gomez@free.fr>
6 : edgomez 824 #
7 :     #
8 :     # Description:
9 :     # This Makefile allows building XviD sources to obtain a shared library
10 : edgomez 1382 # and a static library. This Makefile uses variables defined in the
11 : edgomez 824 # platform.inc file. This platform.inc file is usually created by the
12 :     # ./configure script whenever a unix shell is available.
13 :     #
14 : edgomez 1451 # Makefile functional dependencies:
15 : edgomez 1382 # - echo
16 :     # - rm (with option -r and -f)
17 :     # - cd
18 :     # - make VPATH support (eg: GNU make, solaris 8 make)
19 : edgomez 1451 # - ar
20 : edgomez 824 #
21 : edgomez 1382 # 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 : edgomez 824 #
28 : edgomez 1382 # 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 : edgomez 824 ##############################################################################
42 :    
43 :     include sources.inc
44 :     include platform.inc
45 :    
46 :     RM = rm -rf
47 :    
48 :     ##############################################################################
49 :     #
50 :     # Build rules
51 :     #
52 :     ##############################################################################
53 :    
54 :     # Their Objects
55 : edgomez 1382 OBJECTS = $(GENERIC_OBJECTS)
56 :     OBJECTS += $(ASSEMBLY_OBJECTS)
57 :     OBJECTS += $(DCT_IA64_OBJECTS)
58 : edgomez 1412 OBJECTS += $(PPC_ALTIVEC_OBJECTS)
59 : edgomez 824
60 : edgomez 1451 # The VPATH mechanism could use a "per target" build directory
61 : edgomez 1382 # 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 : edgomez 824 #-----------------------------------------------------------------------------
66 :     # The default rule
67 :     #-----------------------------------------------------------------------------
68 :    
69 :     .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
70 :    
71 : edgomez 1382 all: $(STATIC_LIB) $(SHARED_LIB)
72 : edgomez 830 @echo
73 :     @echo "---------------------------------------------------------------"
74 : edgomez 1382 @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 : edgomez 830 @echo "---------------------------------------------------------------"
80 :     @echo
81 : edgomez 824
82 : edgomez 1382 $(OBJECTS): platform.inc
83 :    
84 :     $(BUILD_DIR):
85 :     @echo " D: $(BUILD_DIR)"
86 :     @$(INSTALL) -d $(BUILD_DIR)
87 :    
88 : edgomez 824 #-----------------------------------------------------------------------------
89 :     # Generic assembly rule
90 :     #-----------------------------------------------------------------------------
91 :    
92 :     .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
93 : edgomez 1382 @echo " A: $(@D)/$(<F)"
94 :     @$(INSTALL) -d $(BUILD_DIR)/$(@D)
95 :     @$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
96 : edgomez 824
97 :     #-----------------------------------------------------------------------------
98 :     # Generic C rule
99 :     #-----------------------------------------------------------------------------
100 :    
101 :     .c.$(OBJECT_EXTENSION):
102 : edgomez 1382 @echo " C: $(@D)/$(<F)"
103 :     @$(INSTALL) -d $(BUILD_DIR)/$(@D)
104 :     @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
105 : edgomez 824
106 :     #-----------------------------------------------------------------------------
107 :     # Static Library
108 :     #-----------------------------------------------------------------------------
109 :    
110 : edgomez 1382 $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
111 :     @echo " L: $(@F)"
112 :     @cd $(BUILD_DIR) && ar rc $(@F) $(OBJECTS) && $(RANLIB) $(@F)
113 : edgomez 824
114 :     #-----------------------------------------------------------------------------
115 :     # Shared Library
116 : edgomez 1382 #
117 :     # NB: This rule is used a nasty way by the MacOSX module build process
118 :     # In this only case, it uses the SPECIFIC_LDFLAGS to append an additionnal
119 :     # linking step:
120 :     # 1/ it links a pre shared lib (libxvidcore.so-temp.4)
121 :     # 2/ it links that pre shared lib outputing the real shared lib (module)
122 :     # 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 : edgomez 824 #-----------------------------------------------------------------------------
128 :    
129 : edgomez 1382 $(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 : edgomez 824
134 :     #-----------------------------------------------------------------------------
135 :     # Installation
136 :     #-----------------------------------------------------------------------------
137 :    
138 : edgomez 1382 install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
139 :     @echo " D: $(libdir)"
140 :     @$(INSTALL) -d $(libdir)
141 :     @echo " I: $(libdir)/$(SHARED_LIB)"
142 :     @$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(libdir)/$(SHARED_LIB)
143 :     @echo " I: $(libdir)/$(STATIC_LIB)"
144 :     @$(INSTALL) -m 755 $(BUILD_DIR)/$(STATIC_LIB) $(libdir)/$(STATIC_LIB)
145 :     @echo " D: $(includedir)"
146 :     @$(INSTALL) -d $(includedir)
147 :     @echo " I: $(includedir)/xvid.h"
148 :     @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(includedir)/xvid.h
149 : edgomez 824
150 :     #-----------------------------------------------------------------------------
151 : edgomez 1382 # Platorm specific file -- dumb rules for people executing make before
152 :     # ./configure or even ./bootstrap.sh
153 : edgomez 824 #-----------------------------------------------------------------------------
154 :    
155 : edgomez 1382 platform.inc: configure platform.inc.in
156 : edgomez 824 ./configure
157 :    
158 : edgomez 1382 configure:
159 :     ./bootstrap.sh
160 :    
161 : edgomez 824 #-----------------------------------------------------------------------------
162 :     # .PHONY targets
163 :     #-----------------------------------------------------------------------------
164 :    
165 : edgomez 1382 .PHONY: mrproper distclean clean info \
166 :     list-objects list-targets list-install-path list-cflags
167 : edgomez 824
168 :     clean:
169 : edgomez 1382 @echo " Cl: Build directory"
170 :     @$(RM) $(BUILD_DIR)
171 : edgomez 824
172 :     distclean: clean
173 : edgomez 1382 @echo " Cl: Generated build files"
174 : edgomez 830 @$(RM) platform.inc
175 :     @$(RM) config.log
176 : edgomez 1009 @$(RM) config.status
177 : edgomez 830 @$(RM) autom4te.cache
178 : edgomez 824
179 : edgomez 1382 mrproper: distclean
180 : edgomez 1451 @echo " Cl: Bootstrapped build files"
181 : edgomez 1382 @$(RM) configure
182 :     @$(RM) install-sh
183 :     @$(RM) missing
184 :     @$(RM) config.guess
185 :     @$(RM) mkinstalldirs
186 :     @$(RM) config.sub
187 :    
188 : edgomez 824 list-objects:
189 :     @echo
190 : edgomez 1382 @echo "---------------------------------------------------------------"
191 : edgomez 824 @echo "Object files used for this build"
192 :     @echo "---------------------------------------------------------------"
193 :     @echo
194 :     @echo $(OBJECTS)
195 :     @echo
196 :    
197 :     list-targets:
198 :     @echo
199 : edgomez 1382 @echo "---------------------------------------------------------------"
200 : edgomez 824 @echo "Target Libraries"
201 :     @echo "---------------------------------------------------------------"
202 :     @echo
203 :     @echo Shared library: $(SHARED_LIB)
204 :     @echo Static library: $(STATIC_LIB)
205 :     @echo
206 :    
207 :     list-install-path:
208 :     @echo
209 : edgomez 1382 @echo "---------------------------------------------------------------"
210 : edgomez 824 @echo "Install Paths"
211 :     @echo "---------------------------------------------------------------"
212 :     @echo
213 : edgomez 1382 @echo Include Directory: $(includedir)
214 :     @echo Library Directory: $(libdir)
215 : edgomez 824 @echo
216 :    
217 : edgomez 845 list-cflags:
218 :     @echo
219 : edgomez 1382 @echo "---------------------------------------------------------------"
220 : edgomez 845 @echo "Using CFLAGS"
221 :     @echo "---------------------------------------------------------------"
222 :     @echo
223 :     @echo CFLAGS=$(CFLAGS)
224 :     @echo
225 :    
226 :     info: list-objects list-cflags list-targets list-install-path

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