1 # $NetBSD: Makefile.inc,v 1.18 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 # 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'.
12 # Miscellaneous cpp flags to be passed to the library's Makefile
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.
20 SADST?= ${.OBJDIR}/lib/sa
24 SADIR= ${S:S@^.@${SADOTDIR}@:Q}/lib/libsa
25 .if (${SA_AS} == "obj")
26 SALIB= ${SADST}/libsa.o
27 SALIB_PROF= ${SADST}/libsa.po
29 SALIB= ${SADST}/libsa.a
30 SALIB_PROF= ${SADST}/libsa_p.a
32 ZLIBSRCDIR:= ${.PARSEDIR}/../../../common/dist/zlib
33 SAMISCCPPFLAGS+=-I${ZLIBSRCDIR}
36 cd ${SADST} && ${MAKE} -f ${SADIR:Q}/Makefile \
38 CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
39 AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
42 LD=${LD:Q} STRIP=${STRIP:Q} \
43 AR=${AR:Q} NM=${NM:Q} \
44 RANLIB=${RANLIB:Q} SIZE=${SIZE:Q} \
45 MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
46 SACPPFLAGS=${CPPFLAGS:S@^-I.@-I${SADOTDIR}@g:Q} \
47 SAMISCCPPFLAGS=${SAMISCCPPFLAGS:Q} \
50 ${SALIB}: .NOTMAIN .MAKE __always_make_salib
51 @echo making sure the sa library is up to date...
52 .if (${SA_AS} == "library")
58 ${SALIB_PROF}: .NOTMAIN .MAKE __always_make_salib
59 @echo making sure the profiled sa library is up to date...
60 .if (${SA_AS} == "library")
66 clean: .NOTMAIN cleansalib
68 @echo cleaning the sa library objects
69 @if [ -d "${SADST}" ]; then ${SAMAKE} clean; fi
71 cleandir distclean: .NOTMAIN cleandirsalib
72 cleandirsalib: .NOTMAIN
73 @echo cleandiring the sa library objects
74 @if [ -d "${SADST}" ]; then ${SAMAKE} cleandir; fi
76 dependall depend: .NOTMAIN dependsalib
77 dependsalib: .NOTMAIN .MAKE __always_make_salib
78 @echo depending the sa library objects
81 __always_make_salib: .NOTMAIN
84 .PHONY: __always_make_salib
85 .PHONY: cleansalib cleandirsalib dependsalib