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'.
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 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
31 SALIB= ${SADST}/libsa.a
32 SALIB_PROF= ${SADST}/libsa_p.a
34 ZLIBSRCDIR:= ${.PARSEDIR}/../../../common/dist/zlib
35 SAMISCCPPFLAGS+=-I${ZLIBSRCDIR}
38 cd ${SADST} && ${MAKE} -f ${SADIR:Q}/Makefile \
40 CC=${CC:Q} CFLAGS=${CFLAGS:Q} CPUFLAGS= \
41 AS=${AS:Q} AFLAGS=${AFLAGS: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} \
52 ${SALIB}: .NOTMAIN .MAKE __always_make_salib
53 @echo making sure the sa library is up to date...
54 .if (${SA_AS} == "library")
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")
68 clean: .NOTMAIN cleansalib
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
83 __always_make_salib: .NOTMAIN
86 .PHONY: __always_make_salib
87 .PHONY: cleansalib cleandirsalib dependsalib