1 # $NetBSD: Makefile.inc,v 1.15 2015/09/06 15:34:55 uebayasi 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
24 ZDIR= ${S:S@^.@${ZDOTDIR}@:Q}/lib/libz
25 .if (${Z_AS} == "obj")
27 ZLIB_PROF= ${ZDST}/libz.po
30 ZLIB_PROF= ${ZDST}/libz_p.a
34 cd ${ZDST} && ${MAKE} -f ${ZDIR:Q}/Makefile \
36 CC=${CC:Q} CFLAGS=${CFLAGS:Q} CPUFLAGS= \
37 AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
40 LD=${LD:Q} STRIP=${STRIP:Q} \
41 AR=${AR:Q} NM=${NM:Q} \
42 RANLIB=${RANLIB:Q} SIZE=${SIZE:Q} \
43 MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
44 ZCPPFLAGS=${CPPFLAGS:S@^-I.@-I${ZDOTDIR}@g:Q} \
45 ZMISCCPPFLAGS=${ZMISCCPPFLAGS:Q} \
48 ${ZLIB}: .NOTMAIN .MAKE __always_make_zlib
49 @echo making sure the z library is up to date...
50 .if (${Z_AS} == "library")
57 ${ZLIB_PROF}: .NOTMAIN .MAKE __always_make_zlib
58 @echo making sure the profiled z library is up to date...
59 .if (${Z_AS} == "library")
66 clean: .NOTMAIN cleanzlib
68 @echo cleaning the z library objects
69 @if [ -d "${ZDST}" ]; then ${ZMAKE} clean; fi
72 cleandir distclean: .NOTMAIN cleandirzlib
73 cleandirzlib: .NOTMAIN
74 @echo cleandiring the z library objects
75 @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
84 __always_make_zlib: .NOTMAIN
87 .PHONY: __always_make_zlib
88 .PHONY: cleanzlib cleandirzlib dependzlib