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