aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2015-08-02 14:46:58 -0700
committerMark Adler <madler@alumni.caltech.edu>2015-08-02 21:35:50 -0700
commit55d98b4c302c74b619968bd02cf3b5e18d845977 (patch)
treeffdbc1f067646102925b013ebd52ab058b03aa44 /Makefile.in
parentbfcace04f91bd27c8c7c040da2396fe4b7724422 (diff)
downloadzlib-55d98b4c302c74b619968bd02cf3b5e18d845977.tar.gz
zlib-55d98b4c302c74b619968bd02cf3b5e18d845977.tar.bz2
zlib-55d98b4c302c74b619968bd02cf3b5e18d845977.zip
Allow building zlib outside of the source directory.
To build, simply run configure from the source directory by specifying its path. That path will be used to find the source files. The source directory will not be touched. All new and modified files will be made in the current directory. Discovered in the process that not all makes understand % or $<, and not all compilers understand -include or -I-. This required a larger Makefile.in with explicit dependencies.
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in221
1 files changed, 169 insertions, 52 deletions
diff --git a/Makefile.in b/Makefile.in
index f608c6c..7408644 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53,6 +53,9 @@ includedir = ${prefix}/include
53mandir = ${prefix}/share/man 53mandir = ${prefix}/share/man
54man3dir = ${mandir}/man3 54man3dir = ${mandir}/man3
55pkgconfigdir = ${libdir}/pkgconfig 55pkgconfigdir = ${libdir}/pkgconfig
56SRCDIR=
57ZINC=
58ZINCOUT=-I.
56 59
57OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o 60OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
58OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o 61OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
@@ -113,8 +116,8 @@ test64: all64
113 fi; \ 116 fi; \
114 rm -f $$TMP64 117 rm -f $$TMP64
115 118
116infcover.o: test/infcover.c zlib.h zconf.h 119infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
117 $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c 120 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
118 121
119infcover: infcover.o libz.a 122infcover: infcover.o libz.a
120 $(CC) $(CFLAGS) -o $@ infcover.o libz.a 123 $(CC) $(CFLAGS) -o $@ infcover.o libz.a
@@ -140,24 +143,140 @@ match.lo: match.S
140 mv _match.o match.lo 143 mv _match.o match.lo
141 rm -f _match.s 144 rm -f _match.s
142 145
143example.o: test/example.c zlib.h zconf.h 146example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
144 $(CC) $(CFLAGS) -I. -c -o $@ test/example.c 147 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
145 148
146minigzip.o: test/minigzip.c zlib.h zconf.h 149minigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
147 $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c 150 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
148 151
149example64.o: test/example.c zlib.h zconf.h 152example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
150 $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c 153 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
151 154
152minigzip64.o: test/minigzip.c zlib.h zconf.h 155minigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
153 $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c 156 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
154 157
155.SUFFIXES: .lo
156 158
157.c.lo: 159adler32.o: $(SRCDIR)adler32.c
160 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
161
162crc32.o: $(SRCDIR)crc32.c
163 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
164
165deflate.o: $(SRCDIR)deflate.c
166 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
167
168infback.o: $(SRCDIR)infback.c
169 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
170
171inffast.o: $(SRCDIR)inffast.c
172 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
173
174inflate.o: $(SRCDIR)inflate.c
175 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
176
177inftrees.o: $(SRCDIR)inftrees.c
178 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
179
180trees.o: $(SRCDIR)trees.c
181 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
182
183zutil.o: $(SRCDIR)zutil.c
184 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
185
186compress.o: $(SRCDIR)compress.c
187 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
188
189uncompr.o: $(SRCDIR)uncompr.c
190 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
191
192gzclose.o: $(SRCDIR)gzclose.c
193 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
194
195gzlib.o: $(SRCDIR)gzlib.c
196 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
197
198gzread.o: $(SRCDIR)gzread.c
199 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
200
201gzwrite.o: $(SRCDIR)gzwrite.c
202 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
203
204
205adler32.lo: $(SRCDIR)adler32.c
206 -@mkdir objs 2>/dev/null || test -d objs
207 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
208 -@mv objs/adler32.o $@
209
210crc32.lo: $(SRCDIR)crc32.c
158 -@mkdir objs 2>/dev/null || test -d objs 211 -@mkdir objs 2>/dev/null || test -d objs
159 $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $< 212 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
160 -@mv objs/$*.o $@ 213 -@mv objs/crc32.o $@
214
215deflate.lo: $(SRCDIR)deflate.c
216 -@mkdir objs 2>/dev/null || test -d objs
217 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
218 -@mv objs/deflate.o $@
219
220infback.lo: $(SRCDIR)infback.c
221 -@mkdir objs 2>/dev/null || test -d objs
222 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
223 -@mv objs/infback.o $@
224
225inffast.lo: $(SRCDIR)inffast.c
226 -@mkdir objs 2>/dev/null || test -d objs
227 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
228 -@mv objs/inffast.o $@
229
230inflate.lo: $(SRCDIR)inflate.c
231 -@mkdir objs 2>/dev/null || test -d objs
232 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
233 -@mv objs/inflate.o $@
234
235inftrees.lo: $(SRCDIR)inftrees.c
236 -@mkdir objs 2>/dev/null || test -d objs
237 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
238 -@mv objs/inftrees.o $@
239
240trees.lo: $(SRCDIR)trees.c
241 -@mkdir objs 2>/dev/null || test -d objs
242 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
243 -@mv objs/trees.o $@
244
245zutil.lo: $(SRCDIR)zutil.c
246 -@mkdir objs 2>/dev/null || test -d objs
247 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
248 -@mv objs/zutil.o $@
249
250compress.lo: $(SRCDIR)compress.c
251 -@mkdir objs 2>/dev/null || test -d objs
252 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
253 -@mv objs/compress.o $@
254
255uncompr.lo: $(SRCDIR)uncompr.c
256 -@mkdir objs 2>/dev/null || test -d objs
257 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
258 -@mv objs/uncompr.o $@
259
260gzclose.lo: $(SRCDIR)gzclose.c
261 -@mkdir objs 2>/dev/null || test -d objs
262 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
263 -@mv objs/gzclose.o $@
264
265gzlib.lo: $(SRCDIR)gzlib.c
266 -@mkdir objs 2>/dev/null || test -d objs
267 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
268 -@mv objs/gzlib.o $@
269
270gzread.lo: $(SRCDIR)gzread.c
271 -@mkdir objs 2>/dev/null || test -d objs
272 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
273 -@mv objs/gzread.o $@
274
275gzwrite.lo: $(SRCDIR)gzwrite.c
276 -@mkdir objs 2>/dev/null || test -d objs
277 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
278 -@mv objs/gzwrite.o $@
279
161 280
162placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a 281placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
163 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS) 282 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
@@ -203,7 +322,7 @@ install-libs: $(LIBS)
203 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ 322 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
204 ($(LDCONFIG) || true) >/dev/null 2>&1; \ 323 ($(LDCONFIG) || true) >/dev/null 2>&1; \
205 fi 324 fi
206 cp zlib.3 $(DESTDIR)$(man3dir) 325 cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
207 chmod 644 $(DESTDIR)$(man3dir)/zlib.3 326 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
208 cp zlib.pc $(DESTDIR)$(pkgconfigdir) 327 cp zlib.pc $(DESTDIR)$(pkgconfigdir)
209 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc 328 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
@@ -212,7 +331,7 @@ install-libs: $(LIBS)
212 331
213install: install-libs 332install: install-libs
214 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi 333 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
215 cp zlib.h zconf.h $(DESTDIR)$(includedir) 334 cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
216 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h 335 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
217 336
218uninstall: 337uninstall:
@@ -226,18 +345,18 @@ uninstall:
226 345
227docs: zlib.3.pdf 346docs: zlib.3.pdf
228 347
229zlib.3.pdf: zlib.3 348zlib.3.pdf: $(SRCDIR)zlib.3
230 groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf 349 groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
231 350
232zconf.h.cmakein: zconf.h.in 351zconf.h.cmakein: $(SRCDIR)zconf.h.in
233 -@ TEMPFILE=zconfh_$$; \ 352 -@ TEMPFILE=zconfh_$$; \
234 echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\ 353 echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
235 sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\ 354 sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
236 touch -r zconf.h.in zconf.h.cmakein &&\ 355 touch -r $(SRCDIR)zconf.h.in $@ &&\
237 rm $$TEMPFILE 356 rm $$TEMPFILE
238 357
239zconf: zconf.h.in 358zconf: $(SRCDIR)zconf.h.in
240 cp -p zconf.h.in zconf.h 359 cp -p $(SRCDIR)zconf.h.in zconf.h
241 360
242mostlyclean: clean 361mostlyclean: clean
243clean: 362clean:
@@ -255,34 +374,32 @@ maintainer-clean: distclean
255distclean: clean zconf zconf.h.cmakein docs 374distclean: clean zconf zconf.h.cmakein docs
256 rm -f Makefile zlib.pc configure.log 375 rm -f Makefile zlib.pc configure.log
257 -@rm -f .DS_Store 376 -@rm -f .DS_Store
258 -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile 377 @if [ -f Makefile.in ]; then \
259 -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile 378 printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
260 -@touch -r Makefile.in Makefile 379 printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
380 touch -r $(SRCDIR)Makefile.in Makefile ; fi
381 @if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
382 @if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
261 383
262tags: 384tags:
263 etags *.[ch] 385 etags $(SRCDIR)*.[ch]
264 386
265depend: 387adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
266 makedepend -- $(CFLAGS) -- *.[ch] 388gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
267 389compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
268# DO NOT DELETE THIS LINE -- make depend depends on it. 390crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
269 391deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
270adler32.o zutil.o: zutil.h zlib.h zconf.h 392infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
271gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h 393inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
272compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h 394inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
273crc32.o: zutil.h zlib.h zconf.h crc32.h 395trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
274deflate.o: deflate.h zutil.h zlib.h zconf.h 396
275infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h 397adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
276inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 398gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
277inftrees.o: zutil.h zlib.h zconf.h inftrees.h 399compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
278trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 400crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
279 401deflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
280adler32.lo zutil.lo: zutil.h zlib.h zconf.h 402infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
281gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h 403inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
282compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h 404inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
283crc32.lo: zutil.h zlib.h zconf.h crc32.h 405trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
284deflate.lo: deflate.h zutil.h zlib.h zconf.h
285infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
286inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
287inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
288trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h