mkfs: move directory entry manipulation
[minix.git] / sys / lib / libz / Makefile.inc
blob12e0108381bd4ec91709585f5636fcb4aa55da9e
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'.
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.
19 # Default values:
20 ZDST?=          ${.OBJDIR}/lib/z
21 Z_AS?=          library
22 ZDOTDIR?= ../../../../../.
24 .ifndef __MINIX
25 ZDIR=           ${S:S@^.@${ZDOTDIR}@:Q}/lib/libz
26 .else
27 ZDIR=           ${.CURDIR}/${ZDOTDIR}/lib/libz
28 .endif
29 .if (${Z_AS} == "obj")
30 ZLIB=           ${ZDST}/libz.o
31 ZLIB_PROF=      ${ZDST}/libz.po
32 .else
33 ZLIB=           ${ZDST}/libz.a
34 ZLIB_PROF=      ${ZDST}/libz_p.a
35 .endif
37 ZMAKE= \
38         cd ${ZDST} && ${MAKE} -f ${ZDIR:Q}/Makefile \
39             ZDIR=${ZDIR:Q} \
40             CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
41             AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
42             LORDER=${LORDER:Q} \
43             TSORT=${TSORT: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} \
50             ${ZMISCMAKEFLAGS}
52 ${ZLIB}:                .NOTMAIN .MAKE __always_make_zlib
53         @echo making sure the z library is up to date...
54 .if (${Z_AS} == "library")
55         @${ZMAKE} libz.a
56 .else
57         @${ZMAKE} libz.o
58 .endif
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")
63         @${ZMAKE} libz_p.a
64 .else
65         @${ZMAKE} libz.po
66 .endif
68 clean:                  .NOTMAIN cleanzlib
69 cleanzlib:              .NOTMAIN
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
81         @${ZMAKE} depend
83 __always_make_zlib:     .NOTMAIN
84         @mkdir -p ${ZDST}
86 .PHONY: __always_make_zlib
87 .PHONY: cleanzlib cleandirzlib dependzlib