~ubuntu-branches/ubuntu/natty/zlib/natty

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 18:06:51 UTC
  • mfrom: (1.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20100517180651-i83cowr4hqrdalo3
Tags: 1:1.2.3.4.dfsg-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - zlib.h: add z_off64_t and ensure that its mapped to the correct
    off_t or off64_t (fixes FTBFS in vips, gtk)
  - drop Conflicts on libc6-i386 (<= 2.9-18) because we do not have
    to do a /emul/ia32-linux -> /usr/lib32 transition

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
# To compile and test, type:
6
6
#    ./configure; make test
7
 
# The call of configure is optional if you don't have special requirements
8
 
# If you wish to build zlib as a shared library, use: ./configure -s
 
7
# Normally configure builds both a static and a shared library.
 
8
# If you want to build just a static library, use: ./configure --static
9
9
 
10
10
# To use the asm code, type:
11
11
#    cp contrib/asm?86/match.S ./match.S
26
26
 
27
27
SFLAGS=-O
28
28
 
29
 
LDFLAGS=libz.a
 
29
LDFLAGS=-L. libz.a
30
30
LDSHARED=$(CC)
31
31
CPP=$(CC) -E
32
32
 
33
 
LIBS=libz.a
 
33
STATICLIB=libz.a
34
34
SHAREDLIB=libz.so
35
 
SHAREDLIBV=libz.so.1.2.3.3
 
35
SHAREDLIBV=libz.so.1.2.3.4
36
36
SHAREDLIBM=libz.so.1
 
37
LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
37
38
 
38
 
AR=ar
 
39
AR=ar rc
39
40
RANLIB=ranlib
40
41
TAR=tar
41
42
SHELL=/bin/sh
52
53
OBJC = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
53
54
       zutil.o inflate.o infback.o inftrees.o inffast.o
54
55
 
 
56
PIC_OBJC = adler32.lo compress.lo crc32.lo gzio.lo uncompr.lo deflate.lo trees.lo \
 
57
       zutil.lo inflate.lo infback.lo inftrees.lo inffast.lo
 
58
 
 
59
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
55
60
OBJA =
56
 
# to use the asm code: make OBJA=match.o
 
61
PIC_OBJA =
57
62
 
58
63
OBJS = $(OBJC) $(OBJA)
59
64
 
60
 
PIC_OBJS = $(OBJS:%.o=%.lo)
61
 
 
62
 
TEST_OBJS = example.o minigzip.o
63
 
 
64
 
allstatic: example$(EXE) minigzip$(EXE)
65
 
 
66
 
allshared: examplesh$(EXE) minigzipsh$(EXE)
67
 
 
68
 
all: allstatic allshared
69
 
 
70
 
teststatic: allstatic
 
65
PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
 
66
 
 
67
all: static shared
 
68
 
 
69
static: example$(EXE) minigzip$(EXE)
 
70
 
 
71
shared: examplesh$(EXE) minigzipsh$(EXE)
 
72
 
 
73
all64: example64$(EXE) minigzip64$(EXE)
 
74
 
 
75
check: test
 
76
 
 
77
test: all teststatic testshared
 
78
 
 
79
teststatic: static
71
80
        @echo hello world | ./minigzip | ./minigzip -d || \
72
81
          echo '                *** minigzip test FAILED ***' ; \
73
82
        if ./example; then \
76
85
          echo '                *** zlib test FAILED ***'; \
77
86
        fi
78
87
 
79
 
testshared: allshared
 
88
testshared: shared
80
89
        @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
 
90
        LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
81
91
        DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
82
92
        SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
83
93
        echo hello world | ./minigzipsh | ./minigzipsh -d || \
88
98
          echo '                *** zlib shared test FAILED ***'; \
89
99
        fi
90
100
 
91
 
test: teststatic testshared
92
 
 
93
 
check: test
 
101
test64: all64
 
102
        @echo hello world | ./minigzip64 | ./minigzip64 -d || \
 
103
          echo '                *** minigzip 64-bit test FAILED ***' ; \
 
104
        if ./example64; then \
 
105
          echo '                *** zlib 64-bit test OK ***'; \
 
106
        else \
 
107
          echo '                *** zlib 64-bit test FAILED ***'; \
 
108
        fi
94
109
 
95
110
libz.a: $(OBJS)
96
111
        $(AR) $@ $(OBJS)
108
123
        mv _match.o match.lo
109
124
        rm -f _match.s
110
125
 
111
 
%.lo: %.c
112
 
        $(CC) $(SFLAGS) -DPIC -c $< -o $@
 
126
example64.o: example.c zlib.h zconf.h zlibdefs.h
 
127
        $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
 
128
 
 
129
minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h
 
130
        $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
 
131
 
 
132
.SUFFIXES: .lo
 
133
 
 
134
.c.lo:
 
135
        -@if [ ! -d objs ]; then mkdir objs; fi
 
136
        $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
 
137
        -@mv objs/$*.o $@
113
138
 
114
139
$(SHAREDLIBV): $(PIC_OBJS)
115
 
        $(LDSHARED) -o $@ $(PIC_OBJS) -lc
 
140
        $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc
116
141
        rm -f $(SHAREDLIB) $(SHAREDLIBM)
117
142
        ln -s $@ $(SHAREDLIB)
118
143
        ln -s $@ $(SHAREDLIBM)
 
144
        -@rmdir objs
119
145
 
120
 
example$(EXE): example.o $(LIBS)
 
146
example$(EXE): example.o $(STATICLIB)
121
147
        $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
122
148
 
123
 
minigzip$(EXE): minigzip.o $(LIBS)
 
149
minigzip$(EXE): minigzip.o $(STATICLIB)
124
150
        $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
125
151
 
126
 
examplesh$(EXE): example.o $(LIBS)
127
 
        $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIB)
