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