Home | History | Annotate | Line # | Download | only in libsa
Makefile.inc revision 1.11
      1 #	$NetBSD: Makefile.inc,v 1.11 1998/09/05 15:15:19 lukem 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 	    LORDER=${LORDER:Q} \
     37 	    TSORT=${TSORT:Q} \
     38 	    LD=${LD:Q} STRIP=${STRIP:Q} \
     39 	    AR=${AR:Q} NM=${NM:Q} \
     40 	    RANLIB=${RANLIB:Q} SIZE=${SIZE:Q} \
     41 	    MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:Q} \
     42 	    SACPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:Q} \
     43 	    SAMISCCPPFLAGS=${SAMISCCPPFLAGS:Q} \
     44 	    ${SAMISCMAKEFLAGS}
     45 
     46 ${SALIB}:		.NOTMAIN __always_make_salib
     47 	@echo making sure the sa library is up to date...
     48 .if (${SA_AS} == "library")
     49 	@${SAMAKE} libsa.a
     50 .else
     51 	@${SAMAKE} libsa.o
     52 .endif
     53 
     54 ${SALIB_PROF}:		.NOTMAIN __always_make_salib
     55 	@echo making sure the profiled sa library is up to date...
     56 .if (${SA_AS} == "library")
     57 	@${SAMAKE} libsa_p.a
     58 .else
     59 	@${SAMAKE} libsa.po
     60 .endif
     61 
     62 clean:			.NOTMAIN cleansalib
     63 cleansalib:		.NOTMAIN __always_make_salib
     64 	@echo cleaning the sa library objects
     65 	@${SAMAKE} clean
     66 
     67 cleandir distclean:	.NOTMAIN cleandirsalib
     68 cleandirsalib:		.NOTMAIN __always_make_salib
     69 	@echo cleandiring the sa library objects
     70 	@${SAMAKE} cleandir
     71 
     72 depend:			.NOTMAIN dependsalib
     73 dependsalib:		.NOTMAIN __always_make_salib
     74 	@echo depending the sa library objects
     75 	@${SAMAKE} depend
     76 
     77 __always_make_salib:	.NOTMAIN
     78 	@mkdir -p ${SADST}
     79