[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 1412 - (view) (download)

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

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