custom message type for VM_INFO
[minix3.git] / sys / lib / libsa / Makefile.inc
blobb0ea54909445c41eec098ac6ae78c5c008c437cb
1 #       $NetBSD: Makefile.inc,v 1.21 2012/12/12 15:12:11 matt Exp $
3 #       Configuration variables (default values are below):
5 #       S       must be set to the top of the 'sys' tree.
6 #       SADST   may be set to the location of the directory where library
7 #               objects are to be built.  Defaults to ${.OBJDIR}/lib/sa.
8 #       SA_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 #       SAMISCCPPFLAGS
12 #               Miscellaneous cpp flags to be passed to the library's Makefile
13 #               when building.
14 #       SAMISCMAKEFLAGS
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 SADST?=         ${.OBJDIR}/lib/sa
21 SA_AS?=         library
22 SADOTDIR?= ../../.
24 CWARNFLAGS.clang+=      -Wno-format-extra-args
26 SADIR=          ${S:S@^.@${SADOTDIR}@:Q}/lib/libsa
27 .if (${SA_AS} == "obj")
28 SALIB=          ${SADST}/libsa.o
29 SALIB_PROF=     ${SADST}/libsa.po
30 .else
31 SALIB=          ${SADST}/libsa.a
32 SALIB_PROF=     ${SADST}/libsa_p.a
33 .endif
34 ZLIBSRCDIR:=    ${.PARSEDIR}/../../../common/dist/zlib
35 SAMISCCPPFLAGS+=-I${ZLIBSRCDIR}
37 SAMAKE= \
38         cd ${SADST} && ${MAKE} -f ${SADIR:Q}/Makefile \
39             SADIR=${SADIR:Q} \
40             CC=${CC:Q} CFLAGS=${CFLAGS:Q} CPUFLAGS= \
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             SACPPFLAGS=${CPPFLAGS:S@^-I.@-I${SADOTDIR}@g:Q} \
49             SAMISCCPPFLAGS=${SAMISCCPPFLAGS:Q} \
50             ${SAMISCMAKEFLAGS}
52 ${SALIB}:               .NOTMAIN .MAKE __always_make_salib
53         @echo making sure the sa library is up to date...
54 .if (${SA_AS} == "library")
55         @${SAMAKE} libsa.a
56 .else
57         @${SAMAKE} libsa.o
58 .endif
60 ${SALIB_PROF}:          .NOTMAIN .MAKE __always_make_salib
61         @echo making sure the profiled sa library is up to date...
62 .if (${SA_AS} == "library")
63         @${SAMAKE} libsa_p.a
64 .else
65         @${SAMAKE} libsa.po
66 .endif
68 clean:                  .NOTMAIN cleansalib
69 cleansalib:             .NOTMAIN
70         @echo cleaning the sa library objects
71         @if [ -d "${SADST}" ]; then ${SAMAKE} clean; fi
73 cleandir distclean:     .NOTMAIN cleandirsalib
74 cleandirsalib:          .NOTMAIN
75         @echo cleandiring the sa library objects
76         @if [ -d "${SADST}" ]; then ${SAMAKE} cleandir; fi
78 dependall depend:       .NOTMAIN dependsalib
79 dependsalib:            .NOTMAIN .MAKE __always_make_salib
80         @echo depending the sa library objects
81         @${SAMAKE} depend
83 __always_make_salib:    .NOTMAIN
84         @mkdir -p ${SADST}
86 .PHONY: __always_make_salib
87 .PHONY: cleansalib cleandirsalib dependsalib