1 1.17 lukem # $NetBSD: defs.mk.in,v 1.17 2023/06/03 09:10:13 lukem 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.12 apb COMPATLIB_UNINSTALLED ?= no 48 1.11 apb # Use library and includes by default. 49 1.11 apb COMPATLIB_NO_LIB ?= no 50 1.11 apb 51 1.11 apb .if "${COMPATLIB_UNINSTALLED}" == "yes" 52 1.11 apb # The library lives in the .OBJDIR. 53 1.11 apb # 54 1.11 apb # Some include files live directly in the .OBJDIR, while others 55 1.11 apb # live in subdirectories of .OBJDIR/include. 56 1.11 apb # 57 1.11 apb COMPATOBJ:= ${.PARSEDIR} 58 1.11 apb COMPATLIBDIR= ${COMPATOBJ} 59 1.11 apb COMPATINCFLAGS= -I${COMPATOBJ} -I${COMPATOBJ}/include 60 1.11 apb .else 61 1.11 apb # The library lives in TOOLDIR/lib. 62 1.11 apb # 63 1.11 apb # All include files live in TOOLDIR/include/comnpat, and its subdirectories. 64 1.11 apb # 65 1.11 apb COMPATLIBDIR= ${TOOLDIR}/lib 66 1.11 apb COMPATINCFLAGS= -I${TOOLDIR}/include/compat 67 1.11 apb .endif 68 1.1 tv 69 1.2 tv 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.14 lukem HOST_CFLAGS+= @CC_NO_CPP_PRECOMP@ 75 1.3 tv 76 1.15 lukem # Override HOST_CC support for <bsd.own.mk> CC_* warnings 77 1.15 lukem # 78 1.17 lukem CC_WNO_ADDRESS_OF_PACKED_MEMBER=@CC_WNO_ADDRESS_OF_PACKED_MEMBER@ @CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER@ 79 1.17 lukem CC_WNO_CAST_FUNCTION_TYPE=@CC_WNO_CAST_FUNCTION_TYPE@ 80 1.17 lukem CC_WNO_FORMAT_OVERFLOW=@CC_WNO_FORMAT_OVERFLOW@ 81 1.16 lukem CC_WNO_FORMAT_TRUNCATION=@CC_WNO_FORMAT_TRUNCATION@ 82 1.17 lukem CC_WNO_IMPLICIT_FALLTHROUGH=@CC_WNO_IMPLICIT_FALLTHROUGH@ 83 1.16 lukem CC_WNO_MAYBE_UNINITIALIZED=@CC_WNO_MAYBE_UNINITIALIZED@ 84 1.17 lukem CC_WNO_RETURN_LOCAL_ADDR=@CC_WNO_RETURN_LOCAL_ADDR@ 85 1.16 lukem CC_WNO_STRINGOP_OVERFLOW=@CC_WNO_STRINGOP_OVERFLOW@ 86 1.16 lukem CC_WNO_STRINGOP_TRUNCATION=@CC_WNO_STRINGOP_TRUNCATION@ 87 1.15 lukem 88 1.11 apb HOST_CPPFLAGS+= ${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \ 89 1.11 apb -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 90 1.3 tv 91 1.11 apb .if "${COMPATLIB_NO_LIB}" != "yes" 92 1.11 apb DPADD+= ${COMPATLIBDIR}/libnbcompat.a 93 1.11 apb LDADD+= -L${COMPATLIBDIR} -lnbcompat @LIBS@ 94 1.11 apb .endif # ! COMPATLIB_NO_LIB 95