Home | History | Annotate | Line # | Download | only in libsa
Makefile.inc revision 1.9
      1 #	$NetBSD: Makefile.inc,v 1.9 1997/02/16 21:25:21 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 #	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 
     23 SADIR=		$S/lib/libsa
     24 .if (${SA_AS} == "obj")
     25 SALIB=		${SADST}/libsa.o
     26 SALIB_PROF=	${SADST}/libsa.po
     27 .else
     28 SALIB=		${SADST}/libsa.a
     29 SALIB_PROF=	${SADST}/libsa_p.a
     30 .endif
     31 
     32 SAMAKE= \
     33 	cd ${SADIR} && MAKEOBJDIR=${SADST} ${MAKE} \
     34 	    CC=${CC:Q} CFLAGS=${CFLAGS:Q} \
     35 	    AS=${AS:Q} AFLAGS=${AFLAGS:Q} \
     36 	    LD=${LD:Q} STRIP=${STRIP:Q} \
     37 	    MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
     38 	    SACPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:Q} \
     39 	    SAMISCCPPFLAGS=${SAMISCCPPFLAGS:Q} \
     40 	    ${SAMISCMAKEFLAGS}
     41 
     42 ${SALIB}:		.NOTMAIN __always_make_salib
     43 	@echo making sure the sa library is up to date...
     44 .if (${SA_AS} == "library")
     45 	@${SAMAKE} libsa.a
     46 .else
     47 	@${SAMAKE} libsa.o
     48 .endif
     49 
     50 ${SALIB_PROF}:		.NOTMAIN __always_make_salib
     51 	@echo making sure the profiled sa library is up to date...
     52 .if (${SA_AS} == "library")
     53 	@${SAMAKE} libsa_p.a
     54 .else
     55 	@${SAMAKE} libsa.po
     56 .endif
     57 
     58 clean:			.NOTMAIN cleansalib
     59 cleansalib:		.NOTMAIN __always_make_salib
     60 	@echo cleaning the sa library objects
     61 	@${SAMAKE} clean
     62 
     63 cleandir:		.NOTMAIN cleandirsalib
     64 cleandirsalib:		.NOTMAIN __always_make_salib
     65 	@echo cleandiring the sa library objects
     66 	@${SAMAKE} cleandir
     67 
     68 depend:			.NOTMAIN dependsalib
     69 dependsalib:		.NOTMAIN __always_make_salib
     70 	@echo depending the sa library objects
     71 	@${SAMAKE} depend
     72 
     73 __always_make_salib:	.NOTMAIN
     74 	@mkdir -p ${SADST}
     75