make vfs & filesystems use failable copying
[minix3.git] / tools / compat / defs.mk.in
blobeb5a48a67d1244356958cfbfe34c79446cceef61
1 # $NetBSD: defs.mk.in,v 1.12 2012/12/02 13:05:14 apb Exp $
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.
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.
12 # Variables:
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.
19 # COMPATLIB_NO_LIB:
20 # If "yes" then do not use the library (but still use
21 # the include files).
23 # Examples:
25 # * Use uninstalled copy of libnbcompat and associated *.h files:
27 # COMPATLIB_UNINSTALLED= yes
28 # COMPATOBJ!= cd ${NETBSDSRCDIR}/tools/compat && ${PRINTOBJDIR}
29 # .-include "${COMPATOBJ}/defs.mk"
31 # * Use TOOLDIR copy of libnbcompat and associated *.h files:
33 # .-include "${TOOLDIR}/share/compat/defs.mk"
35 # * Use TOOLDIR copy of compat *.h files, but do not use libnbcompat.a:
37 # COMPATLIB_NO_LIB= yes
38 # .-include "${TOOLDIR}/share/compat/defs.mk"
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".
44 .include <bsd.own.mk>
46 # Use the installed (TOOLDIR) version of the library and headers by default
47 COMPATLIB_UNINSTALLED ?= no
48 # Use library and includes by default.
49 COMPATLIB_NO_LIB ?= no
51 .if "${COMPATLIB_UNINSTALLED}" == "yes"
52 # The library lives in the .OBJDIR.
54 # Some include files live directly in the .OBJDIR, while others
55 # live in subdirectories of .OBJDIR/include.
57 COMPATOBJ:= ${.PARSEDIR}
58 COMPATLIBDIR= ${COMPATOBJ}
59 COMPATINCFLAGS= -I${COMPATOBJ} -I${COMPATOBJ}/include
60 .else
61 # The library lives in TOOLDIR/lib.
63 # All include files live in TOOLDIR/include/comnpat, and its subdirectories.
65 COMPATLIBDIR= ${TOOLDIR}/lib
66 COMPATINCFLAGS= -I${TOOLDIR}/include/compat
67 .endif
69 HOSTEXEEXT= @EXEEXT@
70 HOST_BSHELL= @BSHELL@
72 BUILD_OSTYPE!= uname -s
74 # Disable use of pre-compiled headers on Darwin.
75 .if ${BUILD_OSTYPE} == "Darwin"
76 HOST_CPPFLAGS+= -no-cpp-precomp
77 .endif
79 HOST_CPPFLAGS+= ${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \
80 -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
82 .if "${COMPATLIB_NO_LIB}" != "yes"
83 DPADD+= ${COMPATLIBDIR}/libnbcompat.a
84 LDADD+= -L${COMPATLIBDIR} -lnbcompat @LIBS@
85 .endif # ! COMPATLIB_NO_LIB
87 HAVE_PTHREAD_H= @HAVE_PTHREAD_H@