Home | History | Annotate | Line # | Download | only in libz
      1  1.18    simonb #	$NetBSD: Makefile.inc,v 1.18 2020/09/28 02:44:34 simonb Exp $
      2   1.1       cgd #
      3   1.2       cgd #	Configuration variables (default values are below):
      4   1.2       cgd #
      5   1.2       cgd #	S	must be set to the top of the 'sys' tree.
      6   1.2       cgd #	ZDST	may be set to the location of the directory where library
      7   1.2       cgd #		objects are to be built.  Defaults to ${.OBJDIR}/lib/z.
      8   1.2       cgd #	Z_AS	may be set to 'obj' to build a object from the library's
      9   1.2       cgd #		object files.  (Otherwise, a library will be built.)
     10   1.2       cgd #		Defaults to 'library'.
     11   1.3       cgd #	ZMISCCPPFLAGS
     12   1.3       cgd #		Miscellaneous cpp flags to be passed to the library's Makefile
     13   1.3       cgd #		when building.
     14   1.2       cgd #	ZMISCMAKEFLAGS
     15   1.2       cgd #		Miscellaneous flags to be passed to the library's Makefile when
     16   1.2       cgd #		building.  See library's Makefile for more details about
     17   1.2       cgd #		supported flags and their default values.
     18   1.1       cgd 
     19   1.2       cgd # Default values:
     20   1.1       cgd ZDST?=		${.OBJDIR}/lib/z
     21   1.2       cgd Z_AS?=		library
     22  1.18    simonb ZDOTDIR?=	 ../../.
     23   1.1       cgd 
     24  1.17  christos ZDIR=		${S:S@^.@${ZDOTDIR}@:q}/lib/libz
     25   1.2       cgd .if (${Z_AS} == "obj")
     26   1.2       cgd ZLIB=		${ZDST}/libz.o
     27   1.2       cgd ZLIB_PROF=	${ZDST}/libz.po
     28   1.2       cgd .else
     29   1.1       cgd ZLIB=		${ZDST}/libz.a
     30   1.2       cgd ZLIB_PROF=	${ZDST}/libz_p.a
     31   1.1       cgd .endif
     32   1.1       cgd 
     33   1.1       cgd ZMAKE= \
     34  1.17  christos 	cd ${ZDST} && ${MAKE} -f ${ZDIR:q}/Makefile \
     35  1.17  christos 	    ZDIR=${ZDIR:q} \
     36  1.17  christos 	    CC=${CC:q} CFLAGS=${CFLAGS:q} CPUFLAGS= \
     37  1.17  christos 	    AS=${AS:q} AFLAGS=${AFLAGS:q} \
     38  1.17  christos 	    LORDER=${LORDER:q} \
     39  1.17  christos 	    TSORT=${TSORT:q} \
     40  1.17  christos 	    LD=${LD:q} STRIP=${STRIP:q} \
     41  1.17  christos 	    AR=${AR:q} NM=${NM:q} \
     42  1.17  christos 	    RANLIB=${RANLIB:q} SIZE=${SIZE:q} \
     43  1.17  christos 	    MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:q} \
     44  1.17  christos 	    ZCPPFLAGS=${CPPFLAGS:S@^-I.@-I${ZDOTDIR}@g:q} \
     45  1.17  christos 	    ZMISCCPPFLAGS=${ZMISCCPPFLAGS:q} \
     46   1.2       cgd 	    ${ZMISCMAKEFLAGS}
     47   1.1       cgd 
     48   1.9  sommerfe ${ZLIB}:		.NOTMAIN .MAKE __always_make_zlib
     49   1.1       cgd 	@echo making sure the z library is up to date...
     50   1.1       cgd .if (${Z_AS} == "library")
     51   1.1       cgd 	@${ZMAKE} libz.a
     52   1.1       cgd .else
     53   1.1       cgd 	@${ZMAKE} libz.o
     54   1.1       cgd .endif
     55   1.1       cgd 
     56   1.9  sommerfe ${ZLIB_PROF}:		.NOTMAIN .MAKE __always_make_zlib
     57   1.2       cgd 	@echo making sure the profiled z library is up to date...
     58   1.2       cgd .if (${Z_AS} == "library")
     59   1.2       cgd 	@${ZMAKE} libz_p.a
     60   1.2       cgd .else
     61   1.2       cgd 	@${ZMAKE} libz.po
     62   1.2       cgd .endif
     63   1.2       cgd 
     64   1.2       cgd clean:			.NOTMAIN cleanzlib
     65  1.10       jmc cleanzlib:		.NOTMAIN
     66   1.1       cgd 	@echo cleaning the z library objects
     67  1.11      matt 	@if [ -d "${ZDST}" ]; then ${ZMAKE} clean; fi
     68   1.1       cgd 
     69   1.5     lukem cleandir distclean:	.NOTMAIN cleandirzlib
     70  1.10       jmc cleandirzlib:		.NOTMAIN
     71   1.2       cgd 	@echo cleandiring the z library objects
     72  1.11      matt 	@if [ -d "${ZDST}" ]; then ${ZMAKE} cleandir; fi
     73   1.2       cgd 
     74  1.12       dsl dependall depend:	.NOTMAIN dependzlib
     75   1.9  sommerfe dependzlib:		.NOTMAIN .MAKE __always_make_zlib
     76   1.1       cgd 	@echo depending the z library objects
     77   1.1       cgd 	@${ZMAKE} depend
     78   1.1       cgd 
     79   1.1       cgd __always_make_zlib:	.NOTMAIN
     80   1.1       cgd 	@mkdir -p ${ZDST}
     81   1.6  drochner 
     82   1.6  drochner .PHONY: __always_make_zlib
     83   1.6  drochner .PHONY: cleanzlib cleandirzlib dependzlib
     84