1 # $NetBSD: Makefile.inc,v 1.13 2005/12/11 12:24:46 christos Exp $
3 # Configuration variables (default values are below):
5 # S must be set to the top of the 'sys' tree.
6 # ZDST may be set to the location of the directory where library
7 # objects are to be built. Defaults to ${.OBJDIR}/lib/z.
8 # Z_AS may be set to 'obj' to build a object from the library's
9 # object files. (Otherwise, a library will be built.)
10 # Defaults to 'library'.
12 # Miscellaneous cpp flags to be passed to the library's Makefile
15 # Miscellaneous flags to be passed to the library's Makefile when
16 # building. See library's Makefile for more details about
17 # supported flags and their default values.
20 ZDST?= ${.OBJDIR}/lib/z
22 ZDOTDIR?= ../../../../../.
25 ZDIR= ${S:S@^.@${ZDOTDIR}@:Q}/lib/libz
27 ZDIR= ${.CURDIR}/${ZDOTDIR}/lib/libz
29 .if (${Z_AS} == "obj")
31 ZLIB_PROF= ${ZDST}/libz.po
34 ZLIB_PROF= ${ZDST}/libz_p.a
38 cd ${ZDST} && ${MAKE} -f ${ZDIR:Q}/Makefile \
40 CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
41 AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
44 LD=${LD:Q} STRIP=${STRIP:Q} \
45 AR=${AR:Q} NM=${NM:Q} \
46 RANLIB=${RANLIB:Q} SIZE=${SIZE:Q} \
47 MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
48 ZCPPFLAGS=${CPPFLAGS:S@^-I.@-I${ZDOTDIR}@g:Q} \
49 ZMISCCPPFLAGS=${ZMISCCPPFLAGS:Q} \
52 ${ZLIB}: .NOTMAIN .MAKE __always_make_zlib
53 @echo making sure the z library is up to date...
54 .if (${Z_AS} == "library")
60 ${ZLIB_PROF}: .NOTMAIN .MAKE __always_make_zlib
61 @echo making sure the profiled z library is up to date...
62 .if (${Z_AS} == "library")
68 clean: .NOTMAIN cleanzlib
70 @echo cleaning the z library objects
71 @if [ -d "${ZDST}" ]; then ${ZMAKE} clean; fi
73 cleandir distclean: .NOTMAIN cleandirzlib
74 cleandirzlib: .NOTMAIN
75 @echo cleandiring the z library objects
76 @if [ -d "${ZDST}" ]; then ${ZMAKE} cleandir; fi
78 dependall depend: .NOTMAIN dependzlib
79 dependzlib: .NOTMAIN .MAKE __always_make_zlib
80 @echo depending the z library objects
83 __always_make_zlib: .NOTMAIN
86 .PHONY: __always_make_zlib
87 .PHONY: cleanzlib cleandirzlib dependzlib