[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 1382 - (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 824
58 : edgomez 1382 # 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 : edgomez 824 #-----------------------------------------------------------------------------
64 :     # The default rule
65 :     #-----------------------------------------------------------------------------
66 :    
67 :     .SUFFIXES: .$(OBJECT_EXTENSION) .$(ASSEMBLY_EXTENSION) .c
68 :    
69 : edgomez 1382 all: $(STATIC_LIB) $(SHARED_LIB)
70 : edgomez 830 @echo
71 :     @echo "---------------------------------------------------------------"
72 : edgomez 1382 @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 : edgomez 830 @echo "---------------------------------------------------------------"
78 :     @echo
79 : edgomez 824
80 : edgomez 1382 $(OBJECTS): platform.inc
81 :    
82 :     $(BUILD_DIR):
83 :     @echo " D: $(BUILD_DIR)"
84 :     @$(INSTALL) -d $(BUILD_DIR)
85 :    
86 : edgomez 824 #-----------------------------------------------------------------------------
87 :     # Generic assembly rule
88 :     #-----------------------------------------------------------------------------
89 :    
90 :     .$(ASSEMBLY_EXTENSION).$(OBJECT_EXTENSION):
91 : edgomez 1382 @echo " A: $(@D)/$(<F)"
92 :     @$(INSTALL) -d $(BUILD_DIR)/$(@D)
93 :     @$(AS) $(AFLAGS) $< -o $(BUILD_DIR)/$@
94 : edgomez 824
95 :     #-----------------------------------------------------------------------------
96 :     # Generic C rule
97 :     #-----------------------------------------------------------------------------
98 :    
99 :     .c.$(OBJECT_EXTENSION):
100 : edgomez 1382 @echo " C: $(@D)/$(<F)"
101 :     @$(INSTALL) -d $(BUILD_DIR)/$(@D)
102 :     @$(CC) -c $(ARCHITECTURE) $(BUS) $(ENDIANNESS) $(FEATURES) $(SPECIFIC_CFLAGS) $(CFLAGS) $< -o $(BUILD_DIR)/$@
103 : edgomez 824
104 :     #-----------------------------------------------------------------------------
105 :     # Static Library
106 :     #-----------------------------------------------------------------------------
107 :    
108 : edgomez 1382 $(STATIC_LIB): $(BUILD_DIR) $(OBJECTS)
109 :     @echo " L: $(@F)"
110 :     @cd $(BUILD_DIR) && ar rc $(@F) $(OBJECTS) && $(RANLIB) $(@F)
111 : edgomez 824
112 :     #-----------------------------------------------------------------------------
113 :     # Shared Library
114 : edgomez 1382 #
115 :     # NB: This rule is used a nasty way by the MacOSX module build process
116 :     # In this only case, it uses the SPECIFIC_LDFLAGS to append an additionnal
117 :     # linking step:
118 :     # 1/ it links a pre shared lib (libxvidcore.so-temp.4)
119 :     # 2/ it links that pre shared lib outputing the real shared lib (module)
120 :     # 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 : edgomez 824 #-----------------------------------------------------------------------------
126 :    
127 : edgomez 1382 $(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 : edgomez 824
132 :     #-----------------------------------------------------------------------------
133 :     # Installation
134 :     #-----------------------------------------------------------------------------
135 :    
136 : edgomez 1382 install: $(BUILD_DIR)/$(STATIC_LIB) $(BUILD_DIR)/$(SHARED_LIB)
137 :     @echo " D: $(libdir)"
138 :     @$(INSTALL) -d $(libdir)
139 :     @echo " I: $(libdir)/$(SHARED_LIB)"
140 :     @$(INSTALL) -m 755 $(BUILD_DIR)/$(SHARED_LIB) $(libdir)/$(SHARED_LIB)
141 :     @echo " I: $(libdir)/$(STATIC_LIB)"
142 :     @$(INSTALL) -m 755 $(BUILD_DIR)/$(STATIC_LIB) $(libdir)/$(STATIC_LIB)
143 :     @echo " D: $(includedir)"
144 :     @$(INSTALL) -d $(includedir)
145 :     @echo " I: $(includedir)/xvid.h"
146 :     @$(INSTALL) -m 644 $(SRC_DIR)/xvid.h $(includedir)/xvid.h
147 : edgomez 824
148 :     #-----------------------------------------------------------------------------
149 : edgomez 1382 # Platorm specific file -- dumb rules for people executing make before
150 :     # ./configure or even ./bootstrap.sh
151 : edgomez 824 #-----------------------------------------------------------------------------
152 :    
153 : edgomez 1382 platform.inc: configure platform.inc.in
154 : edgomez 824 ./configure
155 :    
156 : edgomez 1382 configure:
157 :     ./bootstrap.sh
158 :    
159 : edgomez 824 #-----------------------------------------------------------------------------
160 :     # .PHONY targets
161 :     #-----------------------------------------------------------------------------
162 :    
163 : edgomez 1382 .PHONY: mrproper distclean clean info \
164 :     list-objects list-targets list-install-path list-cflags
165 : edgomez 824
166 :     clean:
167 : edgomez 1382 @echo " Cl: Build directory"
168 :     @$(RM) $(BUILD_DIR)
169 : edgomez 824
170 :     distclean: clean
171 : edgomez 1382 @echo " Cl: Generated build files"
172 : edgomez 830 @$(RM) platform.inc
173 :     @$(RM) config.log
174 : edgomez 1009 @$(RM) config.status
175 : edgomez 830 @$(RM) autom4te.cache
176 : edgomez 824
177 : edgomez 1382 mrproper: distclean
178 :     @echo " Cl: Boostrapped build files"
179 :     @$(RM) configure
180 :     @$(RM) install-sh
181 :     @$(RM) missing
182 :     @$(RM) config.guess
183 :     @$(RM) mkinstalldirs
184 :     @$(RM) config.sub
185 :    
186 : edgomez 824 list-objects:
187 :     @echo
188 : edgomez 1382 @echo "---------------------------------------------------------------"
189 : edgomez 824 @echo "Object files used for this build"
190 :     @echo "---------------------------------------------------------------"
191 :     @echo
192 :     @echo $(OBJECTS)
193 :     @echo
194 :    
195 :     list-targets:
196 :     @echo
197 : edgomez 1382 @echo "---------------------------------------------------------------"
198 : edgomez 824 @echo "Target Libraries"
199 :     @echo "---------------------------------------------------------------"
200 :     @echo
201 :     @echo Shared library: $(SHARED_LIB)
202 :     @echo Static library: $(STATIC_LIB)
203 :     @echo
204 :    
205 :     list-install-path:
206 :     @echo
207 : edgomez 1382 @echo "---------------------------------------------------------------"
208 : edgomez 824 @echo "Install Paths"
209 :     @echo "---------------------------------------------------------------"
210 :     @echo
211 : edgomez 1382 @echo Include Directory: $(includedir)
212 :     @echo Library Directory: $(libdir)
213 : edgomez 824 @echo
214 :    
215 : edgomez 845 list-cflags:
216 :     @echo
217 : edgomez 1382 @echo "---------------------------------------------------------------"
218 : edgomez 845 @echo "Using CFLAGS"
219 :     @echo "---------------------------------------------------------------"
220 :     @echo
221 :     @echo CFLAGS=$(CFLAGS)
222 :     @echo
223 :    
224 :     info: list-objects list-cflags list-targets list-install-path

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