128
 
 
129
 
minigzipsh$(EXE): minigzip.o $(LIBS)
130
 
        $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIB)
 
152
examplesh$(EXE): example.o $(SHAREDLIBV)
 
153
        $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
 
154
 
 
155
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
 
156
        $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
 
157
 
 
158
example64$(EXE): example64.o $(STATICLIB)
 
159
        $(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS)
 
160
 
 
161
minigzip64$(EXE): minigzip64.o $(STATICLIB)
 
162
        $(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS)
131
163
 
132
164
install-libs: $(LIBS)
133
165
        -@if [ ! -d $(DESTDIR)$(exec_prefix)  ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
168
200
clean:
169
201
        rm -f *.o *.lo *~ \
170
202
           example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
 
203
           example64$(EXE) minigzip64$(EXE) \
171
204
           libz.* foo.gz so_locations \
172
205
           _match.s maketree contrib/infback9/*.o
 
206
        rm -rf objs
173
207
 
174
208
maintainer-clean: distclean
175
209
distclean: clean
186
220
 
187
221
# DO NOT DELETE THIS LINE -- make depend depends on it.
188
222
 
189
 
adler32.o: zlib.h zconf.h zlibdefs.h
190
 
compress.o: zlib.h zconf.h zlibdefs.h
191
 
crc32.o: crc32.h zlib.h zconf.h zlibdefs.h
 
223
adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
 
224
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
 
225
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
192
226
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
193
 
example.o: zlib.h zconf.h zlibdefs.h
194
 
gzio.o: zutil.h zlib.h zconf.h zlibdefs.h
 
227
infback.o inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
195
228
inffast.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
196
 
inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
197
 
infback.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
198
229
inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
199
 
minigzip.o: zlib.h zconf.h zlibdefs.h
200
230
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
201
 
uncompr.o: zlib.h zconf.h zlibdefs.h
202
 
zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
203
231
 
204
 
adler32.lo: zlib.h zconf.h zlibdefs.h
205
 
compress.lo: zlib.h zconf.h zlibdefs.h
206
 
crc32.lo: crc32.h zlib.h zconf.h zlibdefs.h
 
232
adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
 
233
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
 
234
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
207
235
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
208
 
gzio.lo: zutil.h zlib.h zconf.h zlibdefs.h
 
236
infback.lo inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
209
237
inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
210
 
inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
211
 
infback.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
212
238
inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
213
239
trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
214
 
uncompr.lo: zlib.h zconf.h zlibdefs.h
215
 
zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h