diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2007-12-07 05:19:12 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2007-12-07 05:19:12 +0000 |
commit | 4f77a2c07c1a2cb306ac7ce85c93f6097701fdc7 (patch) | |
tree | 80ab7f128004858d5489d8d9b05c36e5f9125714 /xdelta3/Makefile | |
parent | 440ec9c30484dbb2cbd56b3762c4ba9961efcf22 (diff) |
Patches from A. Mennucc for Debian. Fixing makfile for Cygwin
conditional compilation, which is irregular.
Diffstat (limited to 'xdelta3/Makefile')
-rw-r--r-- | xdelta3/Makefile | 150 |
1 files changed, 102 insertions, 48 deletions
diff --git a/xdelta3/Makefile b/xdelta3/Makefile index 96b0ef6..f3c2970 100644 --- a/xdelta3/Makefile +++ b/xdelta3/Makefile | |||
@@ -1,5 +1,17 @@ | |||
1 | # xdelta 3 - delta compression tools and library | 1 | # xdelta 3 - delta compression tools and library |
2 | # Copyright (C) 2001, 2003, 2004, 2005, 2006. Joshua P. MacDonald | 2 | # Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007. Joshua P. MacDonald |
3 | |||
4 | UNAME = $(shell uname) | ||
5 | CYGWIN = $(findstring CYGWIN, $(UNAME)) | ||
6 | PYVER = 2.5 | ||
7 | |||
8 | ifeq ("$(CYGWIN)", "") | ||
9 | SWIGTGT = xdelta3module.so | ||
10 | PYTGT = build/lib.linux-i686-$(PYVER)/xdelta3main.so | ||
11 | else | ||
12 | SWIGTGT = xdelta3module.dll | ||
13 | PYTGT = build/lib.cygwin-1.5.24-i686-$(PYVER)/xdelta3main.dll | ||
14 | endif | ||
3 | 15 | ||
4 | SOURCES = xdelta3-cfgs.h \ | 16 | SOURCES = xdelta3-cfgs.h \ |
5 | xdelta3-decode.h \ | 17 | xdelta3-decode.h \ |
@@ -20,7 +32,6 @@ TARGETS = xdelta3-debug \ | |||
20 | xdelta3-debug3 \ | 32 | xdelta3-debug3 \ |
21 | xdelta3.o \ | 33 | xdelta3.o \ |
22 | xdelta3_wrap.o \ | 34 | xdelta3_wrap.o \ |
23 | xdelta3module.so \ | ||
24 | xdelta3-32 \ | 35 | xdelta3-32 \ |
25 | xdelta3-64 \ | 36 | xdelta3-64 \ |
26 | xdelta3-everything \ | 37 | xdelta3-everything \ |
@@ -29,7 +40,7 @@ TARGETS = xdelta3-debug \ | |||
29 | xdelta3-Op \ | 40 | xdelta3-Op \ |
30 | xdelta3-decoder xdelta3-decoder-nomain.o \ | 41 | xdelta3-decoder xdelta3-decoder-nomain.o \ |
31 | xdelta3-nosec.o xdelta3-all.o xdelta3-fgk.o \ | 42 | xdelta3-nosec.o xdelta3-all.o xdelta3-fgk.o \ |
32 | xdelta3-noext xdelta3-tools xdelta3-tune \ | 43 | xdelta3-noext xdelta3-tools \ |
33 | xdelta3-notools \ | 44 | xdelta3-notools \ |
34 | xdelta3_wrap.c xdelta3.py \ | 45 | xdelta3_wrap.c xdelta3.py \ |
35 | $(PYTGT) $(SWIGTGT) | 46 | $(PYTGT) $(SWIGTGT) |
@@ -38,11 +49,12 @@ PYTHON = python | |||
38 | 49 | ||
39 | WIXDIR = "/cygdrive/c/Program Files/wix2.0.4820" | 50 | WIXDIR = "/cygdrive/c/Program Files/wix2.0.4820" |
40 | 51 | ||
41 | #SWIGTGT = xdelta3module.so | 52 | CFLAGS= -Wall -Wshadow -fno-builtin |
42 | SWIGTGT = xdelta3module.dll | ||
43 | 53 | ||
44 | #PYTGT = build/lib.linux-i686-2.4/xdelta3main.so | 54 | # $Format: "REL=$Xdelta3Version$" $ |
45 | PYTGT = build/lib.cygwin-1.5.24-i686-2.4/xdelta3main.dll | 55 | REL=3.0t |
56 | |||
57 | RELDIR = xdelta$(REL) | ||
46 | 58 | ||
47 | EXTRA = Makefile COPYING linkxd3lib.c badcopy.c xdelta3.swig \ | 59 | EXTRA = Makefile COPYING linkxd3lib.c badcopy.c xdelta3.swig \ |
48 | draft-korn-vcdiff.txt xdelta3.vcproj badcopy.vcproj \ | 60 | draft-korn-vcdiff.txt xdelta3.vcproj badcopy.vcproj \ |
@@ -62,10 +74,6 @@ SWIG_FLAGS = -DXD3_DEBUG=0 \ | |||
62 | -DVCDIFF_TOOLS=1 \ | 74 | -DVCDIFF_TOOLS=1 \ |
63 | -DSWIG_MODULE=1 | 75 | -DSWIG_MODULE=1 |
64 | 76 | ||
65 | # $Format: "REL=$Xdelta3Version$" $ | ||
66 | REL=3.0t_pre0 | ||
67 | RELDIR = xdelta$(REL) | ||
68 | |||
69 | all: xdelta3-debug xdelta3 | 77 | all: xdelta3-debug xdelta3 |
70 | 78 | ||
71 | all-py: all $(PYTGT) $(SWIGTGT) | 79 | all-py: all $(PYTGT) $(SWIGTGT) |
@@ -108,7 +116,7 @@ wix: xdelta3.wxs xdelta3.wxi readme.txt Release\xdelta3.exe | |||
108 | $(WIXDIR)/light.exe xdelta3.wixobj -out xdelta3.msi | 116 | $(WIXDIR)/light.exe xdelta3.wixobj -out xdelta3.msi |
109 | 117 | ||
110 | xdelta3: $(SOURCES) | 118 | xdelta3: $(SOURCES) |
111 | $(CC) -O3 -Wall -Wshadow -fno-builtin xdelta3.c -lm -o xdelta3 \ | 119 | $(CC) $(CFLAGS) -O3 xdelta3.c -lm -o xdelta3 \ |
112 | -DGENERIC_ENCODE_TABLES=0 \ | 120 | -DGENERIC_ENCODE_TABLES=0 \ |
113 | -DREGRESSION_TEST=1 \ | 121 | -DREGRESSION_TEST=1 \ |
114 | -DSECONDARY_DJW=1 \ | 122 | -DSECONDARY_DJW=1 \ |
@@ -120,7 +128,7 @@ xdelta3: $(SOURCES) | |||
120 | -DXD3_USE_LARGEFILE64=1 | 128 | -DXD3_USE_LARGEFILE64=1 |
121 | 129 | ||
122 | xdelta3-debug: $(SOURCES) | 130 | xdelta3-debug: $(SOURCES) |
123 | $(CC) -g -Wall -Wshadow -fno-builtin xdelta3.c -lm -o xdelta3-debug \ | 131 | $(CC) -g $(CFLAGS) xdelta3.c -lm -o xdelta3-debug \ |
124 | -DGENERIC_ENCODE_TABLES=1 \ | 132 | -DGENERIC_ENCODE_TABLES=1 \ |
125 | -DREGRESSION_TEST=1 \ | 133 | -DREGRESSION_TEST=1 \ |
126 | -DSECONDARY_DJW=1 \ | 134 | -DSECONDARY_DJW=1 \ |
@@ -132,7 +140,7 @@ xdelta3-debug: $(SOURCES) | |||
132 | -DXD3_USE_LARGEFILE64=1 | 140 | -DXD3_USE_LARGEFILE64=1 |
133 | 141 | ||
134 | xdelta3-32: $(SOURCES) | 142 | xdelta3-32: $(SOURCES) |
135 | $(CC) -O3 -Wall -Wshadow -fno-builtin xdelta3.c -lm -o xdelta3-32 \ | 143 | $(CC) -O3 $(CFLAGS) xdelta3.c -lm -o xdelta3-32 \ |
136 | -DXD3_DEBUG=1 \ | 144 | -DXD3_DEBUG=1 \ |
137 | -DXD3_USE_LARGEFILE64=0 \ | 145 | -DXD3_USE_LARGEFILE64=0 \ |
138 | -DREGRESSION_TEST=1 \ | 146 | -DREGRESSION_TEST=1 \ |
@@ -142,7 +150,7 @@ xdelta3-32: $(SOURCES) | |||
142 | -DXD3_POSIX=1 | 150 | -DXD3_POSIX=1 |
143 | 151 | ||
144 | xdelta3-debug2: $(SOURCES) | 152 | xdelta3-debug2: $(SOURCES) |
145 | $(CC) -g -Wall -Wshadow \ | 153 | $(CC) -g $(CFLAGS) \ |
146 | xdelta3.c -o xdelta3-debug2 \ | 154 | xdelta3.c -o xdelta3-debug2 \ |
147 | -DXD3_DEBUG=2 \ | 155 | -DXD3_DEBUG=2 \ |
148 | -DXD3_MAIN=1 \ | 156 | -DXD3_MAIN=1 \ |
@@ -155,8 +163,16 @@ xdelta3-debug2: $(SOURCES) | |||
155 | -lm | 163 | -lm |
156 | 164 | ||
157 | xdelta3-debug3: $(SOURCES) | 165 | xdelta3-debug3: $(SOURCES) |
158 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-debug3 -DXD3_MAIN=1 -DGENERIC_ENCODE_TABLES=1 \ | 166 | $(CC) -g $(CFLAGS) xdelta3.c -o xdelta3-debug3 \ |
159 | -DXD3_USE_LARGEFILE64=1 -DXD3_STDIO=1 -DREGRESSION_TEST=1 -DXD3_DEBUG=3 -DSECONDARY_DJW=1 -DSECONDARY_FGK=1 -lm | 167 | -DXD3_MAIN=1 \ |
168 | -DGENERIC_ENCODE_TABLES=1 \ | ||
169 | -DXD3_USE_LARGEFILE64=1 \ | ||
170 | -DXD3_STDIO=1 \ | ||
171 | -DREGRESSION_TEST=1 \ | ||
172 | -DXD3_DEBUG=3 \ | ||
173 | -DSECONDARY_DJW=1 \ | ||
174 | -DSECONDARY_FGK=1 \ | ||
175 | -lm | ||
160 | 176 | ||
161 | $(PYTGT): $(SOURCES) setup.py | 177 | $(PYTGT): $(SOURCES) setup.py |
162 | $(PYTHON) setup.py install --verbose --compile --force | 178 | $(PYTHON) setup.py install --verbose --compile --force |
@@ -165,61 +181,99 @@ xdelta3_wrap.c xdelta3.py: xdelta3.swig | |||
165 | swig -python xdelta3.swig | 181 | swig -python xdelta3.swig |
166 | 182 | ||
167 | xdelta3.o: $(SOURCES) | 183 | xdelta3.o: $(SOURCES) |
168 | $(CC) -O3 -Wall -Wshadow -fno-builtin -c xdelta3.c $(SWIG_FLAGS) -o xdelta3.o | 184 | $(CC) -O3 $(CFLAGS) -c xdelta3.c $(SWIG_FLAGS) -o xdelta3.o |
169 | 185 | ||
170 | xdelta3_wrap.o: xdelta3_wrap.c | 186 | xdelta3_wrap.o: xdelta3_wrap.c |
171 | $(CC) $(SWIG_FLAGS) \ | 187 | $(CC) -O3 $(CFLAGS) $(SWIG_FLAGS) \ |
172 | -DHAVE_CONFIG_H \ | 188 | -DHAVE_CONFIG_H \ |
173 | -I/usr/include/python2.5 \ | 189 | -I/usr/include/python$(PYVER) \ |
174 | -I/usr/lib/python2.5/config \ | 190 | -I/usr/lib/python$(PYVER)/config \ |
175 | -fpic \ | 191 | -fpic \ |
176 | -c -O3 -fno-builtin xdelta3_wrap.c | 192 | -c xdelta3_wrap.c |
177 | 193 | ||
178 | xdelta3module.dll: xdelta3_wrap.o xdelta3.o | 194 | xdelta3module.dll: xdelta3_wrap.o xdelta3.o |
179 | gcc -shared -Wl,--enable-auto-image-base xdelta3.o xdelta3_wrap.o -L/usr/lib/python2.5/config -lpython2.5 -o xdelta3module.dll | 195 | gcc -shared -Wl,--enable-auto-image-base \ |
180 | cp $(SWIGTGT) /usr/lib/python2.5/site-packages | 196 | xdelta3.o \ |
197 | xdelta3_wrap.o \ | ||
198 | -L/usr/lib/python$(PYVER)/config \ | ||
199 | -lpython$(PYVER) \ | ||
200 | -o xdelta3module.dll | ||
201 | cp $(SWIGTGT) /usr/lib/python$(PYVER)/site-packages | ||
181 | 202 | ||
182 | xdelta3module.so: xdelta3_wrap.o xdelta3.o | 203 | xdelta3module.so: xdelta3_wrap.o xdelta3.o |
183 | ld -shared xdelta3.o xdelta3_wrap.o -o xdelta3module.so /usr/lib/libpython2.4.so -lgcc_s -lc | 204 | ld -shared xdelta3.o xdelta3_wrap.o \ |
205 | -o xdelta3module.so \ | ||
206 | /usr/lib/libpython$(PYVER).so \ | ||
207 | -lc | ||
184 | 208 | ||
185 | xdelta3-decoder: $(SOURCES) | 209 | xdelta3-decoder: $(SOURCES) |
186 | $(CC) -O2 -Wall -Wshadow xdelta3.c \ | 210 | $(CC) -O3 -Wall -Wshadow xdelta3.c \ |
187 | -DXD3_ENCODER=0 -DXD3_MAIN=1 -DSECONDARY_FGK=0 -DSECONDARY_DJW=0 \ | 211 | -DXD3_ENCODER=0 -DXD3_MAIN=1 -DSECONDARY_FGK=0 -DSECONDARY_DJW=0 \ |
188 | -DXD3_STDIO=1 -DEXTERNAL_COMPRESSION=0 -DVCDIFF_TOOLS=0 \ | 212 | -DXD3_STDIO=1 -DEXTERNAL_COMPRESSION=0 -DVCDIFF_TOOLS=0 \ |
189 | -o xdelta3-decoder | 213 | -o xdelta3-decoder |
190 | 214 | ||
191 | xdelta3-decoder-nomain.o: $(SOURCES) linkxd3lib.c | 215 | xdelta3-decoder-nomain.o: $(SOURCES) linkxd3lib.c |
192 | $(CC) -O2 -Wall -Wshadow xdelta3.c linkxd3lib.c \ | 216 | $(CC) -O3 -Wall -Wshadow xdelta3.c linkxd3lib.c \ |
193 | -DXD3_ENCODER=0 -DSECONDARY_FGK=0 -DSECONDARY_DJW=0 \ | 217 | -DXD3_ENCODER=0 -DSECONDARY_FGK=0 -DSECONDARY_DJW=0 \ |
194 | -o xdelta3-decoder-nomain.o | 218 | -o xdelta3-decoder-nomain.o |
195 | strip xdelta3-decoder-nomain.o | 219 | strip xdelta3-decoder-nomain.o |
196 | 220 | ||
197 | xdelta3-O++: $(SOURCES) | 221 | xdelta3-O++: $(SOURCES) |
198 | $(CXX) -g -O2 -Wall -Wshadow xdelta3.c -o xdelta3-O++ -DXD3_MAIN=1 -DSECONDARY_DJW=1 -DREGRESSION_TEST=1 -lm | 222 | $(CXX) -g -O3 $(CFLAGS) xdelta3.c \ |
223 | -o xdelta3-O++ \ | ||
224 | -DXD3_MAIN=1 \ | ||
225 | -DSECONDARY_DJW=1 \ | ||
226 | -DREGRESSION_TEST=1 \ | ||
227 | -lm | ||
199 | 228 | ||
200 | xdelta3-Op: $(SOURCES) | 229 | xdelta3-Op: $(SOURCES) |
201 | $(CC) -g -O2 -Wall -Wshadow xdelta3.c -o xdelta3-Op -DXD3_POSIX=1 -DXD3_MAIN=1 -DREGRESSION_TEST=1 -lm | 230 | $(CC) -g -O3 $(CFLAGS) xdelta3.c \ |
231 | -o xdelta3-Op \ | ||
232 | -DXD3_POSIX=1 \ | ||
233 | -DXD3_MAIN=1 \ | ||
234 | -DREGRESSION_TEST=1 \ | ||
235 | -lm | ||
202 | 236 | ||
203 | xdelta3-64: $(SOURCES) | 237 | xdelta3-64: $(SOURCES) |
204 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-64 -DXD3_POSIX=1 -DXD3_MAIN=1 -DREGRESSION_TEST=1 \ | 238 | $(CC) -g $(CFLAGS) \ |
205 | -DXD3_DEBUG=0 -DXD3_USE_LARGEFILE64=1 -lm | 239 | xdelta3.c \ |
240 | -o xdelta3-64 \ | ||
241 | -DXD3_POSIX=1 \ | ||
242 | -DXD3_MAIN=1 \ | ||
243 | -DREGRESSION_TEST=1 \ | ||
244 | -DXD3_DEBUG=0 \ | ||
245 | -DXD3_USE_LARGEFILE64=1 \ | ||
246 | -lm | ||
206 | 247 | ||
207 | xdelta3-64-O: $(SOURCES) | 248 | xdelta3-64-O: $(SOURCES) |
208 | $(CC) -O2 -Wall -Wshadow xdelta3.c -o xdelta3-64-O -DXD3_POSIX=1 -DXD3_MAIN=1 \ | 249 | $(CC) -O3 $(CFLAGS) \ |
209 | -DXD3_USE_LARGEFILE64=1 -lm | 250 | xdelta3.c \ |
251 | -o xdelta3-64-O \ | ||
252 | -DXD3_POSIX=1 \ | ||
253 | -DXD3_MAIN=1 \ | ||
254 | -DXD3_USE_LARGEFILE64=1 \ | ||
255 | -lm | ||
210 | 256 | ||
211 | xdelta3-everything: $(SOURCES) | 257 | xdelta3-everything: $(SOURCES) |
212 | $(CC) -g -Wall -Wshadow xdelta3.c -o xdelta3-everything \ | 258 | $(CC) -g $(CFLAGS) \ |
213 | -DXD3_MAIN=1 -DVCDIFF_TOOLS=1 -DREGRESSION_TEST=1 \ | 259 | xdelta3.c \ |
214 | -DSECONDARY_FGK=1 -DSECONDARY_DJW=1 \ | 260 | -o xdelta3-everything \ |
215 | -DGENERIC_ENCODE_TABLES=1 \ | 261 | -DXD3_MAIN=1 \ |
216 | -DGENERIC_ENCODE_TABLES_COMPUTE=1 \ | 262 | -DVCDIFF_TOOLS=1 \ |
217 | -DXD3_POSIX=1 \ | 263 | -DREGRESSION_TEST=1 \ |
218 | -DEXTERNAL_COMPRESSION=1 \ | 264 | -DSECONDARY_FGK=1 \ |
219 | -DXD3_DEBUG=1 -lm | 265 | -DSECONDARY_DJW=1 \ |
266 | -DGENERIC_ENCODE_TABLES=1 \ | ||
267 | -DGENERIC_ENCODE_TABLES_COMPUTE=1 \ | ||
268 | -DXD3_POSIX=1 \ | ||
269 | -DEXTERNAL_COMPRESSION=1 \ | ||
270 | -DXD3_DEBUG=1 \ | ||
271 | -lm | ||
220 | 272 | ||
221 | xdelta3-Opg: $(SOURCES) | 273 | xdelta3-Opg: $(SOURCES) |
222 | $(CC) -pg -g -O3 -fno-builtin -Wall -Wshadow xdelta3.c -o xdelta3-Opg \ | 274 | $(CC) -pg -g -O3 $(CFLAGS) \ |
275 | xdelta3.c \ | ||
276 | -o xdelta3-Opg \ | ||
223 | -DXD3_MAIN=1 \ | 277 | -DXD3_MAIN=1 \ |
224 | -DSECONDARY_DJW=1 \ | 278 | -DSECONDARY_DJW=1 \ |
225 | -DSECONDARY_FGK=1 \ | 279 | -DSECONDARY_FGK=1 \ |
@@ -228,19 +282,19 @@ xdelta3-Opg: $(SOURCES) | |||
228 | -DREGRESSION_TEST=1 | 282 | -DREGRESSION_TEST=1 |
229 | 283 | ||
230 | xdelta3-nosec.o: $(SOURCES) | 284 | xdelta3-nosec.o: $(SOURCES) |
231 | $(CC) -O2 -Wall -Wshadow -c xdelta3.c -DSECONDARY_FGK=0 -DSECONDARY_DJW=0 -o xdelta3-nosec.o | 285 | $(CC) -O3 $(CFLAGS) -c xdelta3.c -DSECONDARY_FGK=0 -DSECONDARY_DJW=0 -o xdelta3-nosec.o |
232 | 286 | ||
233 | xdelta3-all.o: $(SOURCES) | 287 | xdelta3-all.o: $(SOURCES) |
234 | $(CC) -O2 -Wall -Wshadow -c xdelta3.c -DSECONDARY_FGK=1 -DSECONDARY_DJW=1 -o xdelta3-all.o | 288 | $(CC) -O3 $(CFLAGS) -c xdelta3.c -DSECONDARY_FGK=1 -DSECONDARY_DJW=1 -o xdelta3-all.o |
235 | 289 | ||
236 | xdelta3-fgk.o: $(SOURCES) | 290 | xdelta3-fgk.o: $(SOURCES) |
237 | $(CC) -O2 -Wall -Wshadow -c xdelta3.c -DSECONDARY_FGK=1 -DSECONDARY_DJW=0 -o xdelta3-fgk.o | 291 | $(CC) -O3 $(CFLAGS) -c xdelta3.c -DSECONDARY_FGK=1 -DSECONDARY_DJW=0 -o xdelta3-fgk.o |
238 | 292 | ||
239 | xdelta3-noext: $(SOURCES) | 293 | xdelta3-noext: $(SOURCES) |
240 | $(CC) -O2 -Wall -Wshadow xdelta3.c -DXD3_MAIN=1 -DEXTERNAL_COMPRESSION=0 -o xdelta3-noext | 294 | $(CC) -O3 $(CFLAGS) xdelta3.c -DXD3_MAIN=1 -DEXTERNAL_COMPRESSION=0 -o xdelta3-noext |
241 | 295 | ||
242 | xdelta3-tools: $(SOURCES) | 296 | xdelta3-tools: $(SOURCES) |
243 | $(CC) -O2 -Wall -Wshadow xdelta3.c -DXD3_MAIN=1 -o xdelta3-tools | 297 | $(CC) -O3 $(CFLAGS) xdelta3.c -DXD3_MAIN=1 -o xdelta3-tools |
244 | 298 | ||
245 | xdelta3-notools: $(SOURCES) | 299 | xdelta3-notools: $(SOURCES) |
246 | $(CC) -O2 -Wall -Wshadow xdelta3.c -DXD3_MAIN=1 -DVCDIFF_TOOLS=0 -o xdelta3-notools | 300 | $(CC) -O3 $(CFLAGS) xdelta3.c -DXD3_MAIN=1 -DVCDIFF_TOOLS=0 -o xdelta3-notools |