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