1 # $NetBSD: Makefile.inc,v 1.17 2003/11/07 23:34:28 dsl Exp $
2 #
3 # Configuration variables (default values are below):
4 #
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.
18
19 # Default values:
20 SADST?= ${.OBJDIR}/lib/sa
21 SA_AS?= library
22 SADOTDIR?= ../../.
23
24 SADIR= ${S:S@^.@${SADOTDIR}@:Q}/lib/libsa
25 .if (${SA_AS} == "obj")
26 SALIB= ${SADST}/libsa.o
27 SALIB_PROF= ${SADST}/libsa.po
28 .else
29 SALIB= ${SADST}/libsa.a
30 SALIB_PROF= ${SADST}/libsa_p.a
31 .endif
32
33 SAMAKE= \
34 cd ${SADST} && ${MAKE} -f ${SADIR:Q}/Makefile \
35 SADIR=${SADIR:Q} \
36 CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
37 AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
38 LORDER=${LORDER:Q} \
39 TSORT=${TSORT:Q} \
40 LD=${LD:Q} STRIP=${STRIP:Q} \
41 AR=${AR:Q} NM=${NM:Q} \
42 RANLIB=${RANLIB:Q} SIZE=${SIZE:Q} \
43 MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
44 SACPPFLAGS=${CPPFLAGS:S@^-I.@-I${SADOTDIR}@g:Q} \
45 SAMISCCPPFLAGS=${SAMISCCPPFLAGS:Q} \
46 ${SAMISCMAKEFLAGS}
47
48 ${SALIB}: .NOTMAIN .MAKE __always_make_salib
49 @echo making sure the sa library is up to date...
50 .if (${SA_AS} == "library")
51 @${SAMAKE} libsa.a
52 .else
53 @${SAMAKE} libsa.o
54 .endif
55
56 ${SALIB_PROF}: .NOTMAIN .MAKE __always_make_salib
57 @echo making sure the profiled sa library is up to date...
58 .if (${SA_AS} == "library")
59 @${SAMAKE} libsa_p.a
60 .else
61 @${SAMAKE} libsa.po
62 .endif
63
64 clean: .NOTMAIN cleansalib
65 cleansalib: .NOTMAIN
66 @echo cleaning the sa library objects
67 @if [ -d "${SADST}" ]; then ${SAMAKE} clean; fi
68
69 cleandir distclean: .NOTMAIN cleandirsalib
70 cleandirsalib: .NOTMAIN
71 @echo cleandiring the sa library objects
72 @if [ -d "${SADST}" ]; then ${SAMAKE} cleandir; fi
73
74 dependall depend: .NOTMAIN dependsalib
75 dependsalib: .NOTMAIN .MAKE __always_make_salib
76 @echo depending the sa library objects
77 @${SAMAKE} depend
78
79 __always_make_salib: .NOTMAIN
80 @mkdir -p ${SADST}
81
82 .PHONY: __always_make_salib
83 .PHONY: cleansalib cleandirsalib dependsalib
Cache object: d6249101af9b37352b9d2a6a45352e3e
|