Makefile.inc revision 1.8
1#	$NetBSD: Makefile.inc,v 1.8 1997/01/23 22:29:08 cgd 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#	SAMISCMAKEFLAGS
12#		Miscellaneous flags to be passed to the library's Makefile when
13#		building.  See library's Makefile for more details about
14#		supported flags and their default values.
15
16# Default values:
17SADST?=		${.OBJDIR}/lib/sa
18SA_AS?=		library
19
20SADIR=		$S/lib/libsa
21.if (${SA_AS} == "obj")
22SALIB=		${SADST}/libsa.o
23SALIB_PROF=	${SADST}/libsa.po
24.else
25SALIB=		${SADST}/libsa.a
26SALIB_PROF=	${SADST}/libsa_p.a
27.endif
28
29SAMAKE= \
30	cd ${SADIR} && MAKEOBJDIR=${SADST} ${MAKE} \
31	    CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
32	    AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
33	    LD=${LD:Q} STRIP=${STRIP:Q} \
34	    MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
35	    SACPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:Q} \
36	    ${SAMISCMAKEFLAGS}
37
38${SALIB}:		.NOTMAIN __always_make_salib
39	@echo making sure the sa library is up to date...
40.if (${SA_AS} == "library")
41	@${SAMAKE} libsa.a
42.else
43	@${SAMAKE} libsa.o
44.endif
45
46${SALIB_PROF}:		.NOTMAIN __always_make_salib
47	@echo making sure the profiled sa library is up to date...
48.if (${SA_AS} == "library")
49	@${SAMAKE} libsa_p.a
50.else
51	@${SAMAKE} libsa.po
52.endif
53
54clean:			.NOTMAIN cleansalib
55cleansalib:		.NOTMAIN __always_make_salib
56	@echo cleaning the sa library objects
57	@${SAMAKE} clean
58
59cleandir:		.NOTMAIN cleandirsalib
60cleandirsalib:		.NOTMAIN __always_make_salib
61	@echo cleandiring the sa library objects
62	@${SAMAKE} cleandir
63
64depend:			.NOTMAIN dependsalib
65dependsalib:		.NOTMAIN __always_make_salib
66	@echo depending the sa library objects
67	@${SAMAKE} depend
68
69__always_make_salib:	.NOTMAIN
70	@mkdir -p ${SADST}
71