Home | History | Annotate | Line # | Download | only in libsa
      1  1.27  christos #	$NetBSD: Makefile.inc,v 1.27 2023/08/30 18:47:56 christos Exp $
      2   1.1    brezak #
      3   1.8       cgd #	Configuration variables (default values are below):
      4   1.8       cgd #
      5   1.8       cgd #	S	must be set to the top of the 'sys' tree.
      6   1.8       cgd #	SADST	may be set to the location of the directory where library
      7   1.8       cgd #		objects are to be built.  Defaults to ${.OBJDIR}/lib/sa.
      8   1.8       cgd #	SA_AS	may be set to 'obj' to build a object from the library's
      9   1.8       cgd #		object files.  (Otherwise, a library will be built.)
     10   1.8       cgd #		Defaults to 'library'.
     11   1.9       cgd #	SAMISCCPPFLAGS
     12   1.9       cgd #		Miscellaneous cpp flags to be passed to the library's Makefile
     13   1.9       cgd #		when building.
     14   1.8       cgd #	SAMISCMAKEFLAGS
     15   1.8       cgd #		Miscellaneous flags to be passed to the library's Makefile when
     16   1.8       cgd #		building.  See library's Makefile for more details about
     17   1.8       cgd #		supported flags and their default values.
     18   1.8       cgd 
     19   1.8       cgd # Default values:
     20   1.8       cgd SADST?=		${.OBJDIR}/lib/sa
     21   1.8       cgd SA_AS?=		library
     22  1.12  drochner SADOTDIR?= ../../.
     23   1.8       cgd 
     24  1.20     joerg CWARNFLAGS.clang+=	-Wno-format-extra-args
     25  1.20     joerg 
     26  1.24  christos SADIR=		${S:S@^.@${SADOTDIR}@:q}/lib/libsa
     27   1.8       cgd .if (${SA_AS} == "obj")
     28   1.8       cgd SALIB=		${SADST}/libsa.o
     29   1.8       cgd SALIB_PROF=	${SADST}/libsa.po
     30   1.8       cgd .else
     31   1.8       cgd SALIB=		${SADST}/libsa.a
     32   1.8       cgd SALIB_PROF=	${SADST}/libsa_p.a
     33   1.8       cgd .endif
     34  1.19  christos ZLIBSRCDIR:=	${.PARSEDIR}/../../../common/dist/zlib
     35  1.19  christos SAMISCCPPFLAGS+=-I${ZLIBSRCDIR}
     36   1.1    brezak 
     37   1.8       cgd SAMAKE= \
     38  1.24  christos 	cd ${SADST} && ${MAKE} -f ${SADIR:q}/Makefile \
     39  1.24  christos 	    SADIR=${SADIR:q} \
     40  1.24  christos 	    CC=${CC:q} CFLAGS=${CFLAGS:q} CPUFLAGS= \
     41  1.24  christos 	    AS=${AS:q} AFLAGS=${AFLAGS:q} \
     42  1.24  christos 	    LORDER=${LORDER:q} \
     43  1.24  christos 	    TSORT=${TSORT:q} \
     44  1.24  christos 	    LD=${LD:q} STRIP=${STRIP:q} \
     45  1.24  christos 	    AR=${AR:q} NM=${NM:q} \
     46  1.27  christos 	    COPTS=${COPTS:q} \
     47  1.24  christos 	    RANLIB=${RANLIB:q} SIZE=${SIZE:q} \
     48  1.24  christos 	    MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:q} \
     49  1.24  christos 	    SACPPFLAGS=${CPPFLAGS:S@^-I.@-I${SADOTDIR}@g:q} \
     50  1.24  christos 	    SAMISCCPPFLAGS=${SAMISCCPPFLAGS:q} \
     51   1.8       cgd 	    ${SAMISCMAKEFLAGS}
     52   1.1    brezak 
     53  1.15  sommerfe ${SALIB}:		.NOTMAIN .MAKE __always_make_salib
     54   1.8       cgd 	@echo making sure the sa library is up to date...
     55   1.8       cgd .if (${SA_AS} == "library")
     56   1.8       cgd 	@${SAMAKE} libsa.a
     57   1.4      phil .else
     58   1.8       cgd 	@${SAMAKE} libsa.o
     59   1.4      phil .endif
     60   1.1    brezak 
     61  1.15  sommerfe ${SALIB_PROF}:		.NOTMAIN .MAKE __always_make_salib
     62   1.8       cgd 	@echo making sure the profiled sa library is up to date...
     63   1.8       cgd .if (${SA_AS} == "library")
     64   1.8       cgd 	@${SAMAKE} libsa_p.a
     65   1.8       cgd .else
     66   1.8       cgd 	@${SAMAKE} libsa.po
     67   1.8       cgd .endif
     68   1.8       cgd 
     69   1.8       cgd clean:			.NOTMAIN cleansalib
     70  1.16       jmc cleansalib:		.NOTMAIN
     71   1.8       cgd 	@echo cleaning the sa library objects
     72  1.16       jmc 	@if [ -d "${SADST}" ]; then ${SAMAKE} clean; fi
     73   1.8       cgd 
     74  1.11     lukem cleandir distclean:	.NOTMAIN cleandirsalib
     75  1.16       jmc cleandirsalib:		.NOTMAIN
     76   1.8       cgd 	@echo cleandiring the sa library objects
     77  1.16       jmc 	@if [ -d "${SADST}" ]; then ${SAMAKE} cleandir; fi
     78   1.8       cgd 
     79  1.17       dsl dependall depend:	.NOTMAIN dependsalib
     80  1.15  sommerfe dependsalib:		.NOTMAIN .MAKE __always_make_salib
     81   1.8       cgd 	@echo depending the sa library objects
     82   1.8       cgd 	@${SAMAKE} depend
     83   1.1    brezak 
     84   1.3        pk __always_make_salib:	.NOTMAIN
     85   1.8       cgd 	@mkdir -p ${SADST}
     86  1.12  drochner 
     87  1.12  drochner .PHONY: __always_make_salib
     88  1.12  drochner .PHONY: cleansalib cleandirsalib dependsalib
     89