Home | History | Annotate | Line # | Download | only in compat
defs.mk.in revision 1.10.8.1
      1  1.10.8.1      tls #	$NetBSD: defs.mk.in,v 1.10.8.1 2013/02/25 00:30:29 tls Exp $
      2  1.10.8.1      tls #
      3  1.10.8.1      tls # Makefile fragment for building with libnbcompat and associated
      4  1.10.8.1      tls # include files.  It can also be used for building just with
      5  1.10.8.1      tls # the include files, without the library.
      6  1.10.8.1      tls #
      7  1.10.8.1      tls # This can be used when the library and include files have been installed
      8  1.10.8.1      tls # into TOOLDIR (by "make install" in the src/tools/compat directory),
      9  1.10.8.1      tls # or when they have not been installed into TOOLDIR but reside
     10  1.10.8.1      tls # in the .OBJDIR associated with src/tools/compat.
     11  1.10.8.1      tls #
     12  1.10.8.1      tls # Variables:
     13  1.10.8.1      tls #
     14  1.10.8.1      tls # COMPATLIB_UNINSTALLED:
     15  1.10.8.1      tls #		If "yes", then use the files from the .OBJDIR of
     16  1.10.8.1      tls #		NETBSDSRCDIR/tools/compat.  Otherwise, use the files
     17  1.10.8.1      tls #		from TOOLDIR.
     18  1.10.8.1      tls #
     19  1.10.8.1      tls # COMPATLIB_NO_LIB:
     20  1.10.8.1      tls #		If "yes" then do not use the library (but still use
     21  1.10.8.1      tls #		the include files).
     22  1.10.8.1      tls #
     23  1.10.8.1      tls # Examples:
     24  1.10.8.1      tls #
     25  1.10.8.1      tls # * Use uninstalled copy of libnbcompat and associated *.h files:
     26  1.10.8.1      tls #
     27  1.10.8.1      tls #	COMPATLIB_UNINSTALLED= yes
     28  1.10.8.1      tls #	COMPATOBJ!=	cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
     29  1.10.8.1      tls #	.-include	"${COMPATOBJ}/defs.mk"
     30  1.10.8.1      tls #
     31  1.10.8.1      tls # * Use TOOLDIR copy of libnbcompat and associated *.h files:
     32  1.10.8.1      tls #
     33  1.10.8.1      tls #	.-include	"${TOOLDIR}/share/compat/defs.mk"
     34  1.10.8.1      tls #
     35  1.10.8.1      tls # * Use TOOLDIR copy of compat *.h files, but do not use libnbcompat.a:
     36  1.10.8.1      tls #
     37  1.10.8.1      tls #	COMPATLIB_NO_LIB= yes
     38  1.10.8.1      tls #	.-include	"${TOOLDIR}/share/compat/defs.mk"
     39  1.10.8.1      tls #
     40  1.10.8.1      tls # The use of ".-include" instead of ".include" above is because it's
     41  1.10.8.1      tls # expected that the file might not exist during "make obj" or "make clean".
     42  1.10.8.1      tls #
     43  1.10.8.1      tls 
     44  1.10.8.1      tls .include <bsd.own.mk>
     45  1.10.8.1      tls 
     46  1.10.8.1      tls # Use the installed (TOOLDIR) version of the library and headers by default
     47  1.10.8.1      tls COMPATLIB_UNINSTALLED ?= no
     48  1.10.8.1      tls # Use library and includes by default.
     49  1.10.8.1      tls COMPATLIB_NO_LIB ?= no
     50  1.10.8.1      tls 
     51  1.10.8.1      tls .if "${COMPATLIB_UNINSTALLED}" == "yes"
     52  1.10.8.1      tls # The library lives in the .OBJDIR.
     53  1.10.8.1      tls #
     54  1.10.8.1      tls # Some include files live directly in the .OBJDIR, while others
     55  1.10.8.1      tls # live in subdirectories of .OBJDIR/include.
     56  1.10.8.1      tls #
     57       1.3       tv COMPATOBJ:=	${.PARSEDIR}
     58  1.10.8.1      tls COMPATLIBDIR=	${COMPATOBJ}
     59  1.10.8.1      tls COMPATINCFLAGS=	-I${COMPATOBJ} -I${COMPATOBJ}/include
     60  1.10.8.1      tls .else
     61  1.10.8.1      tls # The library lives in TOOLDIR/lib.
     62  1.10.8.1      tls #
     63  1.10.8.1      tls # All include files live in TOOLDIR/include/comnpat, and its subdirectories.
     64  1.10.8.1      tls #
     65  1.10.8.1      tls COMPATLIBDIR=	${TOOLDIR}/lib
     66  1.10.8.1      tls COMPATINCFLAGS=	-I${TOOLDIR}/include/compat
     67  1.10.8.1      tls .endif
     68       1.5  thorpej 
     69  1.10.8.1      tls HOSTEXEEXT=	@EXEEXT@
     70       1.5  thorpej HOST_BSHELL=	@BSHELL@
     71       1.6  thorpej 
     72       1.6  thorpej BUILD_OSTYPE!=  uname -s
     73       1.6  thorpej 
     74       1.6  thorpej # Disable use of pre-compiled headers on Darwin.
     75       1.6  thorpej .if ${BUILD_OSTYPE} == "Darwin"
     76       1.6  thorpej HOST_CPPFLAGS+=	-no-cpp-precomp
     77       1.6  thorpej .endif
     78       1.3       tv 
     79  1.10.8.1      tls HOST_CPPFLAGS+=	${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \
     80  1.10.8.1      tls 		-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
     81       1.3       tv 
     82  1.10.8.1      tls .if "${COMPATLIB_NO_LIB}" != "yes"
     83  1.10.8.1      tls DPADD+=		${COMPATLIBDIR}/libnbcompat.a
     84  1.10.8.1      tls LDADD+=		-L${COMPATLIBDIR} -lnbcompat @LIBS@
     85  1.10.8.1      tls .endif # ! COMPATLIB_NO_LIB
     86      1.10      apb 
     87      1.10      apb HAVE_PTHREAD_H=	@HAVE_PTHREAD_H@
     88