1 # $NetBSD: Makefile.inc,v 1.3 1997/02/16 21:25:23 cgd Exp $ 2 # 3 # Configuration variables (default values are below): 4 # 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'. 11 # ZMISCCPPFLAGS 12 # Miscellaneous cpp flags to be passed to the library's Makefile 13 # when building. 14 # ZMISCMAKEFLAGS 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. 18 19 # Default values: 20 ZDST?= ${.OBJDIR}/lib/z 21 Z_AS?= library 22 23 ZDIR= $S/lib/libz 24 .if (${Z_AS} == "obj") 25 ZLIB= ${ZDST}/libz.o 26 ZLIB_PROF= ${ZDST}/libz.po 27 .else 28 ZLIB= ${ZDST}/libz.a 29 ZLIB_PROF= ${ZDST}/libz_p.a 30 .endif 31 32 ZMAKE= \ 33 cd ${ZDIR} && MAKEOBJDIR=${ZDST} ${MAKE} \ 34 CC=${CC:Q} CFLAGS=${CFLAGS:Q} \ 35 AS=${AS:Q} AFLAGS=${AFLAGS:Q} \ 36 LD=${LD:Q} STRIP=${STRIP:Q} \ 37 MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \ 38 ZCPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:Q} \ 39 ZMISCCPPFLAGS=${ZMISCCPPFLAGS:Q} \ 40 ${ZMISCMAKEFLAGS} 41 42 ${ZLIB}: .NOTMAIN __always_make_zlib 43 @echo making sure the z library is up to date... 44 .if (${Z_AS} == "library") 45 @${ZMAKE} libz.a 46 .else 47 @${ZMAKE} libz.o 48 .endif 49 50 ${ZLIB_PROF}: .NOTMAIN __always_make_zlib 51 @echo making sure the profiled z library is up to date... 52 .if (${Z_AS} == "library") 53 @${ZMAKE} libz_p.a 54 .else 55 @${ZMAKE} libz.po 56 .endif 57 58 clean: .NOTMAIN cleanzlib 59 cleanzlib: .NOTMAIN __always_make_zlib 60 @echo cleaning the z library objects 61 @${ZMAKE} clean 62 63 cleandir: .NOTMAIN cleandirzlib 64 cleandirzlib: .NOTMAIN __always_make_zlib 65 @echo cleandiring the z library objects 66 @${ZMAKE} cleandir 67 68 depend: .NOTMAIN dependzlib 69 dependzlib: .NOTMAIN __always_make_zlib 70 @echo depending the z library objects 71 @${ZMAKE} depend 72 73 __always_make_zlib: .NOTMAIN 74 @mkdir -p ${ZDST} 